How to reinstall *everything*?

Luis lemsx1 at
Sat Sep 16 19:47:27 UTC 2006

I suggest you download my script:

Then become root:

sudo -i

then create a file called .backuprc with:

# # uncommend below what you want to customize
# # BACKUPDIR must be specify for the script to work properly.
# # unless you want to put the files in /home/backup
# ## bzip2 or gzip? or don't define if no compression is needed
# ## prefix to name of the file
# ## Users must define this
# ##perl compatible + shell regex
# #EXCLUDES=.*contain-this.*|\.ends-in-that$|starts-with.*|[0-9]*|.[a-z]*$
SYSTEM=/etc /var/mail /var/spool /var/lib/iptables /root

This script just backup all your directories defined in SYSTEM and all
your users' homes with id's higher than 1000 (regular users). All the
files will be placed in

They will have names like: my-desktop-system-`date -I`.tar.gz,
my-desktop-other-`date -I`.tar.gz, my-desktop-`list of users`-`date

And finally there will be a file called: my-desktop-selections.txt.
Which is created with: dpkg --get-selections \* >

Once that's done, you can reformat your disk (assuming you can copy
the tar files from /home to a safe disk, say a DVD).

When you are done, re-install ubuntu using a Dapper disk. Then get the
my-desktop-selections.txt file and re-install the stuff you had before

sudo -i
cat my-desktop-selections.txt | dpkg --set-selections
dselect update && dselect install

After that, if you ever need a configuration from your old system, you
have a tar file that you can open by double-clicking on it, and copy
the file to your /etc folder.

Generally, unless you are on a server, you don't need these files ;-).
ubuntu does the right thing for you at installation.

Hope that helps somebody out there...

On 9/16/06, Alexander Skwar <listen at> wrote:
> Hello!
> As I'm having very strange problems with Firefox and Thunderbird (see
> "Can't start Thunderbird and themes in Firefox look bad"), I'd like to
> reinstall all the packages that I've currently got installed.
> To do so, I tried to use aptitude. In aptitude, I highlighted "Installed
> packages" and pressed L "Request that a package be reinstalled.". After
> that, all the installed packages were selected for reinstallation. But
> when I have aptitude start the installation, I get errors like this:
> ┌──────────────────────────────────────────────────────────────────────────────┐
> │E: I wasn't able to locate file for the linux-headers-2.6.15-25 package. This▒│
> │   might mean you need to manually fix this package.                         ▒│
> │E: Internal error: couldn't generate list of packages to download            ▒│
> │                                    [ Ok ]                                    │
> └──────────────────────────────────────────────────────────────────────────────┘
> So I deselected all those packages which gave me these errors. But then,
> I get:
> E: Couldn't configure pre-depend perl-base for debconf, probably a dependency cycle.
> A package failed to install.  Trying to recover:
> Drücken Sie zum Fortsetzen die Eingabetaste.
> And now I'm fed up ;)
> Is there an *easy* way to reinstall all the currently installed packages?
> Thanks,
> Alexander Skwar
> --
> Dick sein ist keine physiologische Eigenschaft - das ist eine
> Weltanschauung.
>                 -- Kurt Tucholsky
> --
> ubuntu-users mailing list
> ubuntu-users at

Luis Mondesi
*NIX Guru

"We think basically you watch television to turn your brain off, and
you work on your computer when you want to turn your brain on" --
Steve Jobs in an interview for MacWorld Magazine 2004-Feb

No .doc:

More information about the ubuntu-users mailing list