View Single Post
Posts: 540 | Thanked: 387 times | Joined on May 2009
#14
My browser ate this post, so let's try again...

/var/cache/apt/archive is not meant as a permanent storage for .deb packages (unfortunately). Every once in awhile a package manager will do some "housecleaning" and delete the contents of that folder. It's really only meant as a temporary storage location while the package manager installs the packages.

While it would be trivial to whip up something to copy the .deb files to your SD card always immediately after installing packages from apt-get (or even something like grabdebz() { sudo apt-get -d install $1; cp -n /var/apt/cache/archives/*.deb /media/mmc1/debz/; sudo apt-get install $1; }; grabdebz ) That would only work if your only means of installing packages was through apt-get.

But because you use Hildon Application Manager (GUI) and I am not aware of anyway to tell it NOT to delete the contents of /var/cache/apt/archives and furthermore can't inject an option to tell it to first download, then copy to SD, then install packages, I think you are out of luck with that method. And it's not open source, so the option cannot be added. You might be able to convince hqh to include the functionality in Fapman though.

So then my only suggestion would be to simply save a list of installed packages and store that list somewhere safe (SD card for instance). Then whenever you end up needing to re-flash, go somewhere that has free wifi and use that list to re-download and install those packages onto your new install. It's not ideal but I don't know what else to suggest.

Backup:
Code:
foo=`dpkg -l | grep ii | awk '{ print $2 }'`; echo $foo > /media/mmc1/copymesomewheresafe
Explanation of code: List install packages via dpkg, then cut off the top row of output, then delete all but the second column and throw all of that in a variable called "foo". Then output the variable foo to a file on your SD card.

Restore:
Code:
bar=`cat /media/mmc1/copymesomewheresafe`; apt-get install $bar
Explanation of code: Output the contents of that saved file listing all your packages that you have saved on your SD card and throw that in a variable called "bar". Then tell apt-get to install everything in the variable bar.

Something else that would be nice but that AFAIK doesn't exist and would be a major pain to script would be to figure out how to tell [say for example] your Ubuntu desktop/laptop to download the Fremantle armel packages from your list (including all dependencies) to a SD card to install that way.
 

The Following User Says Thank You to linuxeventually For This Useful Post: