◆【改訂】OpenFlow フレームワーク Trema 0.4 のインストール手順【0.4.7対応】
[2014-0727 追記: apt-get install で Not Found になる場合について追加しました。]
[2014-0727 追記2: 新規に Lubuntu 13.04 をインストールする場合の注意事項を追加。]
Trema 0.4.7 では、前提となる RubyGems のバージョンがあがっているため、https://github.com/trema/trema に記載のコマンドを実行しただけではインストールに失敗することが分かりました。失敗しないようにするためのインストール手順を整理しておきます。
RubyGems をバージョンアップしないとどうなるかは、前回の記事「◆ Trema 0.4.7インストール失敗とバージョン指定インストール」に記載しています。
■確認環境
・OS: Lubuntu 13.04 Desktop (i386)
(2014年06月08日にソフトウェアアップデート済)
未確認ですが Ubuntu 13.04 Desktop (i386)でも同じだと思います。
※[2014-0727 追記:新規に Lubuntu13.04 をインストールされる場合は、記事「◆サポート期限切れの Lubuntu 13.04 を新規インストール 」を参照ください。]
・Trema: 0.4.7
■インストール手順
https://github.com/trema/trema の「Getting Started」に従ってインストールしていきます。
1. 「1.Install the prerequisites at the command prompt:」に従い以下のコマンドを実行:
$ sudo apt-get install gcc make git ruby rubygems ruby-dev libpcap-dev libsqlite3-dev libglib2.0-dev
[2014-0727 追記: ここで、「Not Found」が出て失敗する現象が起きる場合は、記事「◆ Lubuntu 13.04 の apt-get install で「Not Found」となる現象への対処」を参照して対処ください。
]
2.前提の確認 (ここがミソ)
「Getting Started」には書いていない手順です。前提を満たしているか確認します。
「Supported Platforms」を見ると以下の記載があります(2014年06月11時点):
•Ruby 1.9.3 or higher
•RubyGems 1.8.25 or higher
実際にインストールされているバージョンを確認します。
$ ruby -v ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux] $ gem -v 1.8.23
RubyGems のバージョンが 1.8.23 で満たせていません。そこで、RubyGems のバージョンをあげるため以下のコマンドを実行します:
$ sudo gem install rubygems-update -v 1.8.25
$ sudo update_rubygems
update_rubygems コマンドを実行するとバージョンアップ分の変更内容が大量に出力されます。ちょっとびっくりしますが問題ありません。
ここでは rubygem-update のインストールで -v 1.8.25 と指定することで Trema が必要とする最低のバージョンにしています。
バージョン指定なしだと最新版(現時点で 2.3.0)が入るのですが trema のインストール時に妙なメッセージが出るので避けた方が良さそうです。
(ちなみに 1.8 の最新 1.8.29 でも大丈夫でしたが、Trema さえ入れば良いと割り切って 1.8 の最新にする手順にはしていません。)
では、バージョンを再度確認します:
$ gem -v
1.8.25
今度は 1.8.25 なので前提を満たせていることが確認できました。
3. 「Install Trema at the command prompt:」に従い以下のコマンドを実行します:
$ sudo gem install trema
コマンド実行時の画面は以下の通り:
$ sudo gem install trema Fetching: bundler-1.6.2.gem (100%) Fetching: gli-2.10.0.gem (100%) Fetching: Platform-0.4.0.gem (100%) Fetching: open4-1.3.4.gem (100%) Fetching: POpen4-0.1.4.gem (100%) Fetching: rake-10.3.2.gem (100%) Fetching: paper_house-0.6.2.gem (100%) Fetching: bindata-2.1.0.gem (100%) Fetching: pio-0.7.0.gem (100%) Fetching: json-1.8.1.gem (100%) Building native extensions. This could take a while... Fetching: rdoc-4.1.1.gem (100%) Depending on your version of ruby, you may need to install ruby rdoc/ri data: <= 1.8.6 : unsupported = 1.8.7 : gem install rdoc-data; rdoc-data --install = 1.9.1 : gem install rdoc-data; rdoc-data --install >= 1.9.2 : nothing to do! Yay! Fetching: trema-0.4.7.gem (100%) Building native extensions. This could take a while... Successfully installed bundler-1.6.2 Successfully installed gli-2.10.0 Successfully installed Platform-0.4.0 Successfully installed open4-1.3.4 Successfully installed POpen4-0.1.4 Successfully installed rake-10.3.2 Successfully installed paper_house-0.6.2 Successfully installed bindata-2.1.0 Successfully installed pio-0.7.0 Successfully installed json-1.8.1 Successfully installed rdoc-4.1.1 Successfully installed trema-0.4.7 12 gems installed Installing ri documentation for bundler-1.6.2... Installing ri documentation for gli-2.10.0... Installing ri documentation for Platform-0.4.0... Installing ri documentation for open4-1.3.4... Installing ri documentation for POpen4-0.1.4... Installing ri documentation for rake-10.3.2... Installing ri documentation for paper_house-0.6.2... Installing ri documentation for bindata-2.1.0... Installing ri documentation for pio-0.7.0... Installing ri documentation for json-1.8.1... Installing ri documentation for rdoc-4.1.1... Installing ri documentation for trema-0.4.7... Installing RDoc documentation for bundler-1.6.2... Installing RDoc documentation for gli-2.10.0... Installing RDoc documentation for Platform-0.4.0... Installing RDoc documentation for open4-1.3.4... Installing RDoc documentation for POpen4-0.1.4... Installing RDoc documentation for rake-10.3.2... Installing RDoc documentation for paper_house-0.6.2... Installing RDoc documentation for bindata-2.1.0... Installing RDoc documentation for pio-0.7.0... Installing RDoc documentation for json-1.8.1... Installing RDoc documentation for rdoc-4.1.1... Installing RDoc documentation for trema-0.4.7...
4.Trema のバージョン確認
では、Trema のバージョン確認をしてみます:
$ trema version
trema version 0.4.7
無事 Trema がインストールできました。
■ RubyGems 2.3.0 を使うとどうなるのか?
上書きをするか求められて N を選択するとインストールが中断されます:
$ sudo gem install trema Fetching: json-1.8.1.gem (100%) Building native extensions. This could take a while... Successfully installed json-1.8.1 Fetching: rdoc-4.1.1.gem (100%) rdoc's executable "rdoc" conflicts with /usr/bin/rdoc Overwrite the executable? [yN] N ERROR: Error installing trema: "rdoc" from rdoc conflicts with /usr/bin/rdoc
再度、実行して上書きを y で許可すると今度は大量のメッセージが・・・:
$ sudo gem install trema rdoc's executable "rdoc" conflicts with /usr/bin/rdoc Overwrite the executable? [yN] y rdoc's executable "ri" conflicts with /usr/bin/ri Overwrite the executable? [yN] y Depending on your version of ruby, you may need to install ruby rdoc/ri data: <= 1.8.6 : unsupported = 1.8.7 : gem install rdoc-data; rdoc-data --install = 1.9.1 : gem install rdoc-data; rdoc-data --install >= 1.9.2 : nothing to do! Yay! Successfully installed rdoc-4.1.1 Fetching: rake-10.3.2.gem (100%) Successfully installed rake-10.3.2 Fetching: bindata-2.1.0.gem (100%) Successfully installed bindata-2.1.0 Fetching: pio-0.7.0.gem (100%) Successfully installed pio-0.7.0 Fetching: Platform-0.4.0.gem (100%) Successfully installed Platform-0.4.0 Fetching: open4-1.3.4.gem (100%) Successfully installed open4-1.3.4 Fetching: POpen4-0.1.4.gem (100%) Successfully installed POpen4-0.1.4 Fetching: paper_house-0.6.2.gem (100%) Successfully installed paper_house-0.6.2 Fetching: gli-2.10.0.gem (100%) Successfully installed gli-2.10.0 Fetching: bundler-1.6.2.gem (100%) Successfully installed bundler-1.6.2 Fetching: trema-0.4.7.gem (100%) Building native extensions. This could take a while... Successfully installed trema-0.4.7 Installing ri documentation for rdoc-4.1.1 Installing ri documentation for rake-10.3.2 unable to convert "\xC5" from ASCII-8BIT to UTF-8 for examples/NBT.txt, skipping Installing ri documentation for bindata-2.1.0 Installing ri documentation for pio-0.7.0 Installing ri documentation for Platform-0.4.0 Installing ri documentation for open4-1.3.4 Installing ri documentation for POpen4-0.1.4 unable to convert "\xCF" from ASCII-8BIT to UTF-8 for examples/fail/hello, skipping Installing ri documentation for paper_house-0.6.2 Installing ri documentation for gli-2.10.0 Installing ri documentation for bundler-1.6.2 unable to convert "\xD0" from ASCII-8BIT to UTF-8 for objects/tremashark/syslog_relay, skipping unable to convert "\xA0" from ASCII-8BIT to UTF-8 for objects/tremashark/stdin_relay, skipping unable to convert "\xA0" from ASCII-8BIT to UTF-8 for objects/tremashark/tremashark, skipping unable to convert "\xC0" from ASCII-8BIT to UTF-8 for objects/tremashark/packet_capture, skipping unable to convert "\xE4" from ASCII-8BIT to UTF-8 for objects/openvswitch/bin/ovs-vsctl, skipping unable to convert "\x98" from ASCII-8BIT to UTF-8 for objects/openvswitch/bin/ovsdb-client, skipping unable to convert "\x94" from ASCII-8BIT to UTF-8 for objects/openvswitch/bin/ovs-appctl, skipping unable to convert "\xE0" from ASCII-8BIT to UTF-8 for objects/openvswitch/bin/ovs-controller, skipping unable to convert "\xEC" from ASCII-8BIT to UTF-8 for objects/openvswitch/bin/ovs-openflowd, skipping unable to convert "\xE4" from ASCII-8BIT to UTF-8 for objects/openvswitch/bin/ovs-dpctl, skipping unable to convert "\xAC" from ASCII-8BIT to UTF-8 for objects/openvswitch/bin/ovsdb-tool, skipping unable to convert "\xB8" from ASCII-8BIT to UTF-8 for objects/openvswitch/bin/ovs-ofctl, skipping unable to convert "\xB0" from ASCII-8BIT to UTF-8 for objects/openvswitch/bin/ovs-benchmark, skipping unable to convert "\x8C" from ASCII-8BIT to UTF-8 for objects/openvswitch/sbin/ovsdb-server, skipping unable to convert "\xD4" from ASCII-8BIT to UTF-8 for objects/openvswitch/sbin/ovs-brcompatd, skipping unable to convert "\xD8" from ASCII-8BIT to UTF-8 for objects/openvswitch/sbin/ovs-vlan-bug-workaround, skipping unable to convert "\xD4" from ASCII-8BIT to UTF-8 for objects/openvswitch/sbin/ovs-vswitchd, skipping unable to convert "\xD0" from ASCII-8BIT to UTF-8 for objects/packetin_filter/packetin_filter, skipping unable to convert "\xF0" from ASCII-8BIT to UTF-8 for objects/examples/openflow_switch/echo_switch, skipping unable to convert "\xF0" from ASCII-8BIT to UTF-8 for objects/examples/openflow_switch/hello_switch, skipping unable to convert "\xA6" from ASCII-8BIT to UTF-8 for objects/examples/dumper/dumper, skipping unable to convert "\xA6" from ASCII-8BIT to UTF-8 for objects/examples/switch_monitor/switch_monitor, skipping unable to convert "\xA6" from ASCII-8BIT to UTF-8 for objects/examples/packet_in/packet_in, skipping unable to convert "\xC0" from ASCII-8BIT to UTF-8 for objects/examples/traffic_monitor/traffic_monitor, skipping unable to convert "\xA6" from ASCII-8BIT to UTF-8 for objects/examples/switch_info/switch_info, skipping unable to convert "\xA7" from ASCII-8BIT to UTF-8 for objects/examples/multi_learning_switch/multi_learning_switch, skipping unable to convert "\xA8" from ASCII-8BIT to UTF-8 for objects/examples/switch_event_config/delete_forward_entry, skipping unable to convert "\xA8" from ASCII-8BIT to UTF-8 for objects/examples/switch_event_config/dump_forward_entries, skipping unable to convert "\xA8" from ASCII-8BIT to UTF-8 for objects/examples/switch_event_config/add_forward_entry, skipping unable to convert "\xA8" from ASCII-8BIT to UTF-8 for objects/examples/switch_event_config/set_forward_entries, skipping unable to convert "\xA6" from ASCII-8BIT to UTF-8 for objects/examples/cbench_switch/cbench_switch, skipping unable to convert "\xA6" from ASCII-8BIT to UTF-8 for objects/examples/repeater_hub/repeater_hub, skipping unable to convert "\x90" from ASCII-8BIT to UTF-8 for objects/examples/packetin_filter_config/dump_filter, skipping unable to convert "\xA0" from ASCII-8BIT to UTF-8 for objects/examples/packetin_filter_config/add_filter, skipping unable to convert "\xA0" from ASCII-8BIT to UTF-8 for objects/examples/packetin_filter_config/delete_filter_strict, skipping unable to convert "\x90" from ASCII-8BIT to UTF-8 for objects/examples/packetin_filter_config/dump_filter_strict, skipping unable to convert "\xA0" from ASCII-8BIT to UTF-8 for objects/examples/packetin_filter_config/delete_filter, skipping unable to convert "\xB0" from ASCII-8BIT to UTF-8 for objects/examples/learning_switch/learning_switch, skipping unable to convert "\xB0" from ASCII-8BIT to UTF-8 for objects/examples/list_switches/list_switches, skipping unable to convert "\xA6" from ASCII-8BIT to UTF-8 for objects/examples/openflow_message/features_request, skipping unable to convert "\xA6" from ASCII-8BIT to UTF-8 for objects/examples/openflow_message/hello, skipping unable to convert "\xA6" from ASCII-8BIT to UTF-8 for objects/examples/openflow_message/vendor_action, skipping unable to convert "\xA6" from ASCII-8BIT to UTF-8 for objects/examples/openflow_message/echo, skipping unable to convert "\xA6" from ASCII-8BIT to UTF-8 for objects/examples/openflow_message/set_config, skipping unable to convert "\xA6" from ASCII-8BIT to UTF-8 for objects/management/set_logging_level, skipping unable to convert "\xD0" from ASCII-8BIT to UTF-8 for objects/management/application, skipping unable to convert "\xA6" from ASCII-8BIT to UTF-8 for objects/management/echo, skipping unable to convert "\xA6" from ASCII-8BIT to UTF-8 for objects/management/show_stats, skipping unable to convert "\x9D" from ASCII-8BIT to UTF-8 for objects/oflops/bin/oflops, skipping unable to convert "\x94" from ASCII-8BIT to UTF-8 for objects/oflops/bin/cbench, skipping unable to convert "\x95" from ASCII-8BIT to UTF-8 for objects/phost/phost, skipping unable to convert "\xEC" from ASCII-8BIT to UTF-8 for objects/phost/cli, skipping unable to convert "\xAA" from ASCII-8BIT to UTF-8 for objects/switch_manager/switch, skipping unable to convert "\xC0" from ASCII-8BIT to UTF-8 for objects/switch_manager/switch_manager, skipping unable to convert "\x9D" from ASCII-8BIT to UTF-8 for vendor/oflops-0.03.trema1/oflops, skipping unable to convert "\x94" from ASCII-8BIT to UTF-8 for vendor/oflops-0.03.trema1/cbench/cbench, skipping unable to convert "\xE4" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/utilities/ovs-vsctl, skipping unable to convert "\xE3" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/utilities/nlmon, skipping unable to convert "\x94" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/utilities/ovs-appctl, skipping unable to convert "\xE0" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/utilities/ovs-controller, skipping unable to convert "\xE4" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/utilities/ovs-dpctl, skipping unable to convert "\xD8" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/utilities/ovs-vlan-bug-workaround, skipping unable to convert "\xB8" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/utilities/ovs-ofctl, skipping unable to convert "\xB0" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/utilities/ovs-benchmark, skipping unable to convert "\xE0" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-lockfile, skipping unable to convert "\xD5" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-random, skipping unable to convert "\xF0" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-sha1, skipping unable to convert "\xFE" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-classifier, skipping unable to convert "\xD4" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-aes128, skipping unable to convert "\xD4" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-byte-order, skipping unable to convert "\x88" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-list, skipping unable to convert "\xD7" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-uuid, skipping unable to convert "\xD8" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-reconnect, skipping unable to convert "\x88" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-hmap, skipping unable to convert "\xDC" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-bundle, skipping unable to convert "\x86" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-strtok_r, skipping unable to convert "\xD3" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-file_name, skipping unable to convert "\xCC" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-ovsdb, skipping unable to convert "\xDC" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-json, skipping unable to convert "\xF0" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/testsuite, skipping unable to convert "\xE3" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-packets, skipping unable to convert "\xC8" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-jsonrpc, skipping unable to convert "\xD4" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-unix-socket, skipping unable to convert "\xE2" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-timeval, skipping unable to convert "\xD3" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-util, skipping unable to convert "\xB7" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-flows, skipping unable to convert "\xB8" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-multipath, skipping unable to convert "\xF8" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-hash, skipping unable to convert "\xA0" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-csum, skipping unable to convert "\x80" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-vconn, skipping unable to convert "\xEC" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-openflowd, skipping unable to convert "\x91" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/tests/test-type-props, skipping unable to convert "\x8C" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/ovsdb/ovsdb-server, skipping unable to convert "\x98" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/ovsdb/ovsdb-client, skipping unable to convert "\xAC" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/ovsdb/ovsdb-tool, skipping unable to convert "\xD4" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/vswitchd/ovs-brcompatd, skipping unable to convert "\xD4" from ASCII-8BIT to UTF-8 for vendor/openvswitch-1.2.2.trema1/vswitchd/ovs-vswitchd, skipping unable to convert "\x95" from ASCII-8BIT to UTF-8 for vendor/phost/src/phost, skipping unable to convert "\xEC" from ASCII-8BIT to UTF-8 for vendor/phost/src/cli, skipping Installing ri documentation for trema-0.4.7 11 gems installed
ここから RubyGems 1.8.25 にダウングレードしてインストールさせてみます:
$ sudo gem uninstall rubygems-update
$ sudo gem install rubygems-update -v 1.8.25 Fetching: rubygems-update-1.8.25.gem (100%) Successfully installed rubygems-update-1.8.25 Parsing documentation for rubygems-update-1.8.25 Installing ri documentation for rubygems-update-1.8.25 Done installing documentation for rubygems-update after 0 seconds 1 gem installed
$ sudo update_rubygems RubyGems 1.8.25 installed == 1.8.25/ 2013-01-24 * 6 bug fixes: * Added 11627 to setup bin_file location to protect against errors. Fixes #328 by ConradIrwin * Specification#ruby_code didn't handle Requirement with multiple * Fix error on creating a Version object with a frozen string. * Fix incremental index updates * Fix missing load_yaml in YAML-related requirement.rb code. * Manually backport encoding-aware YAML gemspec ------------------------------------------------------------------------------ RubyGems installed the following executables: /usr/bin/gem1.9.1 $ sudo gem uninstall trema Remove executables: trema, trema-config in addition to the gem? [Yn] Y Removing trema Removing trema-config Successfully uninstalled trema-0.4.7 $ sudo gem install trema Fetching: trema-0.4.7.gem (100%) Building native extensions. This could take a while... Successfully installed trema-0.4.7 1 gem installed Installing ri documentation for trema-0.4.7... Installing RDoc documentation for trema-0.4.7... $ trema version trema version 0.4.7
最近のコメント