Sep 122006
 

Sponsored Link

apt-mirror is a small tool that provides ability to mirror any parts (or even all) of Debian GNU/Linux distribution or any other apt sources which often provided by many debian developers.

If you want to download apt-mirror click here

Installing apt-mirror in Debian

add to ‘sources.list' line i.e /etc/apt/sources.list file

deb http://apt-mirror.sourceforge.net/ apt-mirror/ and run

# apt-get update

# apt-get install apt-mirror

Configuring sources for apt-mirror

Open ‘mirror.list' (from /etc/apt/ or whatever you installed it to) and add needed sources like in /etc/apt/sources.list. Finally your mirror.list may looks like this:

# apt-mirror configuration file

##
## The default configuration options (uncomment and change to override)
##
#
# set base_path /var/spool/apt-mirror
# set mirror_path $base_path/mirror
# set skel_path $base_path/skel
# set var_path $base_path/var
#
# set defaultarch
# set nthreads 20
#

##
## Example sources
##

# sarge's section
deb http://ftp.us.debian.org/debian sarge main contrib non-free
deb-src http://ftp.us.debian.org/debian sarge main contrib non-free

# this source required for network installation ability (udebs)
deb http://ftp.us.debian.org/debian sarge main/debian-installer

# security updates is always good thing to install
deb http://security.debian.org/debian-security sarge/updates main contrib non-free
deb-src http://security.debian.org/debian-security sarge/updates main contrib non-free

# sarge-proposed-updates's section
deb http://ftp.us.debian.org/debian sarge-proposed-updates main contrib non-free
deb-src http://ftp.us.debian.org/debian sarge-proposed-updates main contrib non-free

##
## Cleaner configuration example
##
#
# set cleanscript $var_path/clean.sh
#

# What directories should we clean up
# (i.e. remove files missing in up-to-date indexes)
clean http://security.debian.org/
clean http://ftp.us.debian.org/

# But exclude this directories
# (which is not managed by apt and apt-mirror)
skip-clean http://ftp.us.debian.org/debian-cd/
skip-clean http://ftp.us.debian.org/debian/dists/sarge/main/installer-i386/
skip-clean http://ftp.us.debian.org/debian/doc/
skip-clean http://ftp.us.debian.org/debian/tools/
skip-clean http://ftp.us.debian.org/debian/project/

Running apt-mirror

Now we may run ‘apt-mirror'

# su -- apt-mirror -c apt-mirror

You also can run apt-mirror from cron. Uncomment line in /etc/cron.d/apt-mirror for this purpose.

Sponsored Link

 Posted by at 3:32 pm

  4 Responses to “Debian apt Source mirror using apt-mirror”

  1. Have you tested this yourself? because # su – apt-mirror -c apt-mirror does not work. You get a ‘apt-mirror: invalid config file specified at /usr/bin/apt-mirror line 101.’

    The correct command is apt-mirror /etc/apt/mirror.list

  2. Thanks Fred, sudo apt-mirror /etc/apt/mirror.list works correctly.

  3. Had the same syntax error on the command.

    Thanks

  4. sudo su – apt-mirror -c apt-mirror

    This is what I use.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>