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
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
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
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.