git再インストール【CentOS】

下記コマンドで、Cannot open で上手くいかれなかったかたはぜひ試してみてください。

# yum -y install https://centos7.iuscommunity.org/ius-release.rpm
Loaded plugins: fastestmirror
Cannot open: https://centos7.iuscommunity.org/ius-release.rpm. Skipping.
Error: Nothing to do

IUSリポジトリを登録

まず、IUSリポジトリを登録します。
IUSのサイトに対処法が書かれておりますので下記コマンドを実施ください。
https://ius.io/setup

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

Gitのインストール

それではGitをインストールします。

# yum install git --enablerepo=ius --disablerepo=base,epel,extras,updates


その際に下記エラーが発生する場合は次の依存性パッケージをバージョンを合わせて行ってみてください

--> Finished Dependency Resolution
Error: Package: git224-2.24.2-1.el7.ius.x86_64 (ius)
           Requires: emacs-filesystem >= 24.3
Error: Package: git224-2.24.2-1.el7.ius.x86_64 (ius)
           Requires: libsecret-1.so.0()(64bit)
Error: Package: git224-2.24.2-1.el7.ius.x86_64 (ius)
           Requires: perl(Term::ReadKey)
Error: Package: git224-perl-Git-2.24.2-1.el7.ius.noarch (ius)
           Requires: perl(Error)
Error: Package: git224-core-2.24.2-1.el7.ius.x86_64 (ius)
           Requires: libpcre2-8.so.0()(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

以下のコマンドで依存パッケージも含めてインストールします。

# yum install git224-2.24.2-1.el7.ius.x86_64

途中でkeyのインストールが聞かれるので y を押します。

 Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-IUS-7
Importing GPG key 0x4B274DF2:
 Userid     : "IUS (7) <dev@ius.io>"
 Fingerprint: c958 7a09 a11f d706 4f0c a0f4 e558 0725 4b27 4df2
 Package    : ius-release-2-1.el7.ius.noarch (@/ius-release-el7)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-IUS-7

is this ok [y/N]:

インストールが成功しました。バージョンを確認します。

# git version
git version 2.24.2

IUSリポジトリを無効にしたい場合は、以下のコマンドを実行します。

# yum-config-manager --disable ius

お疲れさまでした

スポンサーリンク
sutaruhinをフォローする
システム・スタルヒン合同会社

コメント

タイトルとURLをコピーしました