hnakamur’s blog

ものすごい勢いで忘れる私のために未整理でもいいからとりあえずメモ

ラベル yum の投稿を表示しています。 すべての投稿を表示
ラベル yum の投稿を表示しています。 すべての投稿を表示

2011-11-13

Scientific Linux 6.1のyumレポジトリ設定

参考:Scientific Linux 6.1 での yum リポジトリ設定 - ふたつの川うるおう日記
Scientific Linux 6 - 初期設定 - システム最新化 : Server World

yum -y install yum-conf-sl-other yum-plugin-fastestmirror yum-plugin-priorities

cd /etc/yum.repos.d/
mv sl.repo sl.repo.default
mv sl-other.repo sl-other.repo.default

cat << '_EOF_' > /etc/yum.repos.d/sl.repo
[sl]
name=Scientific Linux $releasever - $basearch
mirrorlist = file:///etc/yum.repos.d/mirrors-sl
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson
priority=1

[sl-security]
name=Scientific Linux $releasever - $basearch - security updates
mirrorlist = file:///etc/yum.repos.d/mirrors-sl-security
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson
priority=1

[sl-source]
name=Scientific Linux $releasever - Source
mirrorlist = file:///etc/yum.repos.d/mirrors-sl-source
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson
priority=1
_EOF_
cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl
http://ftp.ne.jp/Linux/packages/scientificlinux/$releasever/$basearch/os/
http://ftp.jaist.ac.jp/pub/Linux/scientific/$releasever/$basearch/os/
http://ftp.riken.jp/Linux/scientific/$releasever/$basearch/os/
http://ftp.scientificlinux.org/linux/scientific/$releasever/$basearch/os/
http://ftp1.scientificlinux.org/linux/scientific/$releasever/$basearch/os/
http://ftp2.scientificlinux.org/linux/scientific/$releasever/$basearch/os/
ftp://ftp.scientificlinux.org/linux/scientific/$releasever/$basearch/os/
_EOF_
cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl-security
http://ftp.ne.jp/Linux/packages/scientificlinux/$releasever/$basearch/updates/security/
http://ftp.jaist.ac.jp/pub/Linux/scientific/$releasever/$basearch/updates/security/
http://ftp.riken.jp/Linux/scientific/$releasever/$basearch/updates/security/
http://ftp.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/security/
http://ftp1.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/security/
http://ftp2.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/security/
ftp://ftp.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/security/
_EOF_
cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl-source
http://ftp.ne.jp/Linux/packages/scientificlinux/$releasever/SRPMS/
http://ftp.jaist.ac.jp/pub/Linux/scientific/$releasever/SRPMS/
http://ftp.riken.jp/Linux/scientific/$releasever/SRPMS/
http://ftp.scientificlinux.org/linux/scientific/$releasever/SRPMS/
http://ftp1.scientificlinux.org/linux/scientific/$releasever/SRPMS/
http://ftp2.scientificlinux.org/linux/scientific/$releasever/SRPMS/
ftp://ftp.scientificlinux.org/linux/scientific/$releasever/SRPMS/
_EOF_

cat << '_EOF_' > /etc/yum.repos.d/sl-other.repo
[sl-fastbugs]
name=Scientific Linux $releasever - $basearch - fastbug updates
mirrorlist = file:///etc/yum.repos.d/mirrors-sl-fastbugs
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson
priority=1

[sl-debuginfo]
name=Scientific Linux Debuginfo
mirrorlist = file:///etc/yum.repos.d/mirrors-sl-debuginfo
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson
priority=1

[sl-testing]
name=Scientific Linux Testing - $basearch
mirrorlist = file:///etc/yum.repos.d/mirrors-sl-testing
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson
priority=1

[sl-testing-source]
name=Scientific Linux Testing - Source
mirrorlist = file:///etc/yum.repos.d/mirrors-sl-testing-source
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson
priority=1
_EOF_
cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl-fastbugs
http://ftp.ne.jp/Linux/packages/scientificlinux/$releasever/$basearch/updates/fastbugs/
http://ftp.jaist.ac.jp/pub/Linux/scientific/$releasever/$basearch/updates/fastbugs/
http://ftp.riken.jp/Linux/scientific/$releasever/$basearch/updates/fastbugs/
http://ftp.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/fastbugs/
http://ftp1.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/fastbugs/
http://ftp2.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/fastbugs/
ftp://ftp.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/fastbugs/
_EOF_
cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl-debuginfo
http://ftp.ne.jp/Linux/packages/scientificlinux/$releasever/archive/debuginfo/
http://ftp.jaist.ac.jp/pub/Linux/scientific/$releasever/archive/debuginfo/
http://ftp.riken.jp/Linux/scientific/$releasever/archive/debuginfo/
http://ftp.scientificlinux.org/linux/scientific/$releasever/archive/debuginfo/
http://ftp1.scientificlinux.org/linux/scientific/$releasever/archive/debuginfo/
http://ftp2.scientificlinux.org/linux/scientific/$releasever/archive/debuginfo/
ftp://ftp.scientificlinux.org/linux/scientific/$releasever/archive/debuginfo/
_EOF_
cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl-testing
http://ftp.ne.jp/Linux/packages/scientificlinux/6rolling/testing/$basearch/
http://ftp.jaist.ac.jp/pub/Linux/scientific/6rolling/testing/$basearch/
http://ftp.riken.jp/Linux/scientific/6rolling/testing/$basearch/
http://ftp.scientificlinux.org/linux/scientific/6rolling/testing/$basearch/
http://ftp1.scientificlinux.org/linux/scientific/6rolling/testing/$basearch/
http://ftp2.scientificlinux.org/linux/scientific/6rolling/testing/$basearch/
ftp://ftp.scientificlinux.org/linux/scientific/6rolling/testing/$basearch/
_EOF_
cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl-testing-source
http://ftp.ne.jp/Linux/packages/scientificlinux/6rolling/testing/SRPMS/
http://ftp.jaist.ac.jp/pub/Linux/scientific/6rolling/testing/SRPMS/
http://ftp.riken.jp/Linux/scientific/6rolling/testing/SRPMS/
http://ftp.scientificlinux.org/linux/scientific/6rolling/testing/SRPMS/
http://ftp1.scientificlinux.org/linux/scientific/6rolling/testing/SRPMS/
http://ftp2.scientificlinux.org/linux/scientific/6rolling/testing/SRPMS/
ftp://ftp.scientificlinux.org/linux/scientific/6rolling/testing/SRPMS/
_EOF_

2010-12-22

CentOS x86_64で*.i386をインストール対象外にする

/etc/yum.confの[main]に以下の行を追加。
exclude=*.i?86

既にインストールされてしまっているパッケージは以下のコマンドで削除。
yum remove \*.i386

2009-08-22

CentOSのyumレポジトリにCentOS-Testingを追加

AdditionalResources/Repositories - CentOS WikiのCentOS-Testingの項を読んで位置づけを理解した上で追加。

# cd /etc/yum.repos.d
# wget http://dev.centos.org/centos/5/CentOS-Testing.repo

priorityを追加しておく。

# vi CentOS-Testing.repo

変更内容

--- /etc/yum.repos.d/CentOS-Testing.repo        2009/08/22 08:43:19     1.1
+++ /etc/yum.repos.d/CentOS-Testing.repo        2009/08/22 08:43:31
@@ -4,6 +4,7 @@
 enabled=0
 gpgcheck=1
 gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
+priority=21
 
 # CentOS-Testing:
 # !!!! CAUTION !!!!

普段はenabled=0にしておいて、必要な際はyum実行時に--enablerepo=c5-testingをつけて使う。

EPELからheartbeatをインストール

インストール試すが依存関係で失敗

# yum install heartbeat

すると依存するlibnet.so.1が無いというエラー発生

Resolving Dependencies
--> Running transaction check
---> Package heartbeat.i386 0:2.1.4-9.el5 set to be updated
--> Processing Dependency: libstonith.so.1 for package: heartbeat
--> Processing Dependency: libpils.so.1 for package: heartbeat
--> Processing Dependency: libltdl.so.3 for package: heartbeat
--> Processing Dependency: libnet.so.1 for package: heartbeat
--> Running transaction check
---> Package libtool-ltdl.i386 0:1.5.22-6.1 set to be updated
---> Package heartbeat-stonith.i386 0:2.1.4-9.el5 set to be updated
--> Processing Dependency: net-snmp-libs for package: heartbeat-stonith
--> Processing Dependency: libnetsnmp.so.10 for package: heartbeat-stonith
---> Package heartbeat-pils.i386 0:2.1.4-9.el5 set to be updated
---> Package heartbeat.i386 0:2.1.4-9.el5 set to be updated
--> Processing Dependency: libnet.so.1 for package: heartbeat
--> Running transaction check
---> Package net-snmp-libs.i386 1:5.3.2.2-5.el5_3.2 set to be updated
---> Package heartbeat.i386 0:2.1.4-9.el5 set to be updated
--> Processing Dependency: libnet.so.1 for package: heartbeat
--> Finished Dependency Resolution
heartbeat-2.1.4-9.el5.i386 from epel has depsolving problems
  --> Missing Dependency: libnet.so.1 is needed by package heartbeat-2.1.4-9.el5.i386 (epel)
Error: Missing Dependency: libnet.so.1 is needed by package heartbeat-2.1.4-9.el5.i386 (epel)

libnet.soを求めて(失敗の巻)

libnet.soを含むパッケージを調べる。

# yum provides libnet.so
...(略)...
1463 packages excluded due to repository priority protections
1:java-1.6.0-openjdk-1.6.0.0-0.25.b09.el5.i386 : OpenJDK Runtime Environment
Matched from:
Other       : libnet.so



1:java-1.6.0-openjdk-1.6.0.0-0.30.b09.el5.i386 : OpenJDK Runtime Environment
Matched from:
Other       : libnet.so



1:java-1.6.0-openjdk-1.6.0.0-1.2.b09.el5.i386 : OpenJDK Runtime Environment
Matched from:
Other       : libnet.so

heartbeatがOpenJDKに依存しているってほんとかと思いつつ一応入れてみる。まずどこのレポジトリか確認。

# yum info java-1.6.0-openjdk

によるとupdatesレポジトリにあるらしい。

# yum install java-1.6.0-openjdk

libnet.soがインストールされたか確認

# rpm -ql java-1.6.0-openjdk | grep libnet
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/libnet.so

ここに入るってことはOpenJDKしかみないよな。こんなとこにLD_LIBRARY_PATH通すとも思えないし。

yum install heartbeatを再度試すがやはり同じエラーが出ました。ということでOpenJDKを依存パッケージごとアンインストールします。

# yum remove java-1.6.0-openjdk giflib jpackage-utils libXtst

libnet.soを求めて(成功の巻)

libnetで検索してみる

# yum search libnet
...(略)...
=============================== Matched: libnet ================================
echoart.i386 : Responds to or drops ICMP echo requests packets
libnet.i386 : Routines to help with network packet contruction and handling
libnet-devel.i386 : Development files for the libnet library
libnet10.i386 : High-level API (toolkit) to construct and inject network packets
libnet10-devel.i386 : Development files for the libnet library
libnetfilter_conntrack.i386 : Netfilter conntrack userspace library
libnetfilter_conntrack-devel.i386 : Header files, libraries and development
                                  : documentation for libnetfilter_conntrack.
perl-Net-ARP.i386 : Create and send ARP packets
perl-Net-TFTP.noarch : TFTP Client class

libnetとかlibnet10がそれっぽい。

libnetを入れてみる

# yum install libnet

内容を確認

# rpm -ql libnet | lv

/usr/lib/libnet.aはあるが、libnet.soは確かに無い。

libnet10を入れてみる

# yum install libnet10

内容を確認

# rpm -ql libnet10 | lv

/usr/lib/libnet10.so.0というファイルならあったがlibnet.soはない。

libnetとlibnet10をアンインストール後、どのレポジトリか確認。

# yum remove libnet libnet10
# yum info libnet

extrasと判明。extrasからlibnet*を除外。

# vi /etc/yum.repos.d/Cent-Base.repo

変更内容

--- /etc/yum.repos.d/CentOS-Base.repo   2009/08/21 15:08:54     1.4
+++ /etc/yum.repos.d/CentOS-Base.repo   2009/08/21 15:22:08
@@ -48,7 +48,7 @@
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
 priority=1
-exclude=heartbeat-*
+exclude=heartbeat-*,libnet*
 
 #additional packages that extend functionality of existing packages
 [centosplus]

再度確認

# yum info libnet

今度はrpmforgeでヒットしたので、ここからも除外

# vi /etc/yum.repos.d/rpmforge.repo

変更内容

--- /etc/yum.repos.d/rpmforge.repo      2009/08/21 09:09:14     1.2
+++ /etc/yum.repos.d/rpmforge.repo      2009/08/21 15:22:29
@@ -10,3 +10,4 @@
 gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
 gpgcheck = 1
 priority = 11
+exclude=libnet*
# yum info libnet

これでRepo: epelになったので、インストール。

# yum install libnet
# rpm -ql libnet | lv

/usr/lib/libnet.so.1が含まれている事を確認。

heartbeatのインストール再実行して成功

# yum install heartbeat
...(略)...
Dependencies Resolved

================================================================================
 Package                Arch      Version                    Repository    Size
================================================================================
Installing:
 heartbeat              i386      2.1.4-9.el5                epel         1.6 M
Installing for dependencies:
 heartbeat-pils         i386      2.1.4-9.el5                epel          90 k
 heartbeat-stonith      i386      2.1.4-9.el5                epel         169 k
 libtool-ltdl           i386      1.5.22-6.1                 base          37 k
 net-snmp-libs          i386      1:5.3.2.2-5.el5_3.2        updates      1.2 M
...(略)...

今度は無事インストールできました。今回の教訓は先にexcludeを調整して希望のパッケージが希望のレポジトリから取得できるようにすることが大切ということです。

CentOSのyumレポジトリにEPELを追加

EPELを追加してみる理由

AdditionalResources/Repositories - CentOS WikiExtra Packages for Enterprise Linux (EPEL)というサードパーティレポジトリが紹介されていました。

CentOSでheartbeatを使おうとしたがうまくいかずでインストールしたheartbeatはyum info heartbeatで確認したところバージョンは2.1.3でextrasリポジトリからインストールされたもの。

一方、RepoView: "Fedora EPEL 5 - i386"ではheartbeat-2.1.4-9.el5.i386とこちらのほうが新しい。というわけで試してみることに。

まずextrasリポジトリから入れたheartbeatパッケージを削除

heartbeatを入れた際に同時に入れられたパッケージ名を確認

# yum list installed | grep heartbeat
heartbeat.i386                          2.1.3-3.el5.centos             installed
heartbeat-pils.i386                     2.1.3-3.el5.centos             installed
heartbeat-stonith.i386                  2.1.3-3.el5.centos             installed

アンインストール

# yum remove heartbeat heartbeat-pils heartbeat-stonith

EPELのセットアップ

AdditionalResources/Repositories - CentOS WikiのEPELのセクションに従ってセットアップ

EPELを有効にするためのrpmをインストール

$ wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
# rpm -ivh epel-release-5-3.noarch.rpm

EPELのpriorityを設定

# vi /etc/yum.repos.d/epel.repo

変更内容

--- epel.repo   2009/08/21 12:50:02     1.1
+++ epel.repo   2009/08/21 12:59:18
@@ -6,6 +6,7 @@
 enabled=1
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
+priority=12
 
 [epel-debuginfo]
 name=Extra Packages for Enterprise Linux 5 - $basearch - Debug

base, updates, addons, extrasからはheartbeat-*を除外

# vi /etc/yum.repos.d/CentOS-Base.repo

変更内容

--- CentOS-Base.repo    2009/08/21 08:56:14     1.3
+++ CentOS-Base.repo    2009/08/21 15:08:31
@@ -18,6 +18,7 @@
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
 priority=1
+exclude=heartbeat-*
 
 #released updates 
 [updates]
@@ -27,6 +28,7 @@
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
 priority=1
+exclude=heartbeat-*
 
 #packages used/produced in the build but not released
 [addons]
@@ -36,6 +38,7 @@
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
 priority=1
+exclude=heartbeat-*
 
 #additional packages that may be useful
 [extras]
@@ -45,6 +48,7 @@
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
 priority=1
+exclude=heartbeat-*
 
 #additional packages that extend functionality of existing packages
 [centosplus]

動作確認

# yum info heartbeat
...(略)...
Available Packages
Name       : heartbeat
Arch       : i386
Version    : 2.1.4
Release    : 9.el5
Size       : 1.6 M
Repo       : epel
Summary    : Heartbeat subsystem for High-Availability Linux
URL        : http://linux-ha.org/
License    : GPLv2 and LGPLv2+
...(略)...

epelのheartbeatを見つけられるようになりました。

ブログ アーカイブ