Apt-Mirror mit Ubuntu 20.04

FIXME

apt install apt-mirror apache2
rm /var/www/html/index.html
mkdir /package-mirror/tmp
chown apt-mirror:apt-mirror /package-mirror/tmp
nano /usr/bin/apt-mirror
...
- if ( $filename =~ m{^$component/dep11/(Components-${arch}\.yml|icons-[^./]+\.tar)\.gz$} )
+ if ( $filename =~ m{^$component/dep11/(Components-${arch}\.yml|icons-(.*)++\.tar)\.gz$} )
- $uri =~ s/^([^@]+)?@?// if $uri =~ /@/;
...
nano /usr/local/bin/apt-mirror-executes
apt-mirror-executes
#!/bin/bash
 
apt-mirror
 
 
/package-mirror/var/clean.sh
 
 
cd /package-mirror/mirror/apt.puppetlabs.com
wget -nH -np --recursive http://apt.puppetlabs.com/dists/focal/puppet6/binary-all/
wget -nH -np --recursive http://apt.puppetlabs.com/dists/buster/puppet6/binary-all/
 
cd /package-mirror/mirror/archive.neon.kde.org
wget -nH -np --recursive http://origin.archive.neon.kde.org/user/dists/focal/main/binary-all/
 
cd  /package-mirror/mirror/security.debian.org/dists/buster/updates/main/
mkdir i18n
cd i18n
wget  http://security.debian.org/debian-security/dists/buster/updates/main/i18n/Translation-en.xz
 
 
#cd /package-mirror/mirror/archive.ubuntu.com/ubuntu/dists/focal-security
cd /package-mirror/mirror/archive.ubuntu.com
wget -nH -np --recursive http://archive.ubuntu.com/ubuntu/dists/focal-security/main/cnf/
wget -nH -np --recursive http://archive.ubuntu.com/ubuntu/dists/focal-security/multiverse/cnf/
wget -nH -np --recursive http://archive.ubuntu.com/ubuntu/dists/focal-security/restricted/cnf/
wget -nH -np --recursive http://archive.ubuntu.com/ubuntu/dists/focal-security/universe/cnf/
 
wget -nH -np --recursive http://archive.ubuntu.com/ubuntu/dists/focal/main/cnf/
wget -nH -np --recursive http://archive.ubuntu.com/ubuntu/dists/focal/multiverse/cnf/
wget -nH -np --recursive http://archive.ubuntu.com/ubuntu/dists/focal/restricted/cnf/
wget -nH -np --recursive http://archive.ubuntu.com/ubuntu/dists/focal/universe/cnf/
 
wget -nH -np --recursive http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/cnf/
wget -nH -np --recursive http://archive.ubuntu.com/ubuntu/dists/focal-updates/multiverse/cnf/
wget -nH -np --recursive http://archive.ubuntu.com/ubuntu/dists/focal-updates/restricted/cnf/
wget -nH -np --recursive http://archive.ubuntu.com/ubuntu/dists/focal-updates/universe/cnf/
chmod +x /usr/local/bin/apt-mirror-executes
nano /etc/apt/mirror.list
mirror.list
############# config ##################
#
# set base_path    /var/spool/apt-mirror
set base_path    /package-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 limit_rate 200K
set nthreads     20
set _tilde 0
#
############# end config ##############
 
#Ubuntu 20.04 Quellen
deb-amd64 http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
deb-amd64 http://archive.ubuntu.com/ubuntu focal-security main restricted universe multiverse
deb-amd64 http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
deb-i386 http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
deb-i386 http://archive.ubuntu.com/ubuntu focal-security main restricted universe multiverse
deb-i386 http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
 
#PPA's
deb http://ppa.launchpad.net/heyarje/makemkv-beta/ubuntu focal main
deb http://ppa.launchpad.net/papirus/papirus/ubuntu focal main
deb http://ppa.launchpad.net/ubuntuhandbook1/avidemux/ubuntu focal main
deb http://ppa.launchpad.net/univention-dev/ppa/ubuntu focal main
 
 
# Debian
deb http://ftp.at.debian.org/debian buster main contrib
deb http://ftp.at.debian.org/debian buster-updates main contrib
deb http://security.debian.org buster/updates main contrib
 
 
 
#KDE-Neon
deb-amd64 http://archive.neon.kde.org/user focal main
#deb http://archive.neon.kde.org/user focal main
#deb-src http://archive.neon.kde.org/user focal main
 
 
 
#Sonstige Quellen
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
deb http://apt.iteas.at/iteas focal main
#deb http://liveusb.info/multisystem/depot all main
deb-amd64 http://apt.puppetlabs.com focal puppet6
deb-amd64 http://apt.puppetlabs.com buster puppet6
deb https://linux.teamviewer.com/deb stable main
#deb [arch=amd64] http://packages.microsoft.com/repos/code stable main
#deb http://www.benno-mailarchiv.de/download/debian /
 
 
 
# Putzscripte
clean http://ftp.at.debian.org/
clean http://security.debian.org/
clean http://archive.ubuntu.com/
clean http://ppa.launchpad.net/
clean http://archive.neon.kde.org/
clean https://linux.teamviewer.com/
clean http://apt.puppetlabs.com/
clean http://apt.iteas.at/
clean http://dl.google.com/
sudo -u apt-mirror /usr/local/bin/apt-mirror-executes
ln -s /package-mirror/mirror/ftp.at.debian.org /var/www/html/debian-buster
ln -s /package-mirror/mirror/ppa.launchpad.net /var/www/html/ppa
ln -s /package-mirror/mirror/linux.teamviewer.com /var/www/html/teamviewer
ln -s /package-mirror/mirror/apt.puppetlabs.com /var/www/html/puppet
ln -s /package-mirror/mirror/security.debian.org /var/www/html/debian-buster-security
ln -s /package-mirror/mirror/dl.google.com /var/www/html/google-chrome
ln -s /package-mirror/mirror/archive.ubuntu.com /var/www/html/ubuntu
ln -s /package-mirror/mirror/archive.neon.kde.org /var/www/html/kde-neon
ln -s /package-mirror/mirror/apt.iteas.at /var/www/html/iteas

Cron erstellen - jeden 1ten im Monat

nano /etc/cron.d/apt-mirror
#
# Regular cron jobs for the apt-mirror package
#
0 4 1 * *       apt-mirror     /usr/local/bin/apt-mirror-executes > /var/spool/apt-mirror/var/cron.log