Scientific Linux 6.1 から 6.2 に更新する方法

Scientific Linux 6.2 が出ていたので、6.1からアップデートします。

参考: 
https://www.scientificlinux.org/documentation/howto/upgrade.6x

$ sudo yum clean all
$ sudo yum --releasever=6.2 update

この2つのコマンドでアップデート出来ます。

$ cat /etc/redhat-release 
Scientific Linux release 6.2 (Carbon)

6.2にアップデート出来ました。

Scientific Linux 6 で remi リポジトリを使う

先月まではCentOS 5.7でしたが、Scientific Linux 6.1にリプレースしました。
yumではphpの最新版は入らないので、remiを使って5.3.10をインストールします。

OSのバージョンです。

$ cat /etc/redhat-release
Scientific Linux release 6.1 (Carbon)

公開鍵のインポートをします。

$ sudo rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi

リポジトリ設定をインストールします。

$ sudo rpm -ivh  http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

試しにyum installを実行してみます。

$ sudo yum install --enablerepo=remi php
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://rpms.famillecollet.com/enterprise/6.1/remi/mirror error was
14: PYCURL ERROR 22 - "The requested URL returned error: 404"


Cannot find a valid baseurl for repo: remi

404エラーになってしまいます。
/etc/yum.repos.d/remi.repo内の$releaseverが6.1に展開されてしまうようです。
本来であれば、6が正しいURLになります。
変数のままでは使えないので、設定ファイルをベタ書きに修正します。 

$ sudo cp /etc/yum.repos.d/remi.repo{,.bak}
$ sudo vim /etc/yum.repos.d/remi.repo
# $releasever を 6 に置換する
$ cat remi.repo
[remi]
name=Les RPM de remi pour Enterprise Linux 6 - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/6/remi/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/6/remi/mirror
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
failovermethod=priority

[remi-test]
name=Les RPM de remi en test pour Enterprise Linux 6 - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/6/test/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/6/test/mirror
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

これでremiリポジトリが使えるようになります。

$ sudo yum install --enablerepo=remi php

2/7時点では5.3.10-2.el6.remiがインストールされます。

CentOSでVim7.3をビルド、インストールする

yumでインストール出来るVimのバージョンが古く、
業務で利用している設定と共有が出来ないので最新版7.3をビルド、インストールします。 

CentOS のバージョンは 5.7 です。

$ cat /etc/redhat-release 
CentOS release 5.7 (Final)

やることは下記の通りです。

  1. tarballのダウンロード
  2. tarballの展開
  3. パッチのダウンロード
  4. パッチをあてる
  5. configure
  6. ビルド
  7. インストール

作業を始める前に大概インストールしろといわれるパッケージを入れておきます。

$ sudo yum install ncurses-devel

では、作業を開始していきます

tarballをダウンロードします。

$ curl -O ftp://ftp.jp.vim.org/pub/vim/unix/vim-7.3.tar.bz2

他のブログなどを見るとextraやlangをダウンロードと書いてありますが、
http://www.vim.org/download.phpに書いてある下記の文の通り、不要な様です。 
You need to download at the sources and the runtime files. And apply all the latest patches. For Vim 6 up to 7.2 you can optionally get the "lang" archive, which adds translated messages and menus. For 7.3 this is included with the runtime files. 

tarballを展開します。

$ tar xvfj vim-7.3.tar.bz2

パッチをダウンロードします。
量が多いので、本家ではなくミラーを使うことをお勧めします。
※ 今回ダウンロードするのは 2012/12/18現在 存在するパッチすべて 

$ cd vim73
$ mkdir patches
$ cd patches
$ curl -O ftp://ftp.jp.vim.org/pub/vim/patches/7.3/7.3.[001-401]

パッチをあてます。

$ cd ..
$ cat patches/* | patch -p0

configureを実行します。

$ ./configure --enable-multibyte --enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --disable-selinux --with-features=huge

ビルドします

$ make

インストールします

$ sudo make install 

これで作業終わりです。
Vimは /usr/local 以下にインストールされたはずです。
/usr/local/bin の path を忘れずに通しておきましょう。

また使い始める前に、一回ログアウトしてからでないと path が動かない事があります。
ご注意ください。

$ vim --version 
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jan 19 2012 01:29:42)

おつかれさまでした。

はてなブログを試す

はてなブログがオープンベータになったので、試しに登録してみました。
同じ様なサービスを2つ続けるのも面倒くさいので、
はてなダイアリーはこれにて終了にしようかと思います。 

それにしても、ダイアリーとブログは何が違うのか…。
私にはよく解りません (笑) 

ということで、お試しエントリーでした。