making local repository for apt and synaptic

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

making local repository for apt and synaptic

Postby turfcutter » Sat Dec 01, 2012 4:15 pm

How do I make a local repository for apt and synaptic on Xubuntu? My old copy of "Linux Cookbook" gives a simple procedure using apt-proxy but that seems not to be available anymore (at least I cannot find it with Synaptic). I have tried googling but most of the answers assume that I want to mirror the entire Ubuntu repositories when all I want is to keep a cache of installed software on one machine so that when the other computers in the house receive updates they get them from the local cache rather than download them again from the internet. This must be quite a common requirement so I am surprised that it is so difficult to find the solution.
turfcutter
 
Posts: 11
Joined: Sun Nov 04, 2007 3:46 pm
Location: Utrecht, Holland

Postby bobthebob1234 » Sat Dec 01, 2012 6:05 pm

Google apt-cacher-ng

basically
1. apt-get install apt-cacher-ng
2. configure all computers to use computer you just installed apt-cacher-ng as proxy (realllllly simple)
3. Done :)

This basically.

Pretty sure it was in the mag once upon a time to.

Anyways hope that helps :)


This also tells you about the pretty dashboard.
For certain you have to be lost to find the places that can't be found. Elseways, everyone would know where it was
User avatar
bobthebob1234
LXF regular
 
Posts: 1373
Joined: Thu Jan 03, 2008 9:38 pm
Location: A hole in a field

Postby turfcutter » Mon Dec 03, 2012 12:39 pm

Thanks for the tip. I installed apt-cacher-ng but the instructions on the link you gave seem very complicated to me. For instance I puzzled for two days over the beginning of step 2, “# search & replace 192.168.1.100 by the IP of the machine that will act as apt-cacher-ng server”, until I finally realized that it refers to the following instructions and not to any config files on my machine. Okay, you didn't realise you were trying to help an idiot. I think these instructions might be easier to follow if they just said “change file so-and-so” to include “such-and-such” instead of this geeksprach with pipes, tees and logical ORs. I am reluctant to just copy and paste them into a terminal because I don't understand them and the page seems to be about 4 years old so I have googled for other sites that might confirm them

This link, http://acidborg.wordpress.com/2010/06/2 ... ver-10-04/, looks a lot simpler but it is has some configuration details for /etc/apt-cacher-ng/acng.conf. I looked at this file and most of these are already included except for the PidFile setting which is commented out. Also it says I have to restart apt-cacher-ng but it doesn't say that I have to put the line Acquire::http { Proxy "http://your-apt-cacher-ng-server:3142"; }; on the server machine as well. The link you gave me says nothing about restarting apt-cacher-ng but it does say that I should do the configuration on the server as well as the clients.

I wonder if you would mind clarifying this, bearing in mind that I get confused if you show me two shovels and tell me to take my pick.
turfcutter
 
Posts: 11
Joined: Sun Nov 04, 2007 3:46 pm
Location: Utrecht, Holland

Postby Dutch_Master » Mon Dec 03, 2012 1:19 pm

Bookmark these pages:

http://ss64.com/bash/
http://tldp.org/

The latter has some outdated documents, others may still be valid. Cross-reference the info with the man-page of the command.
Dutch_Master
LXF regular
 
Posts: 2451
Joined: Tue Mar 27, 2007 1:49 am

Postby bobthebob1234 » Mon Dec 03, 2012 1:21 pm

Just looked at my acng.conf, I haven't touched my conf at all to be honest. You need to restart apt-cacher-ng if you change the conf, otherwise it won't use any new or changed settings. If you haven't changed anything you don't need to restart it, however restarting it won't harm it in any way.

I have put
Code: Select all
Acquire::http { Proxy "http://your-apt-cacher-ng-server:3142"; };


on all my machines on the network. If you don't put it on your server it just means that your server won't be using you proxy, so for instance if you have 2 machines, 1 is the server, 1 is another client, and only the client is using the proxy and you update a package, that package will still get downloaded twice, once on the server, once on the client. If you add another client and tell it to use the proxy it won't download the package from the internet again, it will get it from the proxy as the other client has already downloaded it.

I think the point I'm trying to make is that I have configured my server to use itself as a proxy and had no problems so far.

So in summary if you do step 1 & 4 on http://acidborg.wordpress.com/2010/06/2 ... ver-10-04/ , you should be fine.
For certain you have to be lost to find the places that can't be found. Elseways, everyone would know where it was
User avatar
bobthebob1234
LXF regular
 
Posts: 1373
Joined: Thu Jan 03, 2008 9:38 pm
Location: A hole in a field

Postby bobthebob1234 » Mon Dec 03, 2012 1:25 pm

Opps sorry can't read, I have commented out the Acquire::http.... on my server, so it seems that did cause a problem. :oops:

So follow step 1 & 4 on that link exactly and you should be fine!
For certain you have to be lost to find the places that can't be found. Elseways, everyone would know where it was
User avatar
bobthebob1234
LXF regular
 
Posts: 1373
Joined: Thu Jan 03, 2008 9:38 pm
Location: A hole in a field

Postby turfcutter » Tue Dec 04, 2012 1:24 pm

Thanks very much for clarifying these points. I have created the file 02proxy as suggested and it seems to work (at least, the latest upgrades would not download until I opened port 3142 in my server's firewall).
One last point: do I need to do separate configuration for Synaptic as described in docplastic's post?
turfcutter
 
Posts: 11
Joined: Sun Nov 04, 2007 3:46 pm
Location: Utrecht, Holland

Postby bobthebob1234 » Wed Dec 05, 2012 6:14 pm

I have no idea about Synaptic I'm afraid, don't use it, just use apt. I suppose you could do an experiment to find out, block port 3142 on you server again and see if it updates :)
For certain you have to be lost to find the places that can't be found. Elseways, everyone would know where it was
User avatar
bobthebob1234
LXF regular
 
Posts: 1373
Joined: Thu Jan 03, 2008 9:38 pm
Location: A hole in a field

Postby turfcutter » Mon Dec 24, 2012 10:44 am

I configured Synaptic with the proxy server's IP and port number and it seems to work as long as port 3142 is open in my firewall. Thanks for your help.
turfcutter
 
Posts: 11
Joined: Sun Nov 04, 2007 3:46 pm
Location: Utrecht, Holland


Return to Help!

Who is online

Users browsing this forum: No registered users and 0 guests