apt doesn't respect repository order or pin preference
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: apt
10.04
Purpose: I want to set up a repository which will contain a custom-built version of a standard Ubuntu package. I want this repository to be preferred over the official Ubuntu mirror for my machines.
Observations:
According to "man sources.list": the most preferred source should be listed first. However, the order in sources.list and ordering-
Also, pinning via preferences using the origin should cause my repository to be preferred. However, it has no effect.
This is with apt 0.7.25.3ubuntu7 on Ubuntu 10.04.
Contents of sources.list:
deb http://
deb http://
Contents of preferences:
Package: *
Pin: origin 192.168.0.2
Pin-Priority: 999
It appears that the first repositories shown by "apt-cache policy" is the one used from which the package is installed. Example output when broken:
apt-cache policy libcap2
libcap2:
Installed: 1:2.17-2ubuntu-1
Candidate: 1:2.17-2ubuntu-1
Version table:
*** 1:2.17-2ubuntu1 0
500 http://
999 http://
100 /var/lib/
Sometimes it works. I see the "999" line above the "500" line in the "apt-cache policy" output when it uses the package in my repository.
I used apt-build to build the version of the package in my repository on 192.168.0.2. I can see which build is installed by the date on /lib/libcap.so.2.17
I add this lines to my preferences file to get the local apt-build source have the priority:
Package: *
Pin: release o=apt-build
Pin-Priority: 990
Package: *
Pin: release o=lucid
Pin-Priority: 100
I use apt-build to build bind9, here is the output of apt-cache policy:
braiam@ braiam- desktop: ~$ apt-cache policy bind9 cache/apt- build/repositor y/ stable/main Packages cache/apt- build/repositor y/ apt-build/main Packages dpkg/status 9.7.0.dfsg. P1-1 0 do.archive. ubuntu. com/ubuntu/ lucid/main Packages braiam- desktop: ~$
bind9:
Instalados: 1:9.7.0.dfsg.P1-1
Candidato: 1:9.7.0.dfsg.P1-1
Tabla de versión:
*** 1:9.7.0.dfsg.P1-1 0
500 file:/var/
500 file:/var/
100 /var/lib/
1:
500 http://
braiam@
You have to modify depending of your requirements.