Skip to content

Instantly share code, notes, and snippets.

@ross-newman
Last active July 18, 2019 12:18
Show Gist options
  • Save ross-newman/9b3282bb118a583ac2187b8d957f8225 to your computer and use it in GitHub Desktop.
Save ross-newman/9b3282bb118a583ac2187b8d957f8225 to your computer and use it in GitHub Desktop.
UK apt mirrors list example for LTS releases
############# config ##################
#
# 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 cleanscript $var_path/clean.sh
# set defaultarch <running host architecture>
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads 20
set _tilde 0
#
############# end config ##############
## Xenial 18.04
deb-amd64 http://www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu/ bionic main universe restricted
deb-arm64 http://ports.ubuntu.com/ubuntu-ports/ bionic main universe restricted
#deb-armhf http://ports.ubuntu.com/ubuntu-ports/ bionic main universe restricted
#deb-src http://www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu/ bionic main
## Xenial 16.04
deb-i386 http://www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu/ xenial main universe
deb-amd64 http://www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu/ xenial main universe
deb-arm64 http://ports.ubuntu.com/ubuntu-ports/ xenial main universe
#deb-armhf http://ports.ubuntu.com/ubuntu-ports/ xenial main universe
#deb-src http://www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu/ xenial main
## Trusty 14.04
deb-i386 http://www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu/ trusty main universe
deb-amd64 http://www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu/ trusty main universe
#deb-src http://www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu/ trusty main
## Precice 12.04
#deb-i386 http://www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu/ precise main universe
deb-amd64 http://www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu/ precise main universe
#deb-src http://www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu/ precise main
## Raspberian
deb-armhf http://archive.raspbian.org/raspbian buster main contrib non-free
@ross-newman
Copy link
Author

ross-newman commented Jul 5, 2019

Get the mirror tool

   sudo apt install apt-mirror

Update /etc/apt/mirror.list example above of choose your own mirrors list https://repogen.simplylinux.ch/
Run as the apt-mirror user:

sudo apt-mirror

Install apache2 webserver to make files available over your local network.

sudo apt install apache2

Then configure apache2

sudo echo '<VirtualHost *:80>
    ServerAdmin webmaster@hostname.com

    DocumentRoot /var/www
        <Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>' | sudo tee /etc/apache2/sites-enabled/000-default.conf

Add a symbolic link to your apache2 root dir (my archives were downloaded here /var/spool/apt-mirror/mirror/www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu):

sudo chown -R www-data:www-data </path/to/ubuntu>
sudo ln -s </path/to/ubuntu> /var/www/ubuntu
sudo chown www-data:www-data /var/www/ubuntu

Restart apache2 with updated settings

sudo rm -rf /var/www/html
sudo service apache2 restart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment