O pacote
apt-mirror por padrão usa o diretório /var/spool/apt-mirror para criar o espelho, aqui na minha empresa eu criei no momento do particionamento uma partição separada, /pacotes, aonde armazenei o espelho. Para fazer essa alteração temos que editar o arquivo e alterar as seguintes linhas.
# vim /etc/apt/mirror.list
############# config ##################
#
# set base_path /var/spool/apt-mirror
#
# if you change the base path you must create the directories below with write
# privileges
#
# set mirror_path $base_path/mirror
# set skel_path $base_path/skel
# set var_path $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch <running host architecture>
set nthreads 20
set _tilde 0
#
############# end config ##############
############# config ##################
#
set base_path /pacotes/ubuntu/repositorio
#
# if you change the base path you must create the directories below with write
# privileges
#
set mirror_path $base_path/mirror
set skel_path $base_path/skel
set var_path $base_path/var
set cleanscript $var_path/clean.sh
# set defaultarch <running host architecture>
set nthreads 20
set _tilde 0
#
############# end config ##############
Após a alteração é necessário criar os diretórios onde serão colocados os pacotes:
# mkdir -p /pacotes/ubuntu/repositorio/mirror
# mkdir -p /pacotes/ubuntu/repositorio/skel
# mkdir -p /pacotes/ubuntu/repositorio/var
Agora falta apenas copiar o script de limpeza para o novo diretório:
# cp /var/spool/apt-mirror/var/clean.sh /pacotes/ubuntu/repositorio/var
Agora, para finalizar, falta dizermos para o apt-mirror quais os repositórios que serão baixados, então voltemos ao arquivo
mirror.list.
# vim /etc/apt/mirror.list
Por padrão esses serão os espelhos a serem baixados:
deb http://archive.ubuntu.com/ubuntu jaunty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu jaunty-updates main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu jaunty-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu jaunty-security main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu jaunty-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu jaunty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu jaunty-updates main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu jaunty-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu jaunty-security main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu jaunty-proposed main restricted universe multiverse
clean http://archive.ubuntu.com/ubuntu
Se você desejar habilitar os repositórios backports e proposed, descomente as linhas comentadas. No meu caso, fiz os repositórios para os pacotes 32-bit por causa da arquitetura dos clientes, mas nada impede que você use para outra arquitetura, basta você adicionar ao final das configurações as seguintes linhas:
deb http://archive.ubuntu.com/ubuntu jaunty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu jaunty-updates main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu jaunty-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu jaunty-security main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu jaunty-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu jaunty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu jaunty-updates main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu jaunty-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu jaunty-security main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu jaunty-proposed main restricted universe multiverse
# 64 Bit
deb-i686 http://archive.ubuntu.com/ubuntu jaunty main restricted universe multiverse
deb-i686 http://archive.ubuntu.com/ubuntu jaunty-updates main restricted universe multiverse
#deb-i686 http://archive.ubuntu.com/ubuntu jaunty-backports main restricted universe multiverse
deb-i686 http://archive.ubuntu.com/ubuntu jaunty-security main restricted universe multiverse
#deb-i686 http://archive.ubuntu.com/ubuntu jaunty-proposed main restricted universe multiverse
deb-i686-src http://archive.ubuntu.com/ubuntu jaunty main restricted universe multiverse
deb-i686-src http://archive.ubuntu.com/ubuntu jaunty-updates main restricted universe multiverse
#deb-src-src http://archive.ubuntu.com/ubuntu jaunty-backports main restricted universe multiverse
deb-i686-src http://archive.ubuntu.com/ubuntu jaunty-security main restricted universe multiverse
#deb-i686-src http://archive.ubuntu.com/ubuntu jaunty-proposed main restricted universe multiverse
clean http://archive.ubuntu.com/ubuntu