7/31/2019 Creating Local Repository
http://slidepdf.com/reader/full/creating-local-repository 1/12
CREATING LOCALREPOSITORY
By:- Ahmed E & Biniam T
7/31/2019 Creating Local Repository
http://slidepdf.com/reader/full/creating-local-repository 2/12
Why Local Repository ?
Safe Band width
once an updated package is downloaded froman official repository, all other machines willdownload it from a local server.
Time /fast
Uses the maximum speed(bandwidth) of theLAN
7/31/2019 Creating Local Repository
http://slidepdf.com/reader/full/creating-local-repository 3/12
7/31/2019 Creating Local Repository
http://slidepdf.com/reader/full/creating-local-repository 4/12
How to configure
Mirroring (apt-mirror)
- a mirror is an exact copy of a data set
- provide multiple sources of the sameinformation
- providing reliable access to large downloads.
Cacher (apt-cacher)
-Fetch packages that we actually use and cachethem for future requests.
7/31/2019 Creating Local Repository
http://slidepdf.com/reader/full/creating-local-repository 5/12
Problems with apt-mirror
It uses up a lot of space, most of it for packageswe will never use
It needs just as much space for every additionalarchitecture or release of Ubuntu/Debian
Because we don't use majority of the packagesapt-mirror downloads, more bandwidth is wastedthan necessary
It is necessary to modify apt's sources file to force
clients to use apt-mirror, this becomes moredifficult when some clients use differentrepositories.
Requires installation of a separate web server
7/31/2019 Creating Local Repository
http://slidepdf.com/reader/full/creating-local-repository 6/12
Why apt-cahcher
It uses fraction of the space, especially sincecache is automatically cleansed of old packagesthat are no longer requested
It downloads each package only once, thusreducing bandwidth consumption
It reduces download time .
Makes it easier to configure clients: instead of
changing repository URLs we only change theaddress of the proxy
Single package install, no additional web serverneeded
Minimal server side configuration
7/31/2019 Creating Local Repository
http://slidepdf.com/reader/full/creating-local-repository 7/12
How to
1,installing apt-cacher
sudo apt-get install apt-cacher
2, Configuring apt-cacher
- open /etc/apt-cacher/apt-cacher.conf
- Activate Apt-Cacher:
open /etc/default/apt-cacher ,Set AUTOSTART = 1
- Restart Apt-Cacher:
sudo /etc/init.d/apt-cacher restart
7/31/2019 Creating Local Repository
http://slidepdf.com/reader/full/creating-local-repository 8/12
contd…
Setting up the LAN clients - edit the file /etc/apt/sources.list on every computer on thenetwork then update.
sudo apt-get update
Automatically update systems every day Create a file called auto-update.sh in /usr/bin:
sudo touch /usr/bin/auto-update.sh
Example to executed every day at 14:30 add
30 14 * * * /usr/bin/auto_update.sh > /dev/null
7/31/2019 Creating Local Repository
http://slidepdf.com/reader/full/creating-local-repository 9/12
Contd…
Generating reports
- Set the generate_reports directive to 1 in
/etc/apt-cacher/apt-cacher.conf.
- Check out the reports at:
http://local.machine.running.apt-cache:3142/report
http://10.0.0.156:3142/report
7/31/2019 Creating Local Repository
http://slidepdf.com/reader/full/creating-local-repository 10/12
Keeping the files on a local harddisk
Go to /var/cache/apt/archives and copy yourdebian packages to a folder of your choice, forexample,
/home/<username>/repository/ /home/ahmed/repository/
cd ~/repository
and generate a Packages.gz file like this:sudo dpkg-scanpackages . /dev/null | gzip -9c >
Packages.gz
N.B: Make sure build-essential is installed (sudo
aptitude install build-essential) before you run the
7/31/2019 Creating Local Repository
http://slidepdf.com/reader/full/creating-local-repository 11/12
Contd…
Add the following line to your sources.list file(/etc/apt/sources.list)
deb file:/home/<username>/repository/ /
Reload your package index like this:
sudo apt-get update
7/31/2019 Creating Local Repository
http://slidepdf.com/reader/full/creating-local-repository 12/12
This is it !
Thanks