There are two ways:
- Pinning -> this is more a permanent solution, you can remix it into something adhoc and it's detailed at the end.
- 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.