str[bits]

April 11, 2005

Building a Local Debian Repository

Filed under: Debian

You want to build a local package repository for your LAN to share?

A local repository is useful if you have many users sharing a low-bandwidth Internet connection; your Debian systems can grab packages from the local repository, rather than going out over the network.

How?

Use apt-proxy:
# apt-get install apt-proxy
apt-proxy starts up automatically after installation.

Next, edit the add_backend/debian/ section of /etc/apt-proxy/apt-proxy.conf so that it points to geographically close package mirrors. (See http://www.debian.org/mirror/list for a list of package mirrors.)

Now edit /etc/apt/sources.list on the client machines to point to the apt-proxy server. The default port is 9999:
deb http://ip-or-hostname:9999

Run apt-get update on the client machines, and you’re in business. Every time a client machine on your LAN installs a new program, it will be cached on the apt-proxy server. Subsequent requests for the same package will be served by the local cache. Very cool!

Maintaining the Debian Package Cache

Filed under: Debian

You want to keep your package cache and package lists tidy and up-to-date, so that apt will work correctly and not encounter bogus dependency problems?

Use apt and dpkg.

Remember to run apt-get update after making changes to /etc/apt/sources.list, and run it periodically to keep package lists current.

To look for downloaded, uninstalled packages, use:
$ dpkg —yet-to-unpack

To check for broken dependencies, use:
# apt-get check

To remove cached packages that are no longer needed, use:
# apt-cache autoclean

To remove all cached packages, use:
# apt-cache clean

To show partially installed packages, use:
$ dpkg —audit

Your package cache can easily consume tens, or even hundreds, of megabytes. See for yourself in /var/cache/apt/archives. To conserve storage space, set up a local package cache for your network.

Upgrading to a Newer Debian Release

Filed under: Debian

For example you want to upgrade to a newer release; for example, from Woody to Sarge.

First, edit /etc/apt/sources.list so that it has only Sarge entries. Then do the following:
# apt-get update
# apt-get -u upgrade
# apt-get -u dist-upgrade

The -u flag lets you review the changes first. Depending on the speed of your Internet connection and how many packages are required, this can take up to several hours.






















Get free blog up and running in minutes with Blogsome | Theme designs available here