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
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
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.
dpkg-scanpackages
in fedora, but why to do that, just put this repo on some of clients with ubuntu! you need to install updates and dependencies periodically, how could you do that in fedora!! it's better to do it on some ubuntu client
– Maythux
Jul 16 '15 at 09:01
man dpkg-scanpackages
– Maythux
Jul 16 '15 at 11:55