[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debian-users:50198] 特定パッケージのインストールを抑制したい



こんばんは。吉田@板橋です。

debianのapt関連に詳しい方に質問があります。

実現したいこと
 Debian で、apt-get や aptitude から特定のパッケージがインストールされ
るのを禁止する方法はありますか?

例
rakeのapt-get(aptitude)からのインストールを止めたい。
1.A さん
・rake を使うので rubygems からインストールしよう
・rubygems の実行ファイルはパスが通ってないから、自分でパスを通そう

2.B さん
・rake を使おう
・rake が実行できない(パスが通ってない)ので、apt-get しよう

3.結果
・2 つのバージョンの rake の混在

回避策の案
ダミーのパッケージを(作って)インストールし、それをpinで止める。


詳細
私の参加しているLUGで先日出た質問です。

私もいくつかの設定で追試してみたりしたのですが、
結局、わかりませんでした。

man 5 apt_preferencesやhttp://wiki.debian.org/AptPinning
には
   How APT Interprets Priorities
       Priorities (P) assigned in the APT preferences file must be positive or negative integers. They are
       interpreted as follows (roughly speaking):
(中略)
       P < 0
          prevents the version from being installed

という記述があるのですが、

Pin-Priority:をマイナスにしても、明示的に指定すると
インストールできるのが実態(仕様?)のようです。
http://peace-pact-2007.blogspot.com/2007/08/apt.html

$ cat /etc/apt/preferences
Package: rake
Pin: release a=stable
Pin-Priority: -10
$ sudo apt-get install rake
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
  rake
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/109kB of archives.
After unpacking 938kB of additional disk space will be used.
Selecting previously deselected package rake.
(Reading database ... 40127 files and directories currently installed.)
Unpacking rake (from .../archives/rake_0.7.1-1_all.deb) ...
Setting up rake (0.7.1-1) ...

以上よろしくお願いします。
-------------------------------
吉田