labunix's blog

labunixのラボUnix

FreeBSD10.1-RC4のqjail環境にbashをインストールしてみた。

■FreeBSD10.1-RC4のqjail環境にbashをインストールしてみた。
 環境は以下。

 FreeBSD10.1-RC4でqjail3.6をインストールしてみた。
 http://labunix.hateblo.jp/entry/20141122/1416649086

■ホストから、「pkg -j [jailname] 」でアップデート、インストール。
 sudoではプロキシを通さないので失敗するのは同じ。

$ sudo qjail list
 

STA JID  NIC IP              Jailname
--- ---- --- --------------- --------------------------------------------------
DR  3    em0 192.168.100.1   qjail001
 
 
$ sudo pkg -j qjail001 update
Updating FreeBSD repository catalogue...
pkg: http://pkg.FreeBSD.org/freebsd:10:x86:64/latest/meta.txz: Connection refused
pkg: repository FreeBSD has no meta file, using default settings
^C
$ su root -c 'pkg -j qjail001 update'
Password:
Updating FreeBSD repository catalogue...
[qjail001] Fetching meta.txz: 100%   940 B   0.9k/s    00:01    
[qjail001] Fetching digests.txz: 100%    2 MB   1.0M/s    00:02    
[qjail001] Fetching packagesite.txz: 100%    5 MB   1.8M/s    00:03    
Processing new repository entries: 100%
FreeBSD repository update completed. 23717 packages processed:
  0 updated, 0 removed and 23717 added.

$ su root -c 'pkg -j qjail001 upgrade'
Password:
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
Checking for upgrades (0 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.

$ su root -c 'pkg -j qjail001 install -y bash'
Password:
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following 3 packages will be affected (of 0 checked):

New packages to be INSTALLED:
	bash: 4.3.30
	indexinfo: 0.2
	gettext: 0.18.3.1_1

The process will require 17 MB more space.
3 MB to be downloaded.
[qjail001] Fetching bash-4.3.30.txz: 100%    1 MB 613.7k/s    00:02    
[qjail001] Fetching indexinfo-0.2.txz: 100%    5 KB   4.9k/s    00:01    
[qjail001] Fetching gettext-0.18.3.1_1.txz: 100%    2 MB   1.1M/s    00:02    
Checking integrity... done (0 conflicting)
[qjail001] [1/3] Installing indexinfo-0.2: 100%
[qjail001] [2/3] Installing gettext-0.18.3.1_1: 100%
[qjail001] [3/3] Installing bash-4.3.30: 100%

■プロキシを使わない「pkg info」コマンドは「sudo」でもいける。

$ pkg -j qjail001 info
pkg: jail_attach(qjail001): Operation not permitted

$ sudo pkg -j qjail001 info
bash-4.3.30                    The GNU Project's Bourne Again SHell
gettext-0.18.3.1_1             GNU gettext package
indexinfo-0.2                  Utility to regenerate the GNU info page index