Wednesday, May 1, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 686  / 1 Year ago, wed, november 16, 2022, 4:46:49

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

More From » apt

 Answers
6

I don't know if this is the proper solution, but trying different pinning configurations, I end up made it working like this:



create the file /etc/apt/preferences.d/xcp-xapi with the following contents:



Package: xcp-networkd
Pin: release n=precise
Pin-Priority: -1

Package: xcp-v6d
Pin: release n=precise
Pin-Priority: -1

Package: xcp-xapi
Pin: release n=precise
Pin-Priority: -1

Package: xcp-xapi-debug
Pin: release n=precise
Pin-Priority: -1


From what I understand, giving it a negative priority to the specific package from the specific repository means do not bother for this package, thus keep the current version installed. If someone can explain further or provide a "more correct" solution, I would appreciate it. Thank you!


[#30539] Friday, November 18, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
anatta

Total Points: 326
Total Questions: 128
Total Answers: 96

Location: Jordan
Member since Sun, Jun 26, 2022
2 Years ago
;