and happy new year to you all..
Recently I've built nginx deb package v1.4.4 from debian backport source that of course I've added to the apt sources.list and things went great.
I have run apt-get update
then apt-get -V upgrade
today to check how debian 7 apt would behave.. and this is what I got:
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]?
As you can see, apt is trying to upgrade from (1.4.4-1~bpo70+1 => 1.4.4-1~bpo70+1), which is basically two identical version but my installed deb package has custom nginx modules added to default nginx-full and after the update, my custom modules are all gone and replaced by the standard debian wheezy backport deb.. I've built my nginx backport deb package from debian backport source and installed build-deb through the backport as well but some dependencies installed automatically from the stable that's what I saw from the verbose output..
Can you please help me to prevent this with an example? I heard about pinning, but is it the answer to my problem?
UPDATE
I've tried to apt pin the package and didn't work and here is the output i got:
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
And the following is the apt-cache policy nginx:
/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
But still apt is trying to upgrade and replace it!!
Sources.list content:
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
I've tried to apt pin once the package name 'nginx' and another time with nginx-full..
But both fail to hold the package!!!
apt-cache policy nginx-full
. This should not happen if backports are set to a low priority. I thought they were. I set the backports to 50 myself. Ok, checking the backports page, it saysAll backports are deactivated by default (i.e. the packages are pinned to 100 by using ButAutomaticUpgrades: yes in the Release files.
I guess this is to make sure that if you are using backports, that they are automatically upgraded if a new version is available. One option is to up the version as others have suggested, the other is to pin at a lower priority.