-1

I want to download entire multiverse repository I know it maybe several GBs around 20, but I want to. NOTE:I ONLY WANT TO DOWNLOAD AND WILL INSTALL LATER using dpkg -i [pkg] First created a file which contains names of all the available packages using apt-cache.

apt-cache dumpavail |grep -oP "(?<=Package: ).*" >> packagelist

This will create a file packagelist with all the available packages. i want to understand the working of apt-cache dumpavail command. i know >> is there to append and creates a file package list and all, but didn't get that grep (?<=package: ) and it's working so ones understood i don't have to memorize that stuff.

koe
  • 189
  • I just said I got it wrong http://archive.ubuntu.com/ubuntu/dists/ has no .debs only an index (list) of them, it won't get you what you want. To download it click on Contents-amd64.gz it is a link, you will see, just a text file. – Mark Kirby Dec 13 '15 at 08:57
  • ok but neither will http://askubuntu.com/questions/531403/how-to-download-all-repository-using-apt-get, i want an answer not a comment – koe Dec 13 '15 at 08:59
  • sorry, don't waste your time, i will try. i am just unable to follow it. it's complicated. – koe Dec 13 '15 at 09:23
  • shall i edit this into a vpn question or just ask another. – koe Dec 13 '15 at 09:26
  • Why is it complicated ? why not just say "I don't understand that, can you explain for me ?" So you don't understand the * ? That mean's all files contain . and something after it, so .* is every file with an extension in the repo (.debs .gz .tar .txt) so that's all of them. Don't ask a new question, just use comments to ask for advice, when you edit your question like that it comes off as I tried this it did not work. I will help you, but use comments, to ask for clarification, just so we are clear and on the same page :) – Mark Kirby Dec 13 '15 at 09:30
  • Next you must copy that script to a blank text file, save it as repo.sh in /home and then run chmod +x repo.sh in your home folder or right click and make executable. Now when you run this it will download the repo, run it with sudo ./repo.sh. Does this make it a bit easier to understand ? Please do ask for help. – Mark Kirby Dec 13 '15 at 09:38
  • how much will be the total size of download like 10GB or 100GB freaking? can't afford it dude. i will remove some packages then. does it have ppa, ex:indicator-brightness? – koe Dec 13 '15 at 09:44
  • are only free packages included, so i don't end up with commercial-ware and waste my download capacity? – koe Dec 13 '15 at 09:47
  • I don't know how big it is, I am running it now I will let you know, it is taking a while, but it works. It will download all your currently active repos, so go to the software and updates app and just disable the one you don't want to download (3rd party ones like get.deb or whatever) and re enable them after the download is complete. – Mark Kirby Dec 13 '15 at 09:52
  • apt-cache dumpavail Dumps all available (dumpavail) sources in apt's cache (apt-cache) to a file called packagelist. You don't have to memorize any thing, run apt-cache dumpavail |grep -oP "(?<=Package: ).*" >> packagelist to overwrite the list, then run repo.sh to download it, that is the only steps after the first time. – Mark Kirby Dec 13 '15 at 09:57
  • my packagelist is created in /root. is it right, as even with sudo i got permission denied, or did u do with sudo instead of su/sudo -i or change it's location – koe Dec 13 '15 at 10:02
  • No, don't run sudo apt-cache dumpavail |grep -oP "(?<=Package: ).*" >> packagelist just apt-cache dumpavail |grep -oP "(?<=Package: ).*" >> packagelist it should be in the /home of your current user for easy running. – Mark Kirby Dec 13 '15 at 10:05
  • OK My download is taking ages but seems the download will be 103GB ish for default repos. – Mark Kirby Dec 13 '15 at 10:07
  • http://unix.stackexchange.com/q/248955/61798 – DK Bose Dec 13 '15 at 14:40

1 Answers1

2

You can create a mirror for your own. One tool to do this is debmirror. It's downloading the complete repository and saving it to your hard disc. Once this has done, you can add the local folder to your apt-configuration and using it instead of remote mirrors. Or you can provide a webserver to offer it as mirror to your company.

There is a wiki page about.

However, packages are stored inside http://archive.ubuntu.com/ubuntu/pool/ but without the meta data you cannot be sure it's not changed etc. (Inside packages.gz there are crypto-hashes stored)

frlan
  • 1,030
  • 5
  • 17