0

How to make a use able completely offline archive from my /var/apt/cache/archive directory as an afterthought. My question is how to build an offline archive by copying the archive directory and making it usable as standalone source. Please also include the instructions on how to add this to the software sources. This question is pertaining to an afterthought of creating an archive rather than a premeditated procedure (which is answered already). I have seen and used this before with Version 10 and 12 from a Linux friend who is not available anymore. Basically you add the source as a file and it works seamlessly.

This question is almost like a repeat BUT NOT. It has been asked before and I can follow the instructions to copy this directory and then do sudo apt-get update to rebuild a list. That was pretty good and saves oodles of download mb budget, but it is not use able without Internet and the archive list from the apt-get update is quite big too (myanmar internet).

My question is how to build an offline archive by copying the archive directory and making it usable as standalone source. Please also include the instructions on how to add this to the sources.

My guess is that there is a dpkg command to do this.

1 Answer 1

0

I finally found the link to do this here

In short.

Go to /var/cache/apt/archives and copy your debian packages to a folder of your choice, for example, /home//repository/ Change into the repository directory cd ~/repository

and generate a Packages.gz file like this:

sudo dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz

Make sure build-essential is installed (sudo aptitude install build-essential) before you run the above command.

Add the following line to your sources.list file (/etc/apt/sources.list) deb file:/home//repository/ /

Remember to replace with your real username Reload your package index like this: sudo apt-get update

My note: Lastly, if you want to be completely offline, you need to remove the other online sources. (Basically remove everything except this new source you just created)

1
  • I tested this and it works. Commented Apr 7, 2016 at 3:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .