我使用了通常的:
yum install git
它没有在我的CentOS 6上安装最新版本的git。如何更新到CentOS 6的最新版本?该解决方案可适用于CentOS 7等较新版本的CentOS。
发布于 2016-07-01 05:53:16
Rackspace维护ius repository,其中包含合理最新的git,但必须首先删除库存git。
CentOS 6或7指令(以超级用户身份运行或使用sudo运行):
# retrieve and check CENTOS_MAIN_VERSION (6 or 7):
CENTOS_MAIN_VERSION=$(cat /etc/centos-release | awk -F 'release[ ]*' '{print $2}' | awk -F '.' '{print $1}')
echo $CENTOS_MAIN_VERSION
# output should be "6" or "7"
# Install IUS Repo and Epel-Release:
yum install -y https://repo.ius.io/ius-release-el${CENTOS_MAIN_VERSION}.rpm
yum install -y epel-release
# re-install git:
yum erase -y git*
yum install -y git-core
# check version:
git --version
# output: git version 2.24.3
注意:git-all
而不是git-core
通常会安装一个旧版本。例如,尝试使用git224-all
。
该脚本在CentOS 7对接镜像(7e6257c9f8d8
)和CentOS 6对接镜像(d0957ffdf8a2
)上进行了测试。
发布于 2015-12-17 02:17:19
要在CentOS 6上构建和安装最新的Git:
yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
export GIT_VERSION=2.6.4
mkdir /root/git
cd /root/git
wget "https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz"
tar xvzf "git-${GIT_VERSION}.tar.gz"
cd git-${GIT_VERSION}
make prefix=/usr/local all
make prefix=/usr/local install
yum remove -y git
git --version # should be GIT_VERSION
发布于 2020-09-02 21:58:41
This guide起作用了:
# hostnamectl
Operating System: CentOS Linux 7 (Core)
# git --version
git version 1.8.3.1
# sudo yum remove git*
# sudo yum -y install https://packages.endpoint.com/rhel/7/os/x86_64/endpoint-repo-1.7-1.x86_64.rpm
# sudo yum install git
# git --version
git version 2.24.1
https://stackoverflow.com/questions/21820715
复制相似问题