centos7安装git报错No such file or directory

Downloading packages:


Error downloading packages:
  perl-Git-1.8.3.1-13.el7.noarch: [Errno 5] [Errno 2] No such file or directory
  perl-TermReadKey-2.30-20.el7.x86_64: [Errno 5] [Errno 2] No such file or directory
  1:perl-Error-0.17020-2.el7.noarch: [Errno 5] [Errno 2] No such file or directory
  git-1.8.3.1-13.el7.x86_64: [Errno 5] [Errno 2] No such file or directory
  rsync-3.1.2-4.el7.x86_64: [Errno 5] [Errno 2] No such file or directory
  libgnome-keyring-3.12.0-1.el7.x86_64: [Errno 5] [Errno 2] No such file or directory

git各版本压缩包下载地址

  • 下载
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.21.0.tar.gz
[root@renshen ~]# wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.21.0.tar.gz
--2019-04-18 17:52:23--  https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.21.0.tar.gz
Resolving mirrors.edge.kernel.org (mirrors.edge.kernel.org)... 147.75.101.1, 2604:1380:2001:3900::1
Connecting to mirrors.edge.kernel.org (mirrors.edge.kernel.org)|147.75.101.1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8289375 (7.9M) [application/x-gzip]
Saving to: ‘git-2.21.0.tar.gz’

100%[=================================================>] 8,289,375   1.69MB/s   in 4.7s   

2019-04-18 17:52:30 (1.69 MB/s) - ‘git-2.21.0.tar.gz’ saved [8289375/8289375]
  • 查看
[root@renshen ~]# ll
total 8116
drwxr-xr-x 3 root root    4096 Jan 25 11:58 data
-rw-r--r-- 1 root root 8289375 Feb 25 02:15 git-2.21.0.tar.gz
  • 解压
tar -zxvf  git-2.21.0.tar.gz
  • 安装
cd git-2.21.0
./configure --prefix=/usr/local/git
make
make install
  • 查看新安装的git版本号:
[root@renshen ~]#  /usr/local/git/bin/git --version
git version 2.21.0
  • 方便以后使用,建软连接
ln -s /usr/local/git/bin/* /usr/bin/
[root@renshen ~]# git --version
git version 2.21.0
    原文作者:Victor_python
    原文地址: https://www.jianshu.com/p/baf92b705da2
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞