Author Topic: Can I create a LAN repository  (Read 2567 times)

0 Members and 1 Guest are viewing this topic.

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18210
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Can I create a LAN repository
« on: May 19, 2010, 02:53:56 pm »
If I'm installing Ubuntu on multiple networked PC's, is there any way I can download packages and updates to just one machine and get the rest to check its cache for needed files before going online to get the same files... seems a bit wasteful in both storage and time for multiple machines to each have copies of the same packages in their /var/cache/apt/archives/ directories.

ie. can one machine (or NAS) be used as a repository that gets checked for packages by ALL machines first, but if they aren't there... then they go online to a normal repo for them.

Or put another way... Can ALL machines "share" a /var/cache/apt/archives/ directory.
(and if so, what about the lock file)

I know I could "manually" copy the files to the other machines (leaving the lock file), but it would be nice if it was an automatic process.

This could potentially save hours, particularly during an upgrade.
« Last Edit: May 19, 2010, 03:31:21 pm by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline Mad Penguin

  • Administrator
  • Hero Member
  • *****
  • Posts: 1420
  • Karma: 10018
  • Gender: Male
    • View Profile
    • Linux in the UK
    • Awards
Re: Can I create a LAN repository
« Reply #1 on: May 19, 2010, 06:34:32 pm »
You certainly can!

Code: [Select]
apt-get install apt-proxy

Make sure the following settings are appropriate in /etc/apt-proxy/apt-proxy-v2.conf ;

Quote
;; Server IP to listen on
address = <your local IP address>

;; Server port to listen on
port = 9999

[ubuntu]
;; Ubuntu archive
backends = http://gb.archive.ubuntu.com/ubuntu
min_refresh_delay = 15m


Then edit your /etc/apt/sources.list and change the format from;

Quote
deb http://gb.archive.ubuntu.com/ubuntu/ karmic main restricted

to

Quote
deb http://<your proxy IP>:9999/ubuntu/ karmic main restricted


For each line .. then do apt-get update, and you're away!

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18210
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Can I create a LAN repository
« Reply #2 on: May 19, 2010, 06:53:11 pm »
Right, I thought there would be a way... Thanks for that. :)
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal