apt preferences pinning

Posted on Fri 21 February 2014 in note

將 debian stable 加入 testing 但是只在需要安裝 testing 套件的時候才安裝。

  1. /etc/apt/sources.list 加入 testing
  2. /etc/apt/preferences.d/ 建立 testing 檔案。內容如下
Package: *
Pin: release a=testing
Pin-Priority: 200

這樣就可以在 aptitude 中選擇 testing 的套件。或是用 apt-get -t testing install <package> or aptitude -t testing 來指定安裝 testing 套件。