このエントリーをはてなブックマークに追加


yumコマンドでdisable中のリポリトリを対象にする方法

追加したリポジトリファイルをenabled=0しdisable中になっているリポジトリをyumコマンドのオプションで対象にする方法を以下に記します。
使用したOSではCentOSになります。


関連記事

enabled=0のリポジトリをyumコマンドの対象にする

以下のcatコマンドによる出力はEPELリポジトリの設定ファイルになります。
enabled=0となっており、yumコマンドの対象から外れていることが確認できます。

[root@centos ~]# cat /etc/yum.repos.d/epel.repo
[epel]
name=Extra Packages for Enterprise Linux 5 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch
failovermethod=priority
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL

<snip>

enablerepo実行例

enabled=0で.repoファイルのenabledを修正せずyumコマンドの対象にするには以下のようにyumコマンドを使用します。

yum オプション --enablerepo=リポジトリ名

以下の実行例では、アップデート対象があるかを調べるcheck-updateオプションに--enablerepoオプションを使いepelを指定してます。
このepelは上記で出力したetc/yum.repos.d/epel.repoの[epel]になります。
epelを一時的に有効にするため、--enablerepo=epelと指定しています。

[root@centos ~]# yum check-update --enablerepo=epel
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * epel: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
epel                                                     | 3.7 kB     00:00
epel/primary_db                                          | 3.8 MB     00:05
Skipping security plugin, no data
[root@centos ~]#


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2015-03-20 (金) 22:30:18