Whitebox Linux で yum update

インストール後 『yum update』したら、エラー。

[root@localhost ~]# yum update
Config Error: Insufficient repository configuration. No repositories Found/Enabled. Aborting.

yum.confを見るとコメントにこんな注意が…。

[root@localhost ~]# cat /etc/yum.conf

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

ふむふむ、wbelmirrors.repo を作ろう。

cat /etc/yum.repos.d/wbelmirrors.repo
[base]
name=White Box Enterprise Linux $releasever – $basearch – Base
baseurl=http://ftp.riken.jp/Linux/whitebox/$releasever/en/os/$basearch
ftp://ftp.riken.jp/Linux/whitebox/$releasever/en/os/$basearch
[updates-released]
name=White Box Enterprise Linux $releasever – $basearch – Released Updates
baseurl=http://ftp.riken.jp/Linux/whitebox/$releasever/en/updates/
ftp://ftp.riken.jp/Linux/whitebox/$releasever/en/updates/

参照したのはこちら( riken の FTP サイト)

whitebox Linuxのインストールのヒント

1) yum list とすると、最初にパッケージ のヘッダー情報をサーバーからコピーし一覧が表示されます。
2) yum check-update とすると、updatge可能なパッケージの一覧が表示され、さらに
3) yum update とするとアップデート可能なすべてのパッケージがリストされ、確認の後、アップデートしてくれます。kernel も最新の適切な物にアップデートされます。

へぇ〜。こんなの理研が準備してるんだ…。

さあ、アップデート!!と実行すると

[root@localhost ~]# yum update

You have enabled checking of packages via GPG keys. This is a good thing.
However, you do not have any GPG public keys installed. You need to download
the keys for packages you wish to install and install them.
You can do that by running the command:
rpm –import public.gpg.key

Alternatively you can specify the url to the key you would like to use
for a repository in the ‘gpgkey’ option in a repository section and yum
will install it for you.

For more information contact your distribution or package provider.

今度は PGP のキーがインポートされてないよと言われるので。

[root@localhost ~]# rpm –import /usr/share/rhn/RPM-GPG-KEY-fedora

インポートする。同じフォルダに似た名前のキーがあるので不安になりますが。
http://ftp.riken.jp/Linux/whitebox/4/en/os/i386/RPM-GPG-KEY
http://ftp.riken.jp/Linux/whitebox/4/en/os/i386/RPM-GPG-KEY-fedora
http://ftp.riken.jp/Linux/whitebox/4/en/os/i386/RPM-GPG-KEY-redhat
と同じなので、どれでもいいと思う。

正しい使い方はこれ↓だと思う。

[root@localhost ~]# rpm –import http://ftp.riken.jp/Linux/whitebox/4/en/os/i386/RPM-GPG-KEY

でアップデート完了。
結構めんどくさい。。
スクリプト作るか…。


作ってみた。かなり何も考えず作りました。力業。エラー処理なし。検証してません。低知能がばれる。自分用です。使われる勇気のある方は、自己責任でお願いします。


#!/bin/sh
# Create /etc/yum.repos.d/riken_mirrors.repo
# Konna Chikarawazade Iinokayo ?
cat << EOF >  /etc/yum.repos.d/riken_mirrors.repo
[base]
name=White Box Enterprise Linux \$releasever - \$basearch - Base
baseurl=http://ftp.riken.jp/Linux/whitebox/\$releasever/en/os/\$basearch
ftp://ftp.riken.jp/Linux/whitebox/\$releasever/en/os/\$basearch
[updates-released]
name=White Box Enterprise Linux \$releasever - \$basearch - Released Updates
baseurl=http://ftp.riken.jp/Linux/whitebox/\$releasever/en/updates/
ftp://ftp.riken.jp/Linux/whitebox/\$releasever/en/updates/
EOF
# Inport GPG-KEY
#/bin/rpm --import http://ftp.riken.jp/Linux/whitebox/4/en/os/i386/RPM-GPG-KEY
# Update system
# -y option is yes all
/usr/bin/yum -y update
# IF You will need Application
# /usr/bin/yum -i [Your needed]

※1-21:32-ちょっとスマートに改造
※2-070703-変数が展開されちゃったのでエスケープ、ちゃんと動いた!!