Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I used to do something similar with yum on CentOS. I think there was a --enable-repo and --disable-repo param.

Is there something that exists for apt-get install <some pkg> that will restrict to /etc/apt/sources.list.d/<somefile>?

share|improve this question
add comment

2 Answers 2

You can do that by pinning the release using /etc/apt/preferences. The man page is apt_preferences. Format is as follows:

 Package: *
 Pin: release o=Debian,a=testing
 Pin-Priority: 900
share|improve this answer
add comment

I don't believe you can do that quickly and easily without a wrapper around apt-get to juggle the sources manually.

One option however is to suffix the package you wish to install with the version number required, which will likely be different in each source.

e.g.

apt-get install cowsay=3.03-9.2
share|improve this answer
    
You can also check the versions and what would be installed using apt-cache policy cowsay - then use the resulting version, etc. to specify the package specifically. –  Mei Jun 30 '11 at 13:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.