1

In Debian, the dvd source contains packages that may not be already installed on the system. When these get updated, the dvd contains the outdated package.

And when we try apt-get install outdated-package-name, it always tries to download and install the package. Is there any way that I can tell apt-get to install from the local source even when it is outdated? I don't want to remove the http sources.

I'm only using this for testing purposes and security isn't a major issue.

2

By default, apt installs the version of the package with the largest version number. You can use APT preferences (wiki) to override this. APT preferences let you configure priorities for package versions based on the package name, the version number, and the source from which the package is installed.

By default, a package source has a priority of 500. If you reduce the priority to 100, then packages from that source will not be installed automatically unless it is necessary to satisfy a dependency. If you reduce the priority to 1, then packages from that source will never be installed unless you explicitly request that version or that source.

Create a file in /etc/apt/preferences.d and declare packages whose origin is the Debian mirror you use (and security.debian.org, if you don't want security updates) as having priority 100 (or 1, depending on how badly you want to avoid downloading packages). For example, if you update from ftp.iitm.ac.in (i.e. if you have lines beginning with deb ftp://ftp.iitm.ac.in/ in /etc/apt/sources.list):

Package: *
Pin: origin "ftp.iitm.ac.in"
Pin-Priority: 100
0

What you're asking about is configurable in /etc/apt/preferences, as mentioned here:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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