Apt-mirror setup local ubuntu package repository

Posted by Jerzy Seweryn on

Server setup


[code lang="shell"]
sudo apt-get install apache2
sudo apt-get install apt-mirror
sudo vim /etc/apt/mirror.list
deb http://archive.ubuntu.com/ubuntu karmic main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
sudo apt-mirror
sudo vim /etc/cron.d/apt-mirror
0 4 * * * apt-mirror /usr/bin/apt-mirror > /var/spool/apt-mirror/var/cron.log
#daily 04:00 AM
sudo ln -s /var/spool/apt-mirror/mirror/archive.ubuntu.com/ubuntu/ /var/www/ubuntu
[/code]

Client setup


[code lang="shell"]
sudo vim /etc/apt/source.list
deb http://192.168.1.3/ubuntu karmic main restricted universe multiverse
deb http://192.168.1.3/ubuntu karmic-updates main restricted universe multiverse
deb http://192.168.1.3/ubuntu karmic-security main restricted universe multiverse
sudo links http://192.168.1.3/ubuntu
[/code]