Here’s the deal: I reinstall once, sometimes twice or even three times a week. Why? Well, that’s beside the point. Sometimes I break something, but sometimes I just feel like it. Never mind that. What I want to suggest is that, if you’re like me, you can save yourself a little bandwidth and a lot of time downloading if you take the time to copy your apt cache before you erase your drive.
Aptitude (and apt-get and some of those funky little utilities) keep all the packages they downloaded in /var/cache/apt/archives. So the next time you install something chunky, like xorg for example, don’t clean it out with
aptitude clean. Instead, copy those files to another location — like a second hard drive or a leftover 128Mb USB drive … you know, the one with the case that snapped so you pried it apart to look at the guts, and it still works but you never use it because it’s somehow not trustworthy without the case.
Then, the next time you install, dump the contents of that USB drive back into /var/cache/apt/archives. Aptitude (or apt-get and some of those funky little utilities) won’t know the difference between those files and the ones that you’re asking it to install, unless there’s a newer version in the repositories, in which case it’s going to download it anyway.
You’re saving yourself something like 40-120Mb — and an hour’s wait — each time you reinstall, depending on what you download and what your connection speeds are. For my own part, I keep a folder of about 140Mb on a modular hard drive, and that serves as my jumpstart archive, so I don’t have to keep downloading and redownloading the same old packages over and over again.
For the terminally uninclined, copy out your cache folder any time you download a big package with this:
cp /var/cache/apt/archives/*.deb /media/usbdisk/
or whatever the name of your destination drive is. To copy it back, use this:
sudo cp /media/usbdisk/*.deb /var/cache/apt/archives/
And remember that you need sudo with the second command, since it’s headed for a directory outside your home.