Local APT Repository: Part 2

Final Steps on Server

What we did in part 1 was to sync the repository. Now we need to make sure that our APT Server can serve the files for use by client machines.

For this purpose, you can either choose to export the filesystem using NFS, or using Samba. I chose NFS. In the server’s /etc/exports:

THE_PATH_WHERE_YOU_SAVED (ro,all_squash,anonuid=65534,anongid=65534)

Please make sure that you have nfs-user-server installed, and run /etc/init.d/nfs-user-server restart

Mounting on Client Machines

Now, we need to configure the machines that are going to use this repository. On the machine’s /etc/fstab put in this line:

NAME_OR_IP_OF_APTSERVER:THE_PATH_WHERE_YOU_SAVED /mnt/debian-apt nfs defaults 0 0

Don’t forget to:

# mkdir /mnt/debian-apt

To mount it:

# mount /mnt/debian-apt

Next, we need to reconfigure your APT by editing /etc/apt/sources.list:

deb file:/mnt/debian-apt/ stable main contrib non-free

*If you like, you can also put in lines for your apt to use the testing or unstable dists.

Updating APT on Client Machines

To test:

# apt-get update

Don’t worry if not much info is displayed. The next time you want to upgrade or install packages, you should see that it needs to download 0B of packages, looks something like this:

2 upgraded, 6 newly installed, 0 to remove and 467 not upgraded.
Need to get 0B/2399kB of archives.

***Don’t forget to change the variables written using UPPERCASE above to the values corresponding to your installations!

Good luck! 😉

0 Shares