Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
15
rated 0 times [  15] [ 0]  / answers: 1 / hits: 10806  / 2 Years ago, tue, august 9, 2022, 6:22:34

I'm trying to figure out how to assign higher priority to one PPA over another PPA. I had a look on bunch of the answers on this forum but none of them solves my problem.



We have two PPA sources on some of our servers which we stick into separate files in /etc/apt/sources.list.d . Some of these repos provide same packages (in terms of names) but different versions and possibly different binaries. Is there a way how we can PRIORITISE one repo over another ?



I read apt_preferences tutorial but it could not be more obscure and didn't find the answers for my question. Here is the situation. WE have the following sources:



$ ls -l /etc/apt/sources.list.d 
total 12
-rw-r--r-- 1 root root 66 Jan 2 16:50 nginx-source.list
-rw-r--r-- 1 root root 84 Jan 2 16:49 ruby-ng-experimental-source.list


where nginx-source.list content is:



deb     http://ppa.launchpad.net/nginx/stable/ubuntu precise main


and ruby-ng-experimental-source.list content is:



deb     http://ppa.launchpad.net/brightbox/ruby-ng-experimental/ubuntu precise main


Both of these sources provide nginx-full package of different versions etc.
When I list the priorities ruby-ng-experimental-source.list is on top of output hence nginx-full is installed from that repo:



$ apt-cache policy nginx-full                                 
nginx-full:
Installed: 1:1.2.3-1~38~precise1
Candidate: 1:1.2.6-1~43~precise1
Version table:
1:1.2.6-1~43~precise1 0
500 http://ppa.launchpad.net/brightbox/ruby-ng-experimental/ubuntu/ precise/main amd64 Packages
*** 1:1.2.3-1~38~precise1 0
100 /var/lib/dpkg/status
1.4.1-1ppa0~precise 0
500 http://ppa.launchpad.net/nginx/stable/ubuntu/ precise/main amd64 Packages
1.1.19-1ubuntu0.1 0
500 http://mirror.rackspace.co.uk/ubuntu/ precise-updates/universe amd64 Packages
1.1.19-1 0
500 http://mirror.rackspace.co.uk/ubuntu/ precise/universe amd64 Packages


How do I prioritize repo listed in nginx-source.list over the one which is on top of the list now ? I tried something like this:



$ cat /etc/apt/preferences
Package: nginx-full
Pin: origin http://ppa.launchpad.net/nginx/stable/ubuntu
Pin-Priority: 1000

Package: nginx-full
Pin: origin http://ppa.launchpad.net/brightbox/ruby-ng-experimental/ubuntu
Pin-Priority: 100


But that has changed priorities of both sources to the same number - or something like that ? So this has NOT changed the priorities and nginx-full is still being installed form the brightbox PPA



$ apt-cache policy nginx-full  
nginx-full:
Installed: 1:1.2.3-1~38~precise1
Candidate: 1:1.2.6-1~43~precise1
Package pin: (not found)
Version table:
1:1.2.6-1~43~precise1 1000
500 http://ppa.launchpad.net/brightbox/ruby-ng-experimental/ubuntu/ precise/main amd64 Packages
*** 1:1.2.3-1~38~precise1 1000
100 /var/lib/dpkg/status
1.4.1-1ppa0~precise 1000
500 http://ppa.launchpad.net/nginx/stable/ubuntu/ precise/main amd64 Packages
1.1.19-1ubuntu0.1 1000
500 http://mirror.rackspace.co.uk/ubuntu/ precise-updates/universe amd64 Packages
1.1.19-1 1000
500 http://mirror.rackspace.co.uk/ubuntu/ precise/universe amd64 Packages


Anyone has any idea how to achieve what I'm trying to do ?


More From » apt

 Answers
4

Here is an example of /etc/apt/preferences



mint@mint ~ $ cat /etc/apt/preferences
Package: *
Pin: release o=linuxmint
Pin-Priority: 700

Package: *
Pin: origin packages.linuxmint.com
Pin-Priority: 700

Package: *
Pin: release o=Ubuntu
Pin-Priority: 500


You probably have to run apt-get update after creating the file.


[#31268] Thursday, August 11, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ugeeport

Total Points: 181
Total Questions: 108
Total Answers: 99

Location: El Salvador
Member since Tue, Jun 29, 2021
3 Years ago
ugeeport questions
;