Translation(s): Italiano - Português Brasileiro


ToDo: /etc/apt/conf file no longer exists (at least in testing), the configuration is now modular and the topic should be extended
specifically we are talking here about /etc/apt/apt.conf.d/70debconf file

/etc/apt/conf file

Debconf configuration is initiated with following line. There is no need to add it, as it is already there by default, it is shown here only as an example. The command in brackets could be any arbitrary command to be executed in shell.

 Dpkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";};

There are also options

 Dpkg::Pre-Invoke {"command";};
 Dpkg::Post-Invoke {"command";};

They execute commands before/after apt calls dpkg. One thing to note is that with Pre-Install-Pkgs deb package path is passed on to stdin from apt, eg. when installing package gnome the following is stdin of called command:


An example that sets default release to testing (you can also specify a codename as lenny or squeeze) :

 APT::Default-Release "testing";

You can use this example for HTTP proxy:

 Acquire::http::Proxy "http://proxy:8080";

And this one for FTP proxy (NOTE: Only change proxy hostname and port):

   Proxy "ftp://proxy:2121/";
      "USER $(SITE_USER)@$(SITE)";
      "PASS $(SITE_PASS)";

Here is a whole example apt.conf file using stable:

APT::Default-Release "stable";
APT::Cache-Limit 10000000;
//comment begins with //
//had problems with running MMap runs out of room, so add cache-limit//
APT::Cache-Limit "25165824";
//Server down takes too long, add timout
Acquire::http::Timeout "2";
Acquire::ftp::Timeout "2";