I have a package installed (xcp-xapi) which is prone to a bug. The fix is very simple (only a couple of lines in the code) so what I do is the following:
apt-get source xcp-xapi
Then I find the source file to apply the fix and then I run again
apt-get -b source xcp-xapi
This will produce some .deb files that I install using
dpkg -i *.deb
Now the problem is that every time I try to run an apt-get upgrade, apt tries to fetch the packages from the repositories. I guess this can be fixed using pinning, but I cannot find the proper configuration to put in high priority the packages I compiled on my own.
So the question is how can I configure pinning to put the following already installed packages on higher priority than any existing in the repositories?
# apt-cache policy xcp-networkd xcp-v6d xcp-xapi xcp-xapi-debug
xcp-networkd:
Installed: 1.3.2-5ubuntu0.1
Candidate: 1.3.2-5ubuntu0.1
Version table:
1.3.2-5ubuntu0.1 0
500 http://ftp.uninett.no/ubuntu/ precise-updates/universe amd64 Packages
500 http://security.ubuntu.com/ubuntu/ precise-security/universe amd64 Packages
*** 1.3.2-5ubuntu0.1 0
100 /var/lib/dpkg/status
1.3.2-5 0
500 http://ftp.uninett.no/ubuntu/ precise/universe amd64 Packages
xcp-v6d:
Installed: 1.3.2-5ubuntu0.1
Candidate: 1.3.2-5ubuntu0.1
Version table:
1.3.2-5ubuntu0.1 0
500 http://ftp.uninett.no/ubuntu/ precise-updates/universe amd64 Packages
500 http://security.ubuntu.com/ubuntu/ precise-security/universe amd64 Packages
*** 1.3.2-5ubuntu0.1 0
100 /var/lib/dpkg/status
1.3.2-5 0
500 http://ftp.uninett.no/ubuntu/ precise/universe amd64 Packages
xcp-xapi:
Installed: 1.3.2-5ubuntu0.1
Candidate: 1.3.2-5ubuntu0.1
Version table:
1.3.2-5ubuntu0.1 0
500 http://ftp.uninett.no/ubuntu/ precise-updates/universe amd64 Packages
500 http://security.ubuntu.com/ubuntu/ precise-security/universe amd64 Packages
*** 1.3.2-5ubuntu0.1 0
100 /var/lib/dpkg/status
1.3.2-5 0
500 http://ftp.uninett.no/ubuntu/ precise/universe amd64 Packages
xcp-xapi-debug:
Installed: 1.3.2-5ubuntu0.1
Candidate: 1.3.2-5ubuntu0.1
Version table:
1.3.2-5ubuntu0.1 0
500 http://ftp.uninett.no/ubuntu/ precise-updates/universe amd64 Packages
500 http://security.ubuntu.com/ubuntu/ precise-security/universe amd64 Packages
*** 1.3.2-5ubuntu0.1 0
100 /var/lib/dpkg/status
1.3.2-5 0
500 http://ftp.uninett.no/ubuntu/ precise/universe amd64 Packages