0

Suppose I'm on a machine with full internet access and do "apt-get update" it then updates the cache /var/cache/apt/* with binary files. Now I do a "apt-get install pkgname" and inside /var/cache/apt/archives it places the deb packages.

Now I can consider that if /var/cache/apt/* folder is tarred and exported into a offline machine then "apt-get install pckgname", should install the package. Is this way of package installation valid and if so what should be done additionally to make this thing work?

When I tried this locally, it din't work and every time I did apt-get install pkgname, the my cache-binaries (srcpkgcache.bin, pkgcache.bin) were getting replaced with the default ones.

2 Answers 2

0

You can install local packages using

dpkg -i /path/to/packagename.deb

but you should take care of dependencies yourself, by installing all packages in correct order.

1
  • that's one way.. but my intention is to copy the cache of already installed package and then port all this cache to a new system and execute an apt-get install for the package since all the dependencies are already present in the cache.
    – Linus_30
    Nov 10, 2016 at 10:38
0

If you don't copy the folder using sudo then a packagelock becomes active and may interfere. You can copy the entire contents of /var/cache/apt/archives (not the folder) using sudo, to a USB and paste only those in a folder on Desktop of the new machine/installation. Then sudo dpkg -i <the path to new folder on desktop> <package name>*.* or if all packages to install, then sudo dpkg -i <the path to new folder on desktop>*.*

Hope it helps

2
  • i want to install without dpkg, just by running the apt-get install pkgname, since this pck is already present in the cache of the apt.
    – Linus_30
    Nov 10, 2016 at 10:45
  • apt-get may create dependency issue, dpkg -i will actually get the dependency data from the entire folder and install it hassle free Nov 10, 2016 at 10:50

You must log in to answer this question.

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