
まず第一に、私は通常、異なる主要なOSバージョンのyumリポジトリを混在させることが非常に悪い考えであることを理解しています。
ただし、CentOS 7ではCentOS 6の一部のパッケージが必要です。だから私はCentOS 6リポジトリを追加し、$releasever
それを明示的なリポジトリに置き換えました6.8
(再びそれは非常に残念です)。
実行中
yum list foobar
CentOS 7と6で利用可能なすべてのfoobarバージョンのリストを取得したいと思います。ただし、yumはel7
パッケージのみを表示します。foobar
有効なCentOS 6リポジトリに存在することを確認しました。
CentOS 6パッケージをダウンロード/インストールできることを望みましたが、失敗しました。
# yum --disablerepo="*" --enablerepo="CentOS-6*" install foobar
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
There are no enabled repos.
Run "yum repolist all" to see the repos you have.
You can enable repos with yum-config-manager --enable <repo>
提案どおりにリポジトリを確認してください。
# yum repolist all |grep "CentOS-6.8 - Base"
base_6/x86_64 CentOS-6.8 - Base enabled: 6,696
yumはリポジトリがメジャーリリースに適していることを明示的に確認しますか?それとも別のものを見逃していますか?
答え1
/etc/yum.repo.d/でCentOS 6 Baseリポジトリファイルを確認すると、次の文字列が見つかります。
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
CentOS 7の$ releasever変数は常に7なので、このリポジトリに何かをインストールするには、この変数を6に変更する必要があります。