[Techtalk] Question about apt (sort of) conflict

Wim De Smet kromagg at gmail.com
Sun Mar 18 09:24:14 UTC 2012


Hey,

On Sun, Mar 18, 2012 at 1:43 AM, Terry <tech at futurecourse.com> wrote:
> Hi,
>
> Moved from CentOS to Debian a couple of months ago so am learning about
> apt.  Is there a way to tell apt to ignore a particular package in a
> particular repository?  I did this with yum in CentOS but many Google
> searches later, I can't figure out how to do it with apt.  I've looked
> at pinning but the docs are confusing and as best I can tell, that only
> lets you hold a specific version of a package.

I had some trouble finding it, so not sure if you were looking at the
right manpage. Pinning is explained in apt_preferences(5).

> The issue is this: I added the MariaDB repo to my sources.list and
> installed.  A new version was released and I updated.  All fine so far.
>  I later needed to install some packages from dotdeb.org's repo, so I
> added that to my sources.list and installed what I needed.
> Again, everything fine.
>
> When MariaDB put out its latest stable release, apt held back
> mysql-common.  I finally figured out why - the installed package is from
> MariaDB.  Dotdeb.org says it has the latest update instead of the
> package from MariaDB.  Once I figured out why it was being held back, I
> commented out the dotdeb.org entry in my sources list, upgraded
> mysql-common and then re-enabled the dotdeb.org entry. However, apt
> still shows that mysql-common is being held back when I do an apt-get
> dist-upgrade.  I thought apt handled that kind of thing for you - if I
> install xyz from this repo then apt will look for xyz in that repo.
>
> What I'd ideally like is to have the dotdeb.org repo ignore
> mysql-common.  Or is this a matter of me just commenting out dotdeb when
> I need to upgrade mysql-common?

Not sure if this will fix the problem, but you can pin on origin.
Something like this (in an appropiate file in
/etc/apt/preferences.d/):

Package: mysql*
Pin: origin "dotdeb.org"
Pin-Priority: 1

You might have to fiddle with the hostname (copy it over from your
sources.list), but the key thing is using the "origin" keyword.

HTH,
Wim


More information about the Techtalk mailing list