Nothing Special   »   [go: up one dir, main page]

Creating Local Repository

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 12

CREATING LOCAL REPOSITORY

By:- Ahmed E & Biniam T

Why Local Repository ?

Safe Band width once an updated package is downloaded from an official repository, all other machines will download it from a local server.

Time /fast Uses the maximum speed(bandwidth) of the LAN

How to configure
Mirroring (apt-mirror) - a mirror is an exact copy of a data set - provide multiple sources of the same information - providing reliable access to large downloads.

Cacher (apt-cacher) -Fetch packages that we actually use and cache them for future requests.

Problems with apt-mirror

It uses up a lot of space, most of it for packages we will never use It needs just as much space for every additional architecture or release of Ubuntu/Debian Because we don't use majority of the packages apt-mirror downloads, more bandwidth is wasted than necessary It is necessary to modify apt's sources file to force clients to use apt-mirror, this becomes more difficult when some clients use different repositories. Requires installation of a separate web server

Why apt-cahcher

It uses fraction of the space, especially since cache is automatically cleansed of old packages that are no longer requested It downloads each package only once, thus reducing bandwidth consumption It reduces download time . Makes it easier to configure clients: instead of changing repository URLs we only change the address of the proxy Single package install, no additional web server needed Minimal server side configuration

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/aptcacher ,Set AUTOSTART = 1 - Restart Apt-Cacher: sudo /etc/init.d/apt-cacher restart

contd

Setting up the LAN clients - edit the file /etc/apt/sources.list on every computer on the network 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

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.aptcache:3142/report http://10.0.0.156:3142/report

Keeping the files on a local hard disk


Go to /var/cache/apt/archives and copy your debian packages to a folder of your choice, for example, /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

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

This is it !

Thanks

You might also like