0

Sometimes a package I want from a PPA has the same name as a different package in another repository. Is there a way I can tell apt to download a package of packageName from a certain repo?

I'd prefer to just use apt, but I suppose aptitude or some other tool would work okay. The simpler the better.

Seth
  • 59,332

1 Answers1

0

There are two ways:

  1. Pinning -> this is more a permanent solution, you can remix it into something adhoc and it's detailed at the end.
  2. Using aweso... err aptitude!

Using aptitude

Lets say the package is from some origin, lets call this ppa.launchpad.net. So, how to tell aptitude to install the package form that origin:

sudo aptitude install '?narrow(nameofthepackage, ?origin(ppa.launchpad.net))'

You can change narrow for and. Also, you can use other selectors like version string, etc.

A complete reference of all the features of aptitude here:


Using pinning.

This requires that you write the preference file before hand and you should add pretty options arguments:

You must write your pinning file:

Package: somepackage
Pin: origin ppa.launchpad.net
Pin-Priority: 1000

Now with apt-get:

sudo apt-get install -o Dir::Etc::Preferences=/path/to/pinningFile somepackage

Done.

Braiam
  • 69,112