Apt-mirror: differenze tra le versioni

Da PNLUG.
(Prerequisiti)
(File esempio)
Riga 50: Riga 50:
 
############# end config ##############
 
############# end config ##############
  
#deb http://ftp.us.debian.org/debian unstable main contrib non-free
+
#deb http://ftp.us.debian.org/debian stable main contrib non-free                       #da usare in combinata con set defaultarch  <running host architecture>
#deb-src http://ftp.us.debian.org/debian unstable main contrib non-free
+
#deb-src http://ftp.us.debian.org/debian stable main contrib non-free                   #per maggiore flessibilità ho preferito esplicitare la versione
  
 
# mirror additional architectures
 
# mirror additional architectures
#deb-alpha http://ftp.us.debian.org/debian unstable main contrib non-free
+
#deb-alpha http://ftp.us.debian.org/debian stable main contrib non-free
#deb-amd64 http://ftp.us.debian.org/debian unstable main contrib non-free
+
#deb-amd64 http://ftp.us.debian.org/debian stable main contrib non-free
 
                                                                                           #Potete scegliere il repo che preferite, nell'architettura desiderata.
 
                                                                                           #Potete scegliere il repo che preferite, nell'architettura desiderata.
 
deb-amd64 http://ftp.us.debian.org/debian stable main contrib non-free                    #repo stable debian
 
deb-amd64 http://ftp.us.debian.org/debian stable main contrib non-free                    #repo stable debian
 
deb-amd64 http://ftp.us.debian.org/debian stable-updates main contrib non-free            #repo stable updates debian
 
deb-amd64 http://ftp.us.debian.org/debian stable-updates main contrib non-free            #repo stable updates debian
 
deb-amd64 http://security.debian.org/ stable/updates main contrib non-free                #repo security  
 
deb-amd64 http://security.debian.org/ stable/updates main contrib non-free                #repo security  
 +
                                                                                         
  
 
+
#deb-armel http://ftp.us.debian.org/debian stable main contrib non-free
#deb-armel http://ftp.us.debian.org/debian unstable main contrib non-free
+
#deb-hppa http://ftp.us.debian.org/debian stable main contrib non-free
#deb-hppa http://ftp.us.debian.org/debian unstable main contrib non-free
+
#deb-i386 http://ftp.us.debian.org/debian stable main contrib non-free
#deb-i386 http://ftp.us.debian.org/debian unstable main contrib non-free
+
#deb-ia64 http://ftp.us.debian.org/debian stable main contrib non-free
#deb-ia64 http://ftp.us.debian.org/debian unstable main contrib non-free
+
#deb-m68k http://ftp.us.debian.org/debian stable main contrib non-free
#deb-m68k http://ftp.us.debian.org/debian unstable main contrib non-free
+
#deb-mips http://ftp.us.debian.org/debian stable main contrib non-free
#deb-mips http://ftp.us.debian.org/debian unstable main contrib non-free
+
#deb-mipsel http://ftp.us.debian.org/debian stable main contrib non-free
#deb-mipsel http://ftp.us.debian.org/debian unstable main contrib non-free
+
#deb-powerpc http://ftp.us.debian.org/debian stable main contrib non-free
#deb-powerpc http://ftp.us.debian.org/debian unstable main contrib non-free
+
#deb-s390 http://ftp.us.debian.org/debian stable main contrib non-free
#deb-s390 http://ftp.us.debian.org/debian unstable main contrib non-free
+
#deb-sparc http://ftp.us.debian.org/debian stable main contrib non-free
#deb-sparc http://ftp.us.debian.org/debian unstable main contrib non-free
+
  
 
## Ubuntu trusty (14.04)
 
## Ubuntu trusty (14.04)

Versione delle 15:50, 6 apr 2016

Mirror dei Repository

Spesso, durante i nostri install party, la banda è condivisa su molte stazioni di lavoro. questo comporta tempi di update e install delle distro piuttosto lunghi.

Una prima soluzione potrebbe essere un proxy cache che funziona bene come tecnica ma necessita di una banda funzionante alla prima richiesta dei pacchetti.

Una seconda soluzione, per un completa installazione off line è la completa replica dei repository della distro in in container locale. L'idea è di avere spazio disco, copiare in locale tutti i pacchetti della distro per poterli utilizzare off line.

apt-mirror

Lo strumento apt-mirror è sviluppato appositamente per questo tipo d'esigenza : clonare un repository. Un interessante articolo ne propone l'utilizzo assieme ad un FTP Server, vedremo in una seconda fase come utilizzare tale server.

Prerequisiti

Purtroppo sono necessari circa 60 GB per repository per architettura.

Ad esempio se intendete preparare un repo per amd64 e i386 dovrete prevedere circa 120 GB di spazio.

Installazione

# apt-get install apt-mirror

Configurazione

# nano /etc/apt/mirror.list

File esempio

Per costruire un mirror Ubuntu e Debian ho utilizzato il seguente esempio :

############# config ##################                                                 #Notes by Roby.deb
#
#set base_path    /var/spool/apt-mirror
set base_path /opt/apt-mirror                                                           #percorso dove salvare il clone del 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 ##############

#deb http://ftp.us.debian.org/debian stable main contrib non-free                        #da usare in combinata con set defaultarch  <running host architecture>
#deb-src http://ftp.us.debian.org/debian stable main contrib non-free                    #per maggiore flessibilità ho preferito esplicitare la versione

# mirror additional architectures
#deb-alpha http://ftp.us.debian.org/debian stable main contrib non-free
#deb-amd64 http://ftp.us.debian.org/debian stable main contrib non-free
                                                                                          #Potete scegliere il repo che preferite, nell'architettura desiderata.
deb-amd64 http://ftp.us.debian.org/debian stable main contrib non-free                    #repo stable debian
deb-amd64 http://ftp.us.debian.org/debian stable-updates main contrib non-free            #repo stable updates debian
deb-amd64 http://security.debian.org/ stable/updates main contrib non-free                #repo security 
                                                                                          

#deb-armel http://ftp.us.debian.org/debian stable main contrib non-free
#deb-hppa http://ftp.us.debian.org/debian stable main contrib non-free
#deb-i386 http://ftp.us.debian.org/debian stable main contrib non-free
#deb-ia64 http://ftp.us.debian.org/debian stable main contrib non-free
#deb-m68k http://ftp.us.debian.org/debian stable main contrib non-free
#deb-mips http://ftp.us.debian.org/debian stable main contrib non-free
#deb-mipsel http://ftp.us.debian.org/debian stable main contrib non-free
#deb-powerpc http://ftp.us.debian.org/debian stable main contrib non-free
#deb-s390 http://ftp.us.debian.org/debian stable main contrib non-free
#deb-sparc http://ftp.us.debian.org/debian stable main contrib non-free

## Ubuntu trusty (14.04)
deb-amd64 http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse            #repo main ubuntu
deb-amd64 http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse   #repo security ubuntu
deb-amd64 http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse    #repo updates ubuntu


clean http://ftp.us.debian.org/debian
clean http://archive.ubuntu.com/ubuntu

Avvio apt-mirror

Link

https://apt-mirror.github.io/
http://www.tecmint.com/setup-local-repositories-in-ubuntu/
https://wiki.debian.org/SourcesList
https://www.howtoforge.com/local_debian_ubuntu_mirror
https://www.packtpub.com/books/content/create-local-ubuntu-repository-using-apt-mirror-and-apt-cacher