Ubuntu – Save *.deb files from var/cache/apt/archives folder for future installation

apt

How can I store away the *.deb files from var/cache/apt/archives directory for future installation in case I need to reinstall the OS in ubuntu 11.10. I tried copying and saving away but after OS reinstallation I tried reinstalling those deb files using "apt-get install file" but so many files were missed thought I copied everything. What am I missing, Please reply

Best Answer

Apt manager always install a software by reading source file which contains list of packages,there dependency. These list file are updated when you run the update program (basically whenever you run the command sudo apt-get update)

After a Ubuntu re installation those source files aren't updated.So you can update them using sudo apt-get update (Add PPAs if 3rd party software were used) and try with apt-get install method but wait, you may see that many files are being re downloaded (not all).

It is because those packages are updated with your previous installation of the software and now. Anyway in this case you have to download only the updated files. If the file hasn't updated it will take from your backup.You can see the required download size while installing.

Preferable Method

You can use apton-cd to create backup of apt-files (I don't know whether it will work in current situation, surely you can use it for future), mount the iso after re installation. Add the media as a source and install software.Lot of tutorial available in web.

Manual Method Another thing you can do is to install using dpkg. Go to the folder of apt backup, run dpkg -i name_of_deb.deb. But in this way dependency won't be installed automatically. You have to install each dependent package individually. Other wise installation will fail. For example: to install vlc you have to install the libraries first and finding out the dependent library is not an easy task.

Note: I have told what I understand about installation in Ubuntu. Don't know whether any other method exists.

Related Question