[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: regex in apt preferences



On Tue, 8 May 2018 00:30:31 +0000 (UTC) David Griffith said:

> Through trial and error, I found that these worked in this order:
> 
> Package: libsystemd0
> Pin: release *
> Pin-Priority: 500
> 
> Package: *systemd*
> Pin: release *
> Pin-Priority: -1
> 
> In the order as you describe, EVERYTHING matching *systemd* was blocked, 
> with no allowance for libsystemd0.

Oh yes, you're right, sorry for misleading. My error was in that I counted
*systemd* as a wildcard (with lower precedence to specific form) while in fact
only "*" is treated as wildcard by apt. So *systemd*, being a specific-form
record, got precedence over the next line with libsystemd0.

Rechecked with apt_preferences(5) man page and indeed it says:

"The first specific-form record matching an available package version
determines the priority of the package version. Failing that, the priority of
the package is defined as the maximum of all priorities defined by generic-form
records matching the version. Records defined using patterns in the Pin field
other than "*" are treated like specific-form records."

> When I followed your suggestion, I got this:
>  	0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
> I have no clue what package is "not upgraded".  Reversing the order of the 
> pins did nothing.

I don't know which tool you are using, but I think apt-get should point out
which package will not be upgraded and why.

BTW you don't need to really attempt an upgrade to see what happens. The
"-s" (simulate, or dry-run) option of apt can be helpful here. And it doesn't
need root privileges as it is not intrusive.

Regards
-- 
Abdullah Ramazanoğlu


Reply to: