Debianなページ
http://www.t.ring.gr.jp/ を Mozilla などで表示すれば、TENBIN が自動的に近いサーバを探してくれる。また、http://www.dnsbalance.ring.gr.jp/ を表示すれば、空いているサーバを探してくれる。
# apt-get install netselect
して以下を実行 (ターミナルエミュレータに貼り付ければ OK)。
$ netselect -vv \ http://aist.ring.gr.jp/ \ http://ring.asahi-net.or.jp/ \ http://ring.crl.go.jp/ \ http://ring.astem.or.jp/ \ http://ring.jah.ne.jp/ \ http://ring.fujixerox.co.jp/ \ http://ring.so-net.ne.jp/ \ http://ring.ip-kyoto.ad.jp/ \ http://ring.iwate-pu.ac.jp/ \ http://ring.shibaura-it.ac.jp/ \ http://ring.ocn.ad.jp/ \ http://ring.htcn.ne.jp/ \ http://ring.pwd.ne.jp/ \ http://ring.tains.tohoku.ac.jp/ \ http://ring.toyama-ix.net/ \ http://ring.toyama-u.ac.jp/ \ http://ring.data-hotel.net/ \ http://ring.yamanashi.ac.jp/ \ http://ring.nihon-u.ac.jp/ \ http://ring.hosei.ac.jp/ \ http://ring.riken.go.jp/ \ http://ring.dcs.pref.mie.jp/ \ http://ring.qgpop.net/ \ http://ring.csi.ad.jp/ \ http://ring.atr.co.jp/ \ http://ring.shizuoka.ac.jp/ \ http://ring.airnet.ne.jp/ \ http://ring.k-opti.com/ \ http://ring.sbp-shimane.net/
結果の最後に http://近くのringサーバ (の候補) が表示される。
詳しくは近くのミラーサイトを探すにはを読みましょう。
この結果を元に /etc/apt/sources.list へ apt-line を書く。書式については下記を参考に。
もしくは apt-spy という一連の作業を自動で設定してくれるパッケージもあります。
適切な apt-line を設定する事が apt/dpkg を快適に使うための第一歩。
deb http://近くのringサーバ/pub/linux/debian/debian stable main contrib non-free
deb http://近くのringサーバ/pub/linux/debian/debian-non-US stable/non-US main contrib non-free
deb http://近くのringサーバ/pub/linux/debian/debian-jp stable-jp main contrib non-free
deb http://security.debian.org/ stable/updates main contrib non-free
deb http://近くのringサーバ/pub/linux/debian/debian sarge main contrib non-free
deb http://近くのringサーバ/pub/linux/debian/debian-non-US sarge/non-US main contrib non-free
deb http://近くのringサーバ/pub/linux/debian/debian-jp sarge-jp main contrib non-free
deb http://security.debian.org/ sarge/updates main contrib non-free
deb http://近くのringサーバ/pub/linux/debian/debian sid main contrib non-free
deb http://近くのringサーバ/pub/linux/debian/debian-non-US sid/non-US main contrib non-free
deb http://近くのringサーバ/pub/linux/debian/debian-jp sid-jp main contrib non-free
proposed-updates は、リリース後に行われた Fix が取り込まれたパッケージを置く所で、次のマイナーリリース時には本体に取り込まれる。
ここに入るのは主にセキュリティ Fix などだけど、あくまで暫定的なものなので突然パッケージがなくなったりする。
また依存関係などに細かい問題が出る事もあるので本人のポリシー次第ってことで。
deb http://近くのringサーバ/pub/linux/debian/debian proposed-updates main contrib non-free
deb http://近くのringサーバ/pub/linux/debian/debian-non-US proposed-updates/non-US main contrib non-free
deb http://近くのringサーバ/pub/linux/debian/debian-jp dists/proposed-updates-jp/
deb http://近くのringサーバ/pub/linux/debian/debian sarge-proposed-updates main contrib non-free
deb http://近くのringサーバ/pub/linux/debian/debian-non-US sarge-proposed-updates/non-US main contrib non-free
2002/6/4からの Debian の古いバージョンのパッケージが置いてあります。
アップグレードして不具合があればここから参照できます。
使い方はリンク先参照。
/etc/apt/sources.list の "先頭" に以下の行のいずれかを、 使用しているディストリビューション (woody/sarge/sid) に合わせて追加する。 翻訳作業に参加する人は、3行とも記述してね。
deb http://ftp.jp.debian.org/debian-ddtp ja/woody main
deb http://ftp.jp.debian.org/debian-ddtp ja/sarge main
deb http://ftp.jp.debian.org/debian-ddtp ja/sid main
その後 'apt-get update' すれば、全てのツール (dselect, gnome-apt, deity, ...) で翻訳済の説明文を使用することができる。
これは設定しなくても問題ありません。
もし必要あれば /etc/apt/apt.conf あたりに書いておきましょう。
書式は
例1) APT::Clean-Installed "true"; APT::Get::Assume-Yes "true";
例2) APT { Clean-Installed "true"; Get { Assume-Yes "true"; }; };
詳しくは man apt.conf を参照。
指定できる主な項目は
古いパッケージのキャッシュを自動で削除する
APT::Clean-Installed "true"
すべての質問に自動で YES と答える
APT::Get::Assume-Yes "true"
すべての質問に自動で NO と答える
APT::Get::Trivial-Only "true"
存在しないパッケージが指定されていても処理を続行する
APT::Get::Fix-Missing "true"
アンインストール時に設定ファイルも削除する
APT::Get::Purge "true"
処理の対象になっているパッケージのバージョンも表示する
APT::Get::Show-Versions "true"
ダウンロードのみでインストールしない
APT::Get::Download-Only "true"
処理の途中で失敗しても処理を続行する
APT::Get::Fix-Broken "true"
パッケージを削除できなくする
APT::Get::No-Remove "true"
詳しくは man apt-get を参照。
dpkg コマンドでわかります。
$ dpkg -l
ページャなどに出力すると読み易いです
$ dpkg -l | pager
$ dpkg -L (パッケージ名)
$ which (コマンド名) $ dpkg -S (コマンド名) | grep -w (コマンドのフルパス)
例: ls の場合
$ which ls /bin/ls $ dpkg -S ls | grep -w /bin/ls fileutils: /bin/ls
で fileutils だとわかる。
また dlocate を使う事でもできます。
# apt-get install dlocate $ dlocate (コマンド名やファイル名)
必要であれば grep 等を併用する
パッケージをインストールして即 dlocate のデータベースに反映させたい場合や、cron での一日一回のアップデートに反映されていない場合
# update-dlocatedb
をする。
# apt-get install auto-apt # auto-apt update $ auto-apt search (コマンドやファイル名) $ auto-apt search (コマンド名) | grep -w (コマンドのフルパスの頭から"/"を取ったもの)
$ dpkg -c (パッケージファイル名)
アプリやライブラリなどのファイルを取り出したい場合は
$ dpkg -x (パッケージファイル名) (展開するディレクトリ)
postinst や postrm などの制御ファイルを取り出したい場合は
$ dpkg -e (パッケージファイル名) (展開するディレクトリ)
もしくは (binutils が必要)
$ ar x (パッケージファイル名) $ tar xvfz data.tar.gz
# apt-get install (パッケージ名)=(バージョン)
例:
# apt-get install apache=1.3.26-0woody3
もしくは
# apt-get -t (リリースバージョン) (パッケージ名)
例:
# apt-get -t unstable apache
# echo (パッケージ名) hold | dpkg --set-selections
例
# echo jnethack hold | dpkg --set-selections
オススメは pin を使った方法。 /etc/apt/preferences に留めておきたいパッケージ名とバージョンを
Package: (パッケージ名) Pin: version (バージョン) Pin-Priority: (プライオリティ)
例
Package: jnethack Pin: version 1.1.5-11 Pin-Priority: 1001
のように書いておく。
/etc/apt/apt.conf.d/99target に
APT::Default-Release "stable";
と書く。(デフォルトで sarge を使う場合は testing;sid なら unstable)
/etc/apt/sources.list には sarge や sid の apt-line も入れておく。
$ sudo apt-get install (パッケージ名)
で woody のパッケージが入る。sarge/sid から借りる場合はそれぞれ
$ sudo apt-get install (パッケージ名)/testing $ sudo apt-get install (パッケージ名)/unstable
! ただし stable な環境などで libc6 のパッケージも依存関係でアップデートされる場合、 安易に (Y) を選ぶと大変なことになるのでよく考えてから。 いつの間にかなんちゃって unstable な環境とかになってしまいます。
上記の /etc/apt/apt.conf.d/99target を作るかわりに、/etc/apt/preferences へ
Package: * Pin: release a=testing Pin-Priority: 105 Package: * Pin: release a=testing-proposed-updates Pin-Priority: 110 Package: * Pin: release a=unstable Pin-Priority: 90
と書く。リリース間は空行で分離する。こちらを用いることの利点は、
参考
http://debian.dtdns.net/2ch-debian/1033049225/52.html
man 5 apt_preferences
sid や sarge のソースパッケージの apt-line (deb-src で始まるやつ )を sources.list に書いて apt-get update しておく。そしてパッケージ生成に必要な、fakeroot、devscripts パッケージを入れておく。 murasaki の sid 版を使いたい場合は、
$ mkdir ~/src/murasaki ←作業ディレクトリを掘る $ ^mkdir^cd ←そのディレクトリに移動 $ apt-get source murasaki ←ソースパッケージを取得
これで勝手にソースが展開されるので、展開されたディレクトリに移動する。
$ cd ./murasaki-X.X.X
そしてリビルドを開始する。
$ debuild -rfakeroot -uc -us
何々がねーぞとエラーがでる場合は、apt-get build-dep murasaki してから debuild を実行する。 終ったら 一つ上のディレクトリにパッケージが出来てるので、dpkg -iでインストールする。
例えば testing を使っているけど一部 sid から借りている場合
$ apt-show-versions | grep unstable
apt-show-versions を使うと便利です。たとえば stable 環境で apache のバージョンを知りたければ
$ apt-show-versions -p apache apache/stable uptodate 1.3.26-0woody3
といった感じに出力されます。testing/unstable のバージョンも知りたければ、
$ apt-show-versions -a -p apache apache 1.3.26-0woody3 install ok installed apache 1.3.26-0woody3 stable No proposed-updates version apache 1.3.26-1.1 testing apache 1.3.27-0.1 unstable apache/stable uptodate 1.3.26-0woody3
のように出力されます。
どのパッケージに依存しているのか調べるには
$ apt-cache depends (パッケージ名)
どのパッケージに依存されているのか調べるには
$ apt-cache showpkg (パッケージ名)
環境変数 COLUMNS を大きな値 (200 とか) に設定してみてください。
例: COLUMNS=200 dpkg -l
alias に登録しておくという手もあります。
alias dpkg='COLUMNS=${COLUMNS:-80} dpkg'
sources.list にたくさん書きすぎです。apt-line を減らすか、/etc/apt/apt.conf に
APT::Cache-Limit "100000000";
などと書いておくといい。
man apt.conf 参照。
おそらくHTTP 1.1を解さないproxyのせいです。debian-user@Orgでの Jason Gunthorpe氏の投稿 を要約すると
の2通りの方法があるようです。
deb を置いたディレクトリで dpkg-scanpackages
$ dpkg-scanpackages ./ /dev/null | gzip -c9 > Packages.gz
でもいいけど
$ apt-ftparchive packages . | gzip -c9 > Packages.gz $ apt-ftparchive sources . | gzip -c9 > Sources.gz
の方がムトゥ神推奨。apt-ftparchive は apt-utils パッケージに入っている。
次に sources.list に
deb file:(ディレクトリ) ./
例: deb file:/usr/src/ ./
を追加して、apt-get update して apt-get install (パッケージ) で完了。
参考: /usr/share/doc/apt/offline.html
synaptic や gnome-apt、kpackage などがあります。
cron-apt を使いましょう。
ただしデフォルトではダウンロードのみされるように設定されてます。
/etc/cron-apt/action.d/3-download の upgrade から "-d" オプションを取り除けば upgrade されます。
本当に知らぬ間に自動で upgrade されるので結構危険です。
stable でセキュリティ fix のみするような用途以外にはオススメしません。
apt-listchangesを入れましょう。 アップグレードされるパッケージの変更点を表示してくれます。