Fixing the Error That Prevents Gogs from Downloading tar.gz Files

7,901 0

A few days ago, I used the open-source private Git code hosting tool Gogs to set up a Git mirror site. Today, I discovered a problem: it was unable to package and download files in tar.gz format, and could only download them in zip format.

As someone with obsessive-compulsive tendencies, I simply couldn't tolerate this. So I checked the error logs and finally found the cause: the Git version was too old. A simple upgrade could perfectly solve this problem. The following are the steps to upgrade Git:

Upgrade Git

  1. Download the Git 2.7.4 source package:
Bash
wget https://github.com/git/git/archive/v2.7.4.tar.gz
  1. Extract it and enter the source directory:
Bash
tar zxvf v2.7.4.tar.gz && cd git-2.7.4
  1. Configure the files:
Bash
autoconf
  1. Compile Git:
Bash
./configure
  1. Install Git:
Bash
make && make install
  1. After the installation is complete, use the following command to check the Git version:
Bash
git --version

Check whether it is version 2.7.4.

Modify the Configuration

Next, open the /etc/init.d/functions file and add /usr/local/bin to PATH. The entire line should be as follows:

Bash
PATH="/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin"

At this point, the problem preventing Gogs from downloading tar.gz files has been perfectly resolved.

Comments

(0)

No comments yet. Start the conversation.

Leave a comment

© 2026 Carefree. All rights reserved.

Carefree is a personal site about technology and everyday life, documenting web development, backend, and DevOps practices, plus software tools, digital experiences, and thoughts beyond code.