Take the 2-minute tour ×

How do I limit the updates that are installed to those from a specific set of repositories? Is this at all possible?

share|improve this question
Do you want to be able to specify repo during runtime, or should be it be more a static thing? The two answers below assume the latter option. –  Tshepang Feb 21 '11 at 12:50
Ideally it would be during runtime. The static option is sufficient though. –  Ton van den Heuvel Feb 22 '11 at 8:11
add comment

4 Answers

up vote 13 down vote accepted

You can specify a repository with -t option. As an example, I have added the following repository to /etc/apt/sources.list to install Iceweasel latest release:


As you know there is a same package iceweasel in the official Debian repository. If I want install Iceweasel from this specific repo I run:

apt-get install -t squeeze-backports iceweasel

from apt-get manual page:

           This option controls the default input to the policy engine, it creates a default pin at priority 990 using the specified
           the value of this option. In short, this option lets you have simple control over which distribution packages will be retrieved
           from. Some common examples might be -t '2.1*', -t unstable or -t sid. Configuration Item: APT::Default-Release; see also the
           apt_preferences(5) manual page.

I think this is a better solution,

share|improve this answer
As you see in the apt-get manual, -t specify release not repository name. There is no repository name in Ubuntu (unlike RedHat based linux such as RHEL,Fedora,CentOS, ...) –  SuB Sep 20 '13 at 17:31
@SuB Yes, you're right! I confused repository name with release! –  cartoonist Sep 21 '13 at 15:19
add comment

A gui based alternative would be to open software centre and select edit > software sources...

Software Sources with Ubuntu software tab selected

Software Sources with other software tab selected

all you need to do is un-tick the repositories you don't want updates from.

Hope this helps

share|improve this answer
add comment

Obvious choice is to modify /etc/apt/sources.list and comment out all other repositories, and then run

apt-get update && apt-get upgrade && apt-get autoclean

And then remove comments from sources.list. Maybe not the best way, but at least apt-get man pages do not specify any way to do that.

On related note, for example Ubuntu distribution upgrade process disables all 3rd party repositories during upgrade (and do not just run some option to exclude those temporarily).

share|improve this answer
add comment

You can disable automatic updates from certain repositories without entirely removing them via apt policies:

To disable automatic updates from repository repo, add add a file /etc/apt/preferences.d/repo with the following content:

Package: *
Pin: release n=repo
Pin-Priority: 50

Which will give all packages from this repository a lower priority than already installed packages (which have 100).

For more information man apt_preferences or check the Ubuntu Community Wiki.

share|improve this answer
It’s a shame the only apt_preferences answer is the last... –  Robert Siemer Jan 25 at 9:22
add comment

Your Answer


