
嗨,祝大家新年快樂..
最近,我從 debian backport 來源建立了 nginx deb 套件 v1.4.4,當然我已經將其添加到 aptsources.list 中,一切進展順利。
我的問題:debian 會自動更新我親自從官方來源建立的軟體包嗎?我的意思是更新安全性。
更新:
apt-get update
我今天跑來apt-get -V upgrade
檢查 debian 7 apt 的行為..這就是我得到的:
root@debian-lab:~/nginx-1.4.4-packages# apt-get -V upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
nginx-full (1.4.4-1~bpo70+1 => 1.4.4-1~bpo70+1)
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/464 kB of archives.
After this operation, 9,027 kB disk space will be freed.
Do you want to continue [Y/n]?
如您所見,apt 正在嘗試從(1.4.4-1~bpo70+1 => 1.4.4-1~bpo70+1),這基本上是兩個相同的版本,但我安裝的deb 套件將自訂nginx 模組新增到預設的nginx-full 中,更新後,我的自訂模組全部消失,並被標準的debian wheezy backport deb取代。
您能幫我舉個例子來防止這種情況嗎?
更新
我嘗試過 apt pin 包但沒有成功,這是我得到的輸出:
apt-cache policy nginx-full
nginx-full:
Installed: 1.4.4-1~bpo70+1
Candidate: 1.4.4-1~bpo70+1
Version table:
1.4.4-1~bpo70+1 0
100 http://ftp.uk.debian.org/debian/ wheezy-backports/main amd64 Packages
*** 1.4.4-1~bpo70+1 0
100 /var/lib/dpkg/status
1.2.1-2.2+wheezy2 0
500 http://ftp.uk.debian.org/debian/ wheezy/main amd64 Packages
500 http://security.debian.org/ wheezy/updates/main amd64 Packages
以下是 nginx 的 apt-cache 策略:
/etc/apt/preferences.d# apt-cache policy nginx
nginx:
Installed: 1.4.4-1~bpo70+1
Candidate: 1.4.4-1~bpo70+1
Package pin: 1.4.4-1~bpo70+1
Version table:
*** 1.4.4-1~bpo70+1 1001
100 http://ftp.uk.debian.org/debian/ wheezy-backports/main amd64 Packages
100 /var/lib/dpkg/status
1.2.1-2.2+wheezy2 1001
500 http://ftp.uk.debian.org/debian/ wheezy/main amd64 Packages
500 http://security.debian.org/ wheezy/updates/main amd64 Packages
但apt仍然在嘗試升級和替換它!
Sources.list內容:
deb http://ftp.uk.debian.org/debian/ wheezy main
deb-src http://ftp.uk.debian.org/debian/ wheezy main
deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main
# wheezy-updates, previously known as 'volatile'
deb http://ftp.uk.debian.org/debian/ wheezy-updates main
deb-src http://ftp.uk.debian.org/debian/ wheezy-updates main
# Wheezy Backports repository
deb http://ftp.uk.debian.org/debian wheezy-backports main
deb-src http://ftp.uk.debian.org/debian wheezy-backports main
我嘗試過一次使用 apt pin 套件名稱“nginx”,另一次使用 nginx-full ..
但兩個人都拿不住包裹!
答案1
我建議您升級軟體包的版本。 APT 知道這兩個軟體包不相同,並嘗試從可信任來源安裝軟體包。dch -i
這就是您所需要的,只需添加一些簡短的描述並重建包即可。
您也可以以不同的方式固定封裝:
Package: nginx-full
Pin: origin ""
Pin-Priority: 999
這將為本地安裝的軟體包提供更高的優先權。
如果儲存庫版本字串取代目前安裝的版本且您沒有任何固定和某些版本已發布,是的,如果您有正確的來源,apt 將從儲存庫安裝軟體包(希望帶有已應用的修補程式)。
答案2
如果您固定該軟體包,apt-get 將不會嘗試升級它。
要固定包,請在 /etc/apt/preferences.d 中建立一個文件,例如 /etc/apt/preferences.d/nginx
將其放入文件中:
Package: nginx
Pin: version 1.4.4-1~bpo70+1
Pin-Priority: 1001