星期五, 5月 06, 2011

Apt-Pinning

Debian套件 優先權 混用 stable, unstable, testing
有時候我們想在debian stable系統使用一部份unstable或testing的套件, 例如:想使用更新的驅動程式

基本上參考這個教學就好囉, (套件來源我都用http://ftp.twaren.net/debian的)
http://crunchbanglinux.org/forums/topic/12081/apt-pinning-and-you-living-on-the-edge-with/

舉例:
先用apt-cache policy nvidia-kernel-dkms 查看一下
會發現有個數字500在前面, 那個是stable的優先權

幾個步驟
1. 新增unstable或testing 來源 (編輯/etc/apt/sources.list), 我只有新增unstable來源

2. 編輯或新增/etc/apt/preferences, 設定unstable或testing優先權, 數字要低於500 (優先度低於stable的意思)
有的數字代表特殊意義, 更詳細的參考閱讀之
http://crunchbanglinux.org/forums/post/120442/#p120442

3. apt-get update

4. 要注意以下兩種安裝unstable套件方法的差異, 跟系統穩定性有關
4-1. sudo apt-get install 套件名稱/unstable
這個會使用該套件stable的相關依賴, 如果安裝失敗會告訴你為什麼

4-2. sudo apt-get -t unstable 套件名稱
這個會使用該套件unstable的相關依賴, 會升級相關依賴到unstable, 這個安裝方式對系統比較危險
---
(通常還是會用-t的方式, 為了要成功安裝起來用...)

沒有留言 :