The officially official Devuan Forum!

You are not logged in.

#1 2024-02-23 15:49:40

From: UK
Registered: 2023-01-19
Posts: 203  

[SOLVED] How to assign apt priority to cdrom repository.

There's plenty of results online on how to change priority of a local repository, but my searches turned up nothing for how to do it regarding packages on a "cdrom" (actually a DVD ISO).

In the end it was relatively simple: identify the origin by checking the policy output, e.g: apt-cache policy | egrep -C1 'origin|cdrom'

# apt-cache policy | egrep -C1 'origin|cdrom'
 500 cdrom://[Devuan GNU/Linux 4.0 chimaera amd64 - desktop 20211012] chimaera/main amd64 Packages
     release c=main,b=amd64
     origin Devuan GNU/Linux 4.0 chimaera amd64 - desktop 20211012

Then create a file in /etc/apt/preferences.d directory (or edit /etc/apt/preferences file), such as:

Explanation: cdrom
Package: *
Pin: origin "Devuan GNU/Linux 4.0 chimaera amd64 - desktop 20211012"
Pin-Priority: 600

The double quotes are optional, but it must be double or nothing (single quotes do not work).
The Explanation line is a comment, so can contain a brief description of what/why.

See man apt_preferences for filename rules, then jump to "How APT Interprets Priorities" for an explanation of priority numbers.

Note that there's a difference between the origin of a repository, and a package's "Origin" value; (the latter would use Pin: release o=Debian or Pin: release o=Devuan).



Board footer