Differences between revisions 11 and 12
Revision 11 as of 2009-03-16 03:31:20
Size: 1615
Editor: anonymous
Comment: converted to 1.6 markup
Revision 12 as of 2009-10-27 09:48:50
Size: 1670
Editor: MichelBarret
Comment: Add comment to specify a codename release as default distribution
Deletions are marked like this. Additions are marked like this.
Line 24: Line 24:
An example that sets default release to testing: An example that sets default release to testing (you can also specify a codename as lenny or squeeze) :

?AptDirectory


/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:

 /var/cache/apt/archives/gnome_2.10.1.1_all.deb

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):

 Acquire::ftp
 {
   Proxy "ftp://proxy:2121/";
   ProxyLogin
   {
      "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;
Apt::Get::Purge;
//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";