2

How to build custom repository server so that all client install packages from my machine.

what type of URL to add in /etc/apt/sources.list file on Client Machine. to fetch that particular package

muru
  • 197,895
  • 55
  • 485
  • 740

1 Answers1

5

Installing apache :

sudo apt-get install apache2

Creating needed directories

Create a directory inside the webroot /var/www/

let's say name it repo.

sudo mkdir /var/www/repo

Now under repo you should create a directory for each architecture you want to use if you want more than one architecture.

For here i'll use amd64 for my 64bit systems. So, let's create this directory:

sudo mkdir /var/www/repo/amd64

Creating Packages.gz file

use the command dpkg-scanpackages

cd /var/www/repo/
sudo dpkg-scanpackages amd64 | gzip -9c > amd64/Packages.gz

Add the new repo

sudo -H gedit /etc/apt/sources.list.d/custom-repo.list

then add the line:

deb http://Your_Systme_IP/repo/ amd64/

Finally, update sources list:

sudo apt-get update

Now whenever you try to install any app, if you have its debs in your local repo then you install from it else then going to install from Internet.

muru
  • 197,895
  • 55
  • 485
  • 740
Maythux
  • 84,289