Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I need to install multiple deb files of same software from apt cache in another ubuntu installation.

For example, I have all deb files of vlc in same folder(/var/cache/apt/archives). I need to install vlc with all dependencies satisfied. I cannot install it using dpkg -i vlc* because of dependencies.

Is there a solution to this. I have many software packgaes in my cache which I dont want to download again. Please help..

share|improve this question

1 Answer 1

Answering your question:

copy ALL of the debs from /var/cache/apt/archives to the new machine's /var/cache/apt/archives, then simply sudo apt-get update ; sudo apt-get install vlc as normal - it will pick up the .debs in the archive and install without downloading.

Going a step further: install apt-cacher-ng instead

On the first machine, do sudo apt-get install apt-cacher-ng. Then do sudo nano /etc/apt/apt.conf and insert the string Acquire::http::Proxy "http://127.0.0.1:3142/"; - this tells the machine to use the apt-cacher-ng instance on itself when it updates. Now, import your existing cached debs - sudo cp -a /var/cache/apt/archives/* /var/cache/apt-cacher-ng/_import/, then open your browser to http://localhost:3142/acng-report.html, scroll down, and click Start Import. Once that's done, do a quick sudo apt-get update - and, whew! You've now got apt-cacher-ng running on your host machine, and every time your host machine downloads updates, it will cache them for both itself and any other machine on your network.

Finally, on your second machine, sudo nano /etc/apt/apt.conf and insert the string Acquire::http::Proxy "http://first.machine.ip.address:3142/"; where first.machine.ip.address is the IP address of the machine you installed apt-cacher-ng on in the paragraph above - now, when you download updates on either machine, it will update the apt-cacher-ng on the first machine, and you won't have to download them again. Very, very slick and easy once it's set up.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.