0

I am new with Ubuntu.

I want to set up a local repository for Ubuntu 12.04 (Precise Pangolin), because I don't have Internet access on my laptop. I downloaded the repository using a local link (mirror ini Indonesia), but some of the repository is in error. What would be a link or similar for the download?

  • 1
    This can probably be done but, you know, it's like 500 GB in size, right? Are you sure you want the entire package repository for your version? – KGIII Oct 31 '15 at 14:09
  • See also https://help.ubuntu.com/community/AptGet/Offline/Repository – Panther Oct 31 '15 at 14:12
  • After you look at those 2 links, try again and ask a more specific question and include what you have done and what error or problem you are getting. – Panther Oct 31 '15 at 14:13
  • @bodhi I don't think this is a duplicate. The other questions don't address downloading the entire thing. At least not that I can see. – Seth Oct 31 '15 at 14:37
  • @Seth see https://help.ubuntu.com/community/AptGet/Offline/Repository . One can also https://help.ubuntu.com/community/Rsyncmirror and the OP states the repository is already downloaded so the link here shows how to set up the repo – Panther Oct 31 '15 at 14:39

1 Answers1

4

You can rsync a mirror out. The benefit of this is you can update by just running the command again. The downside is that you're downloading everything... We're talking hundreds of gigabytes.

If you just want to cache updates between lan clients, a caching proxy is probably a better idea.

But assuming you want everything, let's start by creating a directory for our mirror.

mkdir -p ubuntu-mirror/dists

Then we can rsync into that. My version below just gets you the bits you need, rather than syncing every release. If you need -backports or -proposed, add them.

rsync -avz rsync://archive.ubuntu.com/ubuntu/dists/precise{,-security,-updates} ubuntu-mirror/dists/

There is a mirror at the University of Indonesia. They may have a better network and they're almost certainly going to have better latency than a London server for you. Substitute kambing.ui.ac.id in for archive.ubuntu.com. Everything is signed so as long as you aren't spuriously adding keys, you can trust mirrors.

Now that will take about a hundred years to run the first time. I've no idea, it really depends on the server, your connection and how big the repo actually is at that moment in time. It will almost certainly take so long that you'll be out of date immediately. Thankfully updating is faster.

If you find kambing.ui.ac.id has broken packages, use the central server.

But after that, you can just share it however you like and add it to your apt sources. Again, it's all using the standard keys, so you shouldn't need to add anything else except its location to your /etc/apt/sources.list.

Oli
  • 293,335