Administrator
发布于 2024-08-06 / 44 阅读
0

Git第三方仓库安装方式(IUS)

官方网站 https://ius.io/setup

RHEL/CentOS 7

yum install \
https://repo.ius.io/ius-release-el7.rpm \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

1.安装使用里面说的自动化安装脚本

# curl https://setup.ius.io | sh
#!/usr/bin/bash

set -eu

if [[ $UID -ne 0 ]]; then
        echo "this script requires root privileges" >&2
        exit 1
fi

if [[ ! -e /etc/redhat-release ]]; then
        echo "not an EL distro"
        exit 1
fi

RELEASEVER=$(rpm --eval %rhel)

if [[ $RELEASEVER -ne 6 ]] && [[ $RELEASEVER -ne 7 ]]; then
        echo "unsupported OS version"
        exit 1
fi

rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-$RELEASEVER https://repo.ius.io/RPM-GPG-KEY-IUS-$RELEASEVER
yum --assumeyes install https://dl.fedoraproject.org/pub/epel/epel-release-latest-$RELEASEVER.noarch.rpm https://repo.ius.io/ius-release-el$RELEASEVER.rpm

2.然后可以看到 git2xx相关内容

# yum search git

3.删除旧的版本

# yum remove -y git

4.执行安装,并查看下版本

# yum -y install git236

# git --version