Error When Gogs Service Cannot Download tar.gz Archives

7,922 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 could not package downloads in tar.gz format and could only download them in zip format.

As someone with obsessive-compulsive tendencies, I simply couldn't stand it. So I checked the error logs and finally found the cause: the Git version was too old. Upgrading it solved the problem perfectly. 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 completely solved.

Comments

(0)

No comments yet. Start the conversation.

Leave a comment