« 2014年6月 | トップページ | 2014年8月 »

2014年7月

2014年7月27日 (日)

◆サポート期限切れの Lubuntu 13.04 を新規インストール

新規に Lubuntu 13.04 Desktop (i386) をインストールしたところ、インストールの最後の再起動後のログインで以下のダイアログボックスが出てきてインストールが不完全だといわれました。

01

ここですぐに「この操作を今すぐ実行する」ボタンを押して、セットアップを進めていくと以下のエラーが出てしまい失敗します。

02

原因は、先の記事「◆ Lubuntu 13.04 の apt-get install で「Not Found」となる現象への対処」に書いたように apt-get install ができない状態になっていたるためだと思い先の記事の対処を先に実施してから「この操作を今すぐ実行する」ボタンを押しすようにしたところエラーが出ずに完了しました。

◆ Lubuntu 13.04 の apt-get install で「Not Found」となる現象への対処

数週間前から Lubuntu 13.04 で apt-get install をしようとすると「404  Not Found」が出てインストールに失敗するようになってしまいました。
Ubuntu 13.04 が EOL(End of Life) に達したため、パッケージのファイルの置き場のサイトが old-releases.ubuntu.com に変わったためのようです。

参考:
https://help.ubuntu.com/community/EOLUpgrades

■確認環境

  Lubuntu 13.04 Desktop (i386)

■ 対処方法

1. /etc/apt/sources.list の中の URL のサイトを old-releases.ubuntu.com に変更します。

以下のコマンドで一括変換してしまいます。
(実行前に /etc/apt/sources.list をどこかにコピーして変更前の内容を退避しておくと良いでしょう)

$ sudo sed -i -e 's|//.*ubuntu.com/|//old-releases.ubuntu.com/|' /etc/apt/sources.list

2. 以下のコマンドで情報を更新します。

$ sudo apt-get update

実行すると以下が出力されました。

取得:1 http://old-releases.ubuntu.com raring Release.gpg [933 B]    
取得:2 http://old-releases.ubuntu.com raring-updates Release.gpg [933 B]
取得:3 http://old-releases.ubuntu.com raring-backports Release.gpg [933 B]
取得:4 http://old-releases.ubuntu.com raring-security Release.gpg [933 B]
取得:5 http://old-releases.ubuntu.com raring Release [40.8 kB]
取得:6 http://old-releases.ubuntu.com raring-updates Release [40.8 kB]
取得:7 http://old-releases.ubuntu.com raring-backports Release [40.8 kB]       
取得:8 http://old-releases.ubuntu.com raring-security Release [40.8 kB]        
取得:9 http://old-releases.ubuntu.com raring/main Sources [963 kB]             
取得:10 http://old-releases.ubuntu.com raring/restricted Sources [5,987 B]     
取得:11 http://old-releases.ubuntu.com raring/universe Sources [5,837 kB]      
取得:12 http://old-releases.ubuntu.com raring/multiverse Sources [171 kB]      
取得:13 http://old-releases.ubuntu.com raring/main i386 Packages [1,168 kB]    
取得:14 http://old-releases.ubuntu.com raring/restricted i386 Packages [9,623 B]
取得:15 http://old-releases.ubuntu.com raring/universe i386 Packages [5,404 kB]
取得:16 http://old-releases.ubuntu.com raring/multiverse i386 Packages [131 kB]
取得:17 http://old-releases.ubuntu.com raring/main Translation-ja [356 kB]     
取得:18 http://old-releases.ubuntu.com raring/main Translation-en [673 kB]     
取得:19 http://old-releases.ubuntu.com raring/multiverse Translation-ja [8,722 B]
取得:20 http://old-releases.ubuntu.com raring/multiverse Translation-en [98.4 kB]
取得:21 http://old-releases.ubuntu.com raring/restricted Translation-ja [480 B]
取得:22 http://old-releases.ubuntu.com raring/restricted Translation-en [2,767 B]
取得:23 http://old-releases.ubuntu.com raring/universe Translation-ja [1,085 kB]
取得:24 http://old-releases.ubuntu.com raring/universe Translation-en [3,737 kB]
取得:25 http://old-releases.ubuntu.com raring-updates/main Sources [90.4 kB]   
取得:26 http://old-releases.ubuntu.com raring-updates/restricted Sources [14 B]
取得:27 http://old-releases.ubuntu.com raring-updates/universe Sources [83.0 kB]
取得:28 http://old-releases.ubuntu.com raring-updates/multiverse Sources [2,797 B]
取得:29 http://old-releases.ubuntu.com raring-updates/main i386 Packages [220 kB]
取得:30 http://old-releases.ubuntu.com raring-updates/restricted i386 Packages [14 B]
取得:31 http://old-releases.ubuntu.com raring-updates/universe i386 Packages [170 kB]
取得:32 http://old-releases.ubuntu.com raring-updates/multiverse i386 Packages [4,813 B]
取得:33 http://old-releases.ubuntu.com raring-updates/main Translation-en [108 kB]
取得:34 http://old-releases.ubuntu.com raring-updates/multiverse Translation-en [2,212 B]
取得:35 http://old-releases.ubuntu.com raring-updates/restricted Translation-en [14 B]
取得:36 http://old-releases.ubuntu.com raring-updates/universe Translation-en [86.0 kB]
取得:37 http://old-releases.ubuntu.com raring-backports/main Sources [902 B]   
取得:38 http://old-releases.ubuntu.com raring-backports/restricted Sources [14 B]
取得:39 http://old-releases.ubuntu.com raring-backports/universe Sources [7,145 B]
取得:40 http://old-releases.ubuntu.com raring-backports/multiverse Sources [1,403 B]
取得:41 http://old-releases.ubuntu.com raring-backports/main i386 Packages [565 B]
取得:42 http://old-releases.ubuntu.com raring-backports/restricted i386 Packages [14 B]
取得:43 http://old-releases.ubuntu.com raring-backports/universe i386 Packages [8,489 B]
取得:44 http://old-releases.ubuntu.com raring-backports/multiverse i386 Packages [1,345 B]
取得:45 http://old-releases.ubuntu.com raring-backports/main Translation-en [269 B]
取得:46 http://old-releases.ubuntu.com raring-backports/multiverse Translation-en [1,040 B]
取得:47 http://old-releases.ubuntu.com raring-backports/restricted Translation-en [14 B]
取得:48 http://old-releases.ubuntu.com raring-backports/universe Translation-en [6,390 B]
取得:49 http://old-releases.ubuntu.com raring-security/main Sources [58.3 kB]  
取得:50 http://old-releases.ubuntu.com raring-security/restricted Sources [14 B]
取得:51 http://old-releases.ubuntu.com raring-security/universe Sources [14.3 kB]
取得:52 http://old-releases.ubuntu.com raring-security/multiverse Sources [2,262 B]
取得:53 http://old-releases.ubuntu.com raring-security/main i386 Packages [154 kB]
取得:54 http://old-releases.ubuntu.com raring-security/restricted i386 Packages [14 B]
取得:55 http://old-releases.ubuntu.com raring-security/universe i386 Packages [53.7 kB]
取得:56 http://old-releases.ubuntu.com raring-security/multiverse i386 Packages [3,858 B]
取得:57 http://old-releases.ubuntu.com raring-security/main Translation-en [79.9 kB]
取得:58 http://old-releases.ubuntu.com raring-security/multiverse Translation-en [1,826 B]
取得:59 http://old-releases.ubuntu.com raring-security/restricted Translation-en [14 B]
取得:60 http://old-releases.ubuntu.com raring-security/universe Translation-en [32.1 kB]
無視 http://old-releases.ubuntu.com raring/main Translation-ja_JP              
無視 http://old-releases.ubuntu.com raring/multiverse Translation-ja_JP
無視 http://old-releases.ubuntu.com raring/restricted Translation-ja_JP
無視 http://old-releases.ubuntu.com raring/universe Translation-ja_JP
無視 http://old-releases.ubuntu.com raring-updates/main Translation-ja_JP
無視 http://old-releases.ubuntu.com raring-updates/main Translation-ja
無視 http://old-releases.ubuntu.com raring-updates/multiverse Translation-ja_JP
無視 http://old-releases.ubuntu.com raring-updates/multiverse Translation-ja
無視 http://old-releases.ubuntu.com raring-updates/restricted Translation-ja_JP
無視 http://old-releases.ubuntu.com raring-updates/restricted Translation-ja
無視 http://old-releases.ubuntu.com raring-updates/universe Translation-ja_JP
無視 http://old-releases.ubuntu.com raring-updates/universe Translation-ja
無視 http://old-releases.ubuntu.com raring-backports/main Translation-ja_JP
無視 http://old-releases.ubuntu.com raring-backports/main Translation-ja
無視 http://old-releases.ubuntu.com raring-backports/multiverse Translation-ja_JP
無視 http://old-releases.ubuntu.com raring-backports/multiverse Translation-ja
無視 http://old-releases.ubuntu.com raring-backports/restricted Translation-ja_JP
無視 http://old-releases.ubuntu.com raring-backports/restricted Translation-ja
無視 http://old-releases.ubuntu.com raring-backports/universe Translation-ja_JP
無視 http://old-releases.ubuntu.com raring-backports/universe Translation-ja
無視 http://old-releases.ubuntu.com raring-security/main Translation-ja_JP
無視 http://old-releases.ubuntu.com raring-security/main Translation-ja
無視 http://old-releases.ubuntu.com raring-security/multiverse Translation-ja_JP
無視 http://old-releases.ubuntu.com raring-security/multiverse Translation-ja
無視 http://old-releases.ubuntu.com raring-security/restricted Translation-ja_JP
無視 http://old-releases.ubuntu.com raring-security/restricted Translation-ja
無視 http://old-releases.ubuntu.com raring-security/universe Translation-ja_JP
無視 http://old-releases.ubuntu.com raring-security/universe Translation-ja
21.0 MB を 3分 47秒 で取得しました (92.2 kB/s)
パッケージリストを読み込んでいます... 完了
W: Duplicate sources.list entry http://old-releases.ubuntu.com/ubuntu/ raring/main i386 Packages (/var/lib/apt/lists/old-releases.ubuntu.com_ubuntu_dists_raring_main_binary-i386_Packages)
W: これらの問題を解決するためには apt-get update を実行する必要があるかもしれません

■ 参考:apt-get install でのエラー出力の具体的内容

先の記事「◆【改訂】OpenFlow フレームワーク Trema 0.4 のインストール手順【0.4.7対応】」で書いた Trema 0.4.7 のインストールのための前提のパッケージを apt-get install した場合、以下が出力されました:

$ sudo apt-get install gcc make git ruby rubygems ruby-dev libpcap-dev libsqlite3-dev libglib2.0-dev
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
以下の特別パッケージがインストールされます:
  binutils build-essential dpkg-dev fakeroot g++ g++-4.7 gcc-4.7 git-man
  libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl
  libc-dev-bin libc6-dev libdpkg-perl liberror-perl libfile-fcntllock-perl
  libgcc-4.7-dev libgomp1 libitm1 libpcap0.8-dev libpcre3-dev libpcrecpp0
  libruby1.8 libruby1.9.1 libstdc++6-4.7-dev libyaml-0-2 linux-libc-dev
  manpages-dev pkg-config ruby1.8 ruby1.8-dev ruby1.9.1 ruby1.9.1-dev
  zlib1g-dev
提案パッケージ:
  binutils-doc debian-keyring g++-multilib g++-4.7-multilib gcc-4.7-doc
  libstdc++6-4.7-dbg gcc-multilib autoconf automake1.9 libtool flex bison gdb
  gcc-doc gcc-4.7-multilib libmudflap0-4.7-dev gcc-4.7-locales libgcc1-dbg
  libgomp1-dbg libitm1-dbg libquadmath0-dbg libmudflap0-dbg binutils-gold
  git-daemon-run git-daemon-sysvinit git-doc git-el git-arch git-cvs git-svn
  git-email git-gui gitk gitweb glibc-doc libglib2.0-doc sqlite3-doc
  libstdc++6-4.7-doc make-doc ri ruby1.8-examples ri1.8 ruby-switch
  ruby1.9.1-examples ri1.9.1 graphviz
以下のパッケージが新たにインストールされます:
  binutils build-essential dpkg-dev fakeroot g++ g++-4.7 gcc gcc-4.7 git
  git-man libalgorithm-diff-perl libalgorithm-diff-xs-perl
  libalgorithm-merge-perl libc-dev-bin libc6-dev libdpkg-perl liberror-perl
  libfile-fcntllock-perl libgcc-4.7-dev libglib2.0-dev libgomp1 libitm1
  libpcap-dev libpcap0.8-dev libpcre3-dev libpcrecpp0 libruby1.8 libruby1.9.1
  libsqlite3-dev libstdc++6-4.7-dev libyaml-0-2 linux-libc-dev make
  manpages-dev pkg-config ruby ruby-dev ruby1.8 ruby1.8-dev ruby1.9.1
  ruby1.9.1-dev rubygems zlib1g-dev
アップグレード: 0 個、新規インストール: 43 個、削除: 0 個、保留: 0 個。
48.3 MB のアーカイブを取得する必要があります。
この操作後に追加で 140 MB のディスク容量が消費されます。
続行しますか [Y/n]?
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main libgomp1 i386 4.7.3-1ubuntu1
  404  Not Found
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main libitm1 i386 4.7.3-1ubuntu1
  404  Not Found
取得:1 http://jp.archive.ubuntu.com/ubuntu/ raring/main libpcrecpp0 i386 1:8.31-2 [17.1 kB]
取得:2 http://jp.archive.ubuntu.com/ubuntu/ raring/main libyaml-0-2 i386 0.1.4-2build1 [55.3 kB]
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main binutils i386 2.23.2-2ubuntu1
  404  Not Found
エラー http://jp.archive.ubuntu.com/ubuntu/ raring-updates/main libc-dev-bin i386 2.17-0ubuntu5.1
  404  Not Found
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main libgcc-4.7-dev i386 4.7.3-1ubuntu1
  404  Not Found
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main gcc-4.7 i386 4.7.3-1ubuntu1
  404  Not Found
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main gcc i386 4:4.7.3-1ubuntu10
  404  Not Found
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main libstdc++6-4.7-dev i386 4.7.3-1ubuntu1
  404  Not Found
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main g++-4.7 i386 4.7.3-1ubuntu1
  404  Not Found
エラー http://security.ubuntu.com/ubuntu/ raring-security/main libc-dev-bin i386 2.17-0ubuntu5.1
  404  Not Found [IP: 91.189.91.13 80]
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main g++ i386 4:4.7.3-1ubuntu10
  404  Not Found
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main make i386 3.81-8.2ubuntu2
  404  Not Found
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main libdpkg-perl all 1.16.10ubuntu1
  404  Not Found
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main dpkg-dev all 1.16.10ubuntu1
  404  Not Found
エラー http://security.ubuntu.com/ubuntu/ raring-security/main linux-libc-dev i386 3.8.0-35.50
  404  Not Found [IP: 91.189.91.13 80]
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main build-essential i386 11.6ubuntu4
  404  Not Found
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main fakeroot i386 1.18.4-2ubuntu1
  404  Not Found
取得:3 http://jp.archive.ubuntu.com/ubuntu/ raring/main liberror-perl all 0.17-1 [23.8 kB]
エラー http://security.ubuntu.com/ubuntu/ raring-security/main libc6-dev i386 2.17-0ubuntu5.1
  404  Not Found [IP: 91.189.91.13 80]
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main git-man all 1:1.8.1.2-1
  404  Not Found
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main git i386 1:1.8.1.2-1
  404  Not Found
取得:4 http://jp.archive.ubuntu.com/ubuntu/ raring/main libalgorithm-diff-perl all 1.19.02-3 [50.0 kB]
取得:5 http://jp.archive.ubuntu.com/ubuntu/ raring/main libalgorithm-diff-xs-perl i386 0.04-2build3 [13.1 kB]
取得:6 http://jp.archive.ubuntu.com/ubuntu/ raring/main libalgorithm-merge-perl all 0.08-2 [12.7 kB]
取得:7 http://jp.archive.ubuntu.com/ubuntu/ raring/main libfile-fcntllock-perl i386 0.14-2 [15.8 kB]
取得:8 http://jp.archive.ubuntu.com/ubuntu/ raring/main libpcre3-dev i386 1:8.31-2 [261 kB]
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main pkg-config i386 0.26-1ubuntu3
  404  Not Found
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main zlib1g-dev i386 1:1.2.7.dfsg-13ubuntu2
  404  Not Found
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main libglib2.0-dev i386 2.36.0-1ubuntu2
  404  Not Found
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main libpcap0.8-dev i386 1.3.0-1
  404  Not Found
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main libpcap-dev all 1.3.0-1
  404  Not Found
エラー http://jp.archive.ubuntu.com/ubuntu/ raring-updates/main libruby1.8 i386 1.8.7.358-7ubuntu1.2
  404  Not Found
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main libsqlite3-dev i386 3.7.15.2-1ubuntu1
  404  Not Found
エラー http://security.ubuntu.com/ubuntu/ raring-security/main libruby1.8 i386 1.8.7.358-7ubuntu1.2
  404  Not Found [IP: 91.189.91.13 80]
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main manpages-dev all 3.44-0ubuntu1
  404  Not Found
エラー http://security.ubuntu.com/ubuntu/ raring-security/main libruby1.9.1 i386 1.9.3.194-8.1ubuntu1.2
  404  Not Found [IP: 91.189.91.13 80]
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main ruby all 4.9
  404  Not Found
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main ruby-dev all 4.9
  404  Not Found
エラー http://security.ubuntu.com/ubuntu/ raring-security/main ruby1.9.1 i386 1.9.3.194-8.1ubuntu1.2
  404  Not Found [IP: 91.189.91.13 80]
エラー http://jp.archive.ubuntu.com/ubuntu/ raring/main rubygems all 1.8.24-1ubuntu1
  404  Not Found
エラー http://security.ubuntu.com/ubuntu/ raring-security/main ruby1.9.1-dev i386 1.9.3.194-8.1ubuntu1.2
  404  Not Found [IP: 91.189.91.13 80]
エラー http://security.ubuntu.com/ubuntu/ raring-security/main ruby1.8 i386 1.8.7.358-7ubuntu1.2
  404  Not Found [IP: 91.189.91.13 80]
エラー http://security.ubuntu.com/ubuntu/ raring-security/main ruby1.8-dev i386 1.8.7.358-7ubuntu1.2
  404  Not Found [IP: 91.189.91.13 80]
449 kB を 11秒 で取得しました (39.6 kB/s)
http://jp.archive.ubuntu.com/ubuntu/pool/main/g/gcc-4.7/libgomp1_4.7.3-1ubuntu1_i386.deb の取得に失敗しました  404  Not Found
http://jp.archive.ubuntu.com/ubuntu/pool/main/g/gcc-4.7/libitm1_4.7.3-1ubuntu1_i386.deb の取得に失敗しました  404  Not Found
http://jp.archive.ubuntu.com/ubuntu/pool/main/b/binutils/binutils_2.23.2-2ubuntu1_i386.deb の取得に失敗しました  404  Not Found
http://security.ubuntu.com/ubuntu/pool/main/e/eglibc/libc-dev-bin_2.17-0ubuntu5.1_i386.deb の取得に失敗しました  404  Not Found [IP: 91.189.91.13 80]
http://security.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_3.8.0-35.50_i386.deb の取得に失敗しました  404  Not Found [IP: 91.189.91.13 80]
http://security.ubuntu.com/ubuntu/pool/main/e/eglibc/libc6-dev_2.17-0ubuntu5.1_i386.deb の取得に失敗しました  404  Not Found [IP: 91.189.91.13 80]
http://jp.archive.ubuntu.com/ubuntu/pool/main/g/gcc-4.7/libgcc-4.7-dev_4.7.3-1ubuntu1_i386.deb の取得に失敗しました  404  Not Found
http://jp.archive.ubuntu.com/ubuntu/pool/main/g/gcc-4.7/gcc-4.7_4.7.3-1ubuntu1_i386.deb の取得に失敗しました  404  Not Found
http://jp.archive.ubuntu.com/ubuntu/pool/main/g/gcc-defaults/gcc_4.7.3-1ubuntu10_i386.deb の取得に失敗しました  404  Not Found
http://jp.archive.ubuntu.com/ubuntu/pool/main/g/gcc-4.7/libstdc++6-4.7-dev_4.7.3-1ubuntu1_i386.deb の取得に失敗しました  404  Not Found
http://jp.archive.ubuntu.com/ubuntu/pool/main/g/gcc-4.7/g++-4.7_4.7.3-1ubuntu1_i386.deb の取得に失敗しました  404  Not Found
http://jp.archive.ubuntu.com/ubuntu/pool/main/g/gcc-defaults/g++_4.7.3-1ubuntu10_i386.deb の取得に失敗しました  404  Not Found
http://jp.archive.ubuntu.com/ubuntu/pool/main/m/make-dfsg/make_3.81-8.2ubuntu2_i386.deb の取得に失敗しました  404  Not Found
http://jp.archive.ubuntu.com/ubuntu/pool/main/d/dpkg/libdpkg-perl_1.16.10ubuntu1_all.deb の取得に失敗しました  404  Not Found
http://jp.archive.ubuntu.com/ubuntu/pool/main/d/dpkg/dpkg-dev_1.16.10ubuntu1_all.deb の取得に失敗しました  404  Not Found
http://jp.archive.ubuntu.com/ubuntu/pool/main/b/build-essential/build-essential_11.6ubuntu4_i386.deb の取得に失敗しました  404  Not Found
http://jp.archive.ubuntu.com/ubuntu/pool/main/f/fakeroot/fakeroot_1.18.4-2ubuntu1_i386.deb の取得に失敗しました  404  Not Found
http://jp.archive.ubuntu.com/ubuntu/pool/main/g/git/git-man_1.8.1.2-1_all.deb の取得に失敗しました  404  Not Found
http://jp.archive.ubuntu.com/ubuntu/pool/main/g/git/git_1.8.1.2-1_i386.deb の取 得に失敗しました  404  Not Found
http://jp.archive.ubuntu.com/ubuntu/pool/main/p/pkg-config/pkg-config_0.26-1ubuntu3_i386.deb の取得に失敗しました  404  Not Found
http://jp.archive.ubuntu.com/ubuntu/pool/main/z/zlib/zlib1g-dev_1.2.7.dfsg-13ubuntu2_i386.deb の取得に失敗しました  404  Not Found
http://jp.archive.ubuntu.com/ubuntu/pool/main/g/glib2.0/libglib2.0-dev_2.36.0-1ubuntu2_i386.deb の取得に失敗しました  404  Not Found
http://jp.archive.ubuntu.com/ubuntu/pool/main/libp/libpcap/libpcap0.8-dev_1.3.0-1_i386.deb の取得に失敗しました  404  Not Found
http://jp.archive.ubuntu.com/ubuntu/pool/main/libp/libpcap/libpcap-dev_1.3.0-1_all.deb の取得に失敗しました  404  Not Found
http://security.ubuntu.com/ubuntu/pool/main/r/ruby1.8/libruby1.8_1.8.7.358-7ubuntu1.2_i386.deb の取得に失敗しました  404  Not Found [IP: 91.189.91.13 80]
http://security.ubuntu.com/ubuntu/pool/main/r/ruby1.9.1/libruby1.9.1_1.9.3.194-8.1ubuntu1.2_i386.deb の取得に失敗しました  404  Not Found [IP: 91.189.91.13 80]
http://jp.archive.ubuntu.com/ubuntu/pool/main/s/sqlite3/libsqlite3-dev_3.7.15.2-1ubuntu1_i386.deb の取得に失敗しました  404  Not Found
http://jp.archive.ubuntu.com/ubuntu/pool/main/m/manpages/manpages-dev_3.44-0ubuntu1_all.deb の取得に失敗しました  404  Not Found
http://security.ubuntu.com/ubuntu/pool/main/r/ruby1.9.1/ruby1.9.1_1.9.3.194-8.1ubuntu1.2_i386.deb の取得に失敗しました  404  Not Found [IP: 91.189.91.13 80]
http://jp.archive.ubuntu.com/ubuntu/pool/main/r/ruby-defaults/ruby_4.9_all.deb  の取得に失敗しました  404  Not Found
http://security.ubuntu.com/ubuntu/pool/main/r/ruby1.9.1/ruby1.9.1-dev_1.9.3.194-8.1ubuntu1.2_i386.deb の取得に失敗しました  404  Not Found [IP: 91.189.91.13 80]
http://jp.archive.ubuntu.com/ubuntu/pool/main/r/ruby-defaults/ruby-dev_4.9_all.deb の取得に失敗しました  404  Not Found
http://security.ubuntu.com/ubuntu/pool/main/r/ruby1.8/ruby1.8_1.8.7.358-7ubuntu1.2_i386.deb の取得に失敗しました  404  Not Found [IP: 91.189.91.13 80]
http://security.ubuntu.com/ubuntu/pool/main/r/ruby1.8/ruby1.8-dev_1.8.7.358-7ubuntu1.2_i386.deb の取得に失敗しました  404  Not Found [IP: 91.189.91.13 80]
http://jp.archive.ubuntu.com/ubuntu/pool/main/r/rubygems/rubygems_1.8.24-1ubuntu1_all.deb の取得に失敗しました  404  Not Found
E: いくつかのアーカイブを取得できません。apt-get update を実行するか --fix-missing オプションを付けて試してみてください。

2014年7月13日 (日)

◆ 単純なブリッジの実装その4~Open vSwitch対策~【OpenFlow1.0をTremaの土管として使う】

以前書いた記事『◆ 単純なブリッジの実装その3~より完璧な土管化~【OpenFlow1.0をTremaの土管として使う】』の保守リリースです。

Open vSwitch と接続した場合に、イーサネットの最低フレーム長に満たないデータが packet_in に入ってくる現象が発生し、そのまま転送しようとすると Trema が終了してしまうので対策することにしました。
こういうケースを想定した処理は堅牢なプログラムにするためには必要でしたね。

■発生環境
  ・OS: Lubuntu 13.04 Desktop (i386)
  ・Trema: 0.4.7
  ・OpenFlowスイッチ: Open vSwitch 1.9.0 (※同OS上に apt-get でインストール)
  ・仮想ホストとして、ネットワークネームスペース

※記事『◆ Lubuntu 13.04 に Open vSwitch をインストールした時のログ

 作成方法詳細は後述します。

■現象
  以下のメッセージを出力して Trema が停止する。

The length of the provided Ethernet frame is shorter than the minimum length of an Ethernet frame (= 64 bytes).

■原因
  送信データが、イーサネットの最小フレームサイズ(64バイト)に満たないため。

  ARP パケットを受け取った時に packet_in に入ってくる PacketIn メッセージの data のサイズが 42 バイトで渡ってくる。これをそのまま send_packet_out で送ろうとすると、
  42 + 4(FCS分) = 46 バイト
となり、64バイトに満たない。

■対策
  send_packet_out に渡すデータのデータ長の最低長が、64 から FCS分の4バイトを除いた 60 バイトとなるようにする。
  send_packet_out で送る data が 60 バイトに満たない場合、後ろを 0 で埋めて 60 バイトにする。

■ソースコード
赤字が変更箇所です。

class SimpleBridge4 < Controller
  MIN_PACKET_DATA_LEN = 60

  def start
    @port_list = [ 1, 2, 3 ]    # all port numbers
  end

  def switch_ready( datapath_id )
    info "Switch[0x%016x] is up." % datapath_id

    send_flow_mod_add( datapath_id, :priority => 100 )

    @port_list.each do | port |
      send_flow_mod_add( datapath_id,
        :match => Match.new( :in_port => port ),
        :actions => SendOutPort.new( OFPP_CONTROLLER ) )
    end
  end

  def switch_disconnected( datapath_id )
    info "Switch[0x%016x] is disconnected." % datapath_id
  end

  def packet_in( datapath_id, message )
    return unless message.reason == Trema::PacketIn::OFPR_ACTION

    # padding. length of sending data must be >= 60
    data_len = message.data.length
    if ( data_len < MIN_PACKET_DATA_LEN )
      data = message.data + "\x00" * ( MIN_PACKET_DATA_LEN - data_len )
    else
      data = message.data
    end

    actions = [ ]
    @port_list.each do | port |
      if ( message.in_port != port )
        actions.push( SendOutPort.new( port ) )
      end
    end

    send_packet_out( datapath_id,
      :in_port => message.in_port,
      :data => data,
      :actions => actions )   end end

■再現環境

Photo_2

(1)再現環境の作り方
以下のコマンドを実行します。当然、すでに Open vSwitch がインストール済であることが前提です。

sudo ovs-vsctl add-br ofs1
sudo ovs-vsctl set-fail-mode ofs1 secure

sudo ip netns add vhost1
sudo ip link add name vlink1-0 type veth peer name vlink1-1
sudo ip link set vlink1-1 netns vhost1
sudo ip netns exec vhost1 ifconfig vlink1-1 up 192.168.0.1
sudo ip link set vlink1-0 up
sudo ovs-vsctl add-port ofs1 vlink1-0

sudo ip netns add vhost2
sudo ip link add name vlink2-0 type veth peer name vlink2-1
sudo ip link set vlink2-1 netns vhost2
sudo ip netns exec vhost2 ifconfig vlink2-1 up 192.168.0.2
sudo ip link set vlink2-0 up
sudo ovs-vsctl add-port ofs1 vlink2-0

sudo ovs-vsctl set-controller ofs1 tcp:127.0.0.1:6653
sudo ovs-vsctl set controller ofs1 connection-mode=out-of-band
sudo ovs-vsctl set controller ofs1 inactivity-probe=180

(2)現象を発生させるコマンド
192.168.0.2 への ARP キャッシュを消して、必ず ARP リクエストが生じるようにしてから ping を実行します。
あらかじめ Trema を実行させておきスイッチと接続が完了したことを確認した上で、以下のコマンドを実行します。1つ目のコマンド実行時に、ARPエントリがありません、といったメッセージがでるかもしれませんが構いません。

 sudo ip netns exec vhost1 arp -d 192.168.0.2
 sudo ip netns exec vhost1 ping -c 10 192.168.0.2

(3)再現環境の削除の仕方

 sudo ovs-vsctl del-br ofs1
 sudo ip netns delete vhost1
 sudo ip netns delete vhost2

以上

2014年7月 5日 (土)

◆ ポートベースVLANの作成【OpenFlow1.0をTremaの土管として使う】

[注意: 本記事は、OpenFlow の適切な使い方ではありません。単にパケットの出し入れの道具として利用しています。]

前回のブリッジのコードをもとにしてポートベースVLAN を実装し、動かしてみました。

■確認環境
  OS: Lubuntu 13.04 Desktop (i386)
  Trema: 0.4.7

■構成
  スイッチは、4ポート。
  ポート1,2で VLAN1 を構成。
  ポート3、4で VLAN2 を構成。

  各ポートにはホストを接続。

  Trema の仮想ネットワーク構成ファイル(h4s1.conf)は以下の通り:

vswitch ( "vswitch1" ) {
  datapath_id 0x01
}

vhost ( "vhost1" ) {
  mac "02:00:00:00:00:01"
  ip "192.168.1.1"
  netmask "255.255.255.0"
}

vhost ( "vhost2" ) {
  mac "02:00:00:00:00:02"
  ip "192.168.1.2"
  netmask "255.255.255.0"
}

vhost ( "vhost3" ) {
  mac "02:00:00:00:00:03"
  ip "192.168.1.3"
  netmask "255.255.255.0"
}

vhost ( "vhost4" ) {
  mac "02:00:00:00:00:04"
  ip "192.168.1.4"
  netmask "255.255.255.0"
}

link "vswitch1", "vhost1"
link "vswitch1", "vhost2"
link "vswitch1", "vhost3"
link "vswitch1", "vhost4"

図にすると:
Photo_2
※注意!!
Trema の仮想ネットワークではスイッチのポート番号と仮想ホストの対応を指定できません。上記の図における仮想ホストが接続されるポートのポート番号は今回テストした時にたまたまこうだったというだけで、必ずこうなるわけではありません。

■Trema のコード(PortBasedVLAN1.rb)
基本となるコードは前回のブリッジのコードです。

class PortBasedVLAN1 < Controller

  def start
    @port_list = [ 1, 2, 3, 4 ]    # all port numbers

    @port_list_of_vlan = {
      1 => [ 1, 2 ],
      2 => [ 3, 4 ]
    }

    @vlan_id_of_port = { }
    @port_list_of_vlan.each do | vlan_id, vlan_port_list |
      vlan_port_list.each do | port |
        @vlan_id_of_port[ port ] = vlan_id
      end
    end

    @port_of_mac = { }
  end

  def switch_ready( datapath_id )
    info "Switch[0x%016x] is up." % datapath_id

    send_flow_mod_add( datapath_id, :priority => 100 )

    @port_list.each do | port |
      send_flow_mod_add( datapath_id,
        :match => Match.new( :in_port => port ),
        :actions => SendOutPort.new( OFPP_CONTROLLER ) )
    end
  end

  def switch_disconnected( datapath_id )
    info "Switch[0x%016x] is disconnected." % datapath_id
  end

  def packet_in( datapath_id, message )
    return unless message.reason == Trema::PacketIn::OFPR_ACTION

    learned_port = @port_of_mac[ message.macsa.to_i ]
    if learned_port == nil or learned_port != message.in_port
      info "MAC[%s] is found at Port #{ message.in_port }." % message.macsa.to_s
      @port_of_mac[ message.macsa.to_i ] = message.in_port
    end

    vlan_id = @vlan_id_of_port[ message.in_port ]
    vlan_port_list = @port_list_of_vlan[ vlan_id ]

    actions = [ ]
    vlan_port_list.each do | port |
      if ( message.in_port != port )
        actions.push( SendOutPort.new( port ) )
      end
    end

    send_packet_out( datapath_id,
      :in_port => message.in_port,
      :data => message.data,
      :actions => actions )
  end

end

緑のところ:
ポート数を4つに増やしています。

青いところ:
仮想ホストがどのポートにつながっているか分かるようにメッセージ出力するためのコードです。MACアドレスをキーにしたハッシュにポート番号を格納しています。受け取ったパケットが、まだ記録がないMAC から届いた場合か記録があってもポート番号に変更があった時にメッセージ出力するようにしています。

赤いところ:
start メソッド
VLAN ごとに含まれるポート番号の配列を @port_list_of_mac 変数にあらかじめ指定しています。VLAN ID をキーとしたハッシュです。
ポート番号から VLAN ID を求めるため @vlan_id_of_port のハッシュをあらかじめ計算しています。

packet_in メソッド
ポート番号から VLAN ID を求めて、その VLAN のポート番号の配列を求めています。
以前は、すべてのポートに対してパケットを送信していた箇所を、入力ポート番号が属する VLAN の各ポートにパケットを送信するように変更しています。

■テスト

trema を起動します。

$ trema run PortBasedVLAN1.rb -c h4s1.conf
Switch[0x0000000000000001] is up.

Lubuntu の network-monitor サービスを停止していないと、勝手にパケットが飛ぶので仮想ホスト以外のMACが検出されてメッセージが出力されますがこれらは無視してください。

別のターミナルウィンドウを開き、各仮想ホストからパケットを送ります:

$ trema send_packet -s vhost1 -d vhost2
$ trema send_packet -s vhost2 -d vhost3
$ trema send_packet -s vhost3 -d vhost4
$ trema send_packet -s vhost4 -d vhost1

そうすると trema を起動した画面に以下のように各仮想ホストのMACが検出されてどのポートにつながっているか確認できます:

MAC[02:00:00:00:00:01] is found at Port 3.
MAC[02:00:00:00:00:02] is found at Port 1.
MAC[02:00:00:00:00:03] is found at Port 2.
MAC[02:00:00:00:00:04] is found at Port 4.

上記のポートと仮想ホストの接続関係を前提に通信のテストを行います。

まず、テストの前に以下のコマンドで統計情報をクリアしておきます:

$ trema reset_stats

(1) テスト1: VLAN をまたがった通信
ポート3の vhost1 からポート1 の vhost2 へパケットを送り vhost2 側の受信パケットを確認してみます。

$ trema send_packet -s vhost1 -d vhost2
$ trema show_stats -r vhost2

ポート3 は VLAN2, ポート1 は VLAN1 に属し異なる VLAN なのでパケットが届かず vhost2 では何もパケットを受信していないので空行が表示されます。

(2) テスト2: VLAN 内の通信
ポート2 の vhost3 からポート1 の vhost2 へパケットを送り vhost2 側の受信パケットを確認してみます。

$ trema send_packet -s vhost3 -d vhost2
$ trema show_stats -r vhost2
ip_dst,tp_dst,ip_src,tp_src,n_pkts,n_octets
192.168.1.2,1,192.168.1.3,1,1,50

VLAN1 内の通信なので受信パケットが vhost2 に届いています。

(3) その他のポートの組み合わせも試してみます

$ trema send_packet -s vhost3 -d vhost4
$ trema show_stats -r vhost4

$ trema send_packet -s vhost1 -d vhost4
$ trema show_stats -r vhost4
ip_dst,tp_dst,ip_src,tp_src,n_pkts,n_octets
192.168.1.4,1,192.168.1.1,1,1,50

こちらも、VLAN内の通信となる場合だけパケットが受信できています。

以上です。

« 2014年6月 | トップページ | 2014年8月 »

最近のトラックバック

無料ブログはココログ