「Yum」の版間の差分
提供: Wikinote
(ページの作成:「== 設定 == === プロキシの設定 === /etc/yum.conf に以下を追加する。 proxy=<nowiki>http://hostname:port</nowiki> proxy_username=user proxy_password=pass」) |
|||
| 行7: | 行7: | ||
proxy_username=user | proxy_username=user | ||
proxy_password=pass | proxy_password=pass | ||
| + | |||
| + | === ソースパッケージをダウンロードする === | ||
| + | |||
| + | yumdownloader --source で、ソースパッケージをダウンロードできるようにする設定方法。 | ||
| + | |||
| + | リポジトリ名を "<バイナリのリポジトリ名>-source" にしておく必要がある。 | ||
| + | また、--source を付与した場合だけ見に行くように、enabled は 0 に設定しておこう。 | ||
| + | |||
| + | # vi /etc/yum.repos.d/CentOS-Source.repo | ||
| + | [base-source] | ||
| + | name=CentOS-$releasever - Base Source | ||
| + | baseurl=http://mirror.centos.org/centos/$releasever/os/SRPMS | ||
| + | enabled=0 | ||
| + | gpgcheck=1 | ||
| + | gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 | ||
| + | |||
| + | [updates-source] | ||
| + | name=CentOS-$releasever - Updates Source | ||
| + | baseurl=http://mirror.centos.org/centos/$releasever/updates/SRPMS | ||
| + | enabled=0 | ||
| + | gpgcheck=1 | ||
| + | gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 | ||
| + | |||
| + | [extras-source] | ||
| + | name=CentOS-$releasever - Extras Source | ||
| + | baseurl=http://mirror.centos.org/centos/$releasever/extras/SRPMS | ||
| + | enabled=0 | ||
| + | gpgcheck=1 | ||
| + | gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 | ||
| + | |||
| + | # yumdownloader --source bash | ||
| + | Loading "fastestmirror" plugin | ||
| + | Loading mirror speeds from cached hostfile | ||
| + | * base: www.ftp.ne.jp | ||
| + | * updates: rsync.atworks.co.jp | ||
| + | * addons: www.ftp.ne.jp | ||
| + | * extras: www.ftp.ne.jp | ||
| + | Enabling base-source repository | ||
| + | base-source 100% |=========================| 1.9 kB 00:00 | ||
| + | bash-3.2-24.el5.src.rpm 100% |=========================| 4.6 MB 00:02 | ||
| + | |||
| + | "mirror.centos.org" は遅いので、"ftp.riken.jp/Linux" などに変更すると幸せになれるかも。 | ||
| + | |||
| + | ついでに、debuginfo も落とせるようにしておこう。 | ||
| + | |||
| + | # vi /etc/yum.repos.d/CentOS-Debuginfo.repo | ||
| + | [debuginfo] | ||
| + | name=CentOS-$releasever - DebugInfo | ||
| + | baseurl=http://debuginfo.centos.org/$releasever/$basearch | ||
| + | gpgcheck=0 | ||
| + | enabled=0 | ||
| + | |||
| + | # yumdownloader --enablerepo=debuginfo bash-debuginfo | ||
| + | ... | ||
| + | bash-debuginfo-3.2-21.el5 100% |=========================| 1.3 MB 00:04 | ||
2011年6月12日 (日) 12:49時点における最新版
設定
プロキシの設定
/etc/yum.conf に以下を追加する。
proxy=http://hostname:port proxy_username=user proxy_password=pass
ソースパッケージをダウンロードする
yumdownloader --source で、ソースパッケージをダウンロードできるようにする設定方法。
リポジトリ名を "<バイナリのリポジトリ名>-source" にしておく必要がある。 また、--source を付与した場合だけ見に行くように、enabled は 0 に設定しておこう。
# vi /etc/yum.repos.d/CentOS-Source.repo [base-source] name=CentOS-$releasever - Base Source baseurl=http://mirror.centos.org/centos/$releasever/os/SRPMS enabled=0 gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 [updates-source] name=CentOS-$releasever - Updates Source baseurl=http://mirror.centos.org/centos/$releasever/updates/SRPMS enabled=0 gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 [extras-source] name=CentOS-$releasever - Extras Source baseurl=http://mirror.centos.org/centos/$releasever/extras/SRPMS enabled=0 gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 # yumdownloader --source bash Loading "fastestmirror" plugin Loading mirror speeds from cached hostfile * base: www.ftp.ne.jp * updates: rsync.atworks.co.jp * addons: www.ftp.ne.jp * extras: www.ftp.ne.jp Enabling base-source repository base-source 100% |=========================| 1.9 kB 00:00 bash-3.2-24.el5.src.rpm 100% |=========================| 4.6 MB 00:02
"mirror.centos.org" は遅いので、"ftp.riken.jp/Linux" などに変更すると幸せになれるかも。
ついでに、debuginfo も落とせるようにしておこう。
# vi /etc/yum.repos.d/CentOS-Debuginfo.repo [debuginfo] name=CentOS-$releasever - DebugInfo baseurl=http://debuginfo.centos.org/$releasever/$basearch gpgcheck=0 enabled=0 # yumdownloader --enablerepo=debuginfo bash-debuginfo ... bash-debuginfo-3.2-21.el5 100% |=========================| 1.3 MB 00:04