I reinstall emacs by compiling its source and then sudo checkinstall. I found checkinstall creates a file

-rw-r--r--  1 root root 44628516 Apr 22 19:19 emacs_24.5-1_amd64.deb
-rw-r--r--  1 root root 56991208 Apr 22 19:19 backup-042220151919-pre-emacs.tgz

Does checkinstall create a backup file regardless of which software it installs, or it depends on specific software (e.g. emacs) (maybe depending on the specific Makefile?)?

What is the backup file for?

Shall I keep it, and when can I discard it?

How shall I use it in case it is needed?


When you install package with checkinstall, it will automatically make a backup tarball of the currently installed package, if exists (it depends on ./configure --prefix=/dir). The name is: backup-<datetime>-pre-<packagename>-<version>.tgz in directory you are building package. If anything goes wrong with your new package you can roll back to the previous version using:

tar -xzvf backup-<datetime>-pre-<packagename>-<version>.tgz -C /

It is up to you how long you will keep this backup.

Additional info:

  1. When you run checkinstall it asks you a couple of question and there is:

    This package will be built according to these values:

     3 -  Version: [ x.y.z ]

So your backup should be: backup<datetime>-pre-<packagename>-x.y.z. Note the word pre.

  1. If the installed package is installed in /usr/bin and your --prefix=/usr/local/ checkinstall will not backup package installed in /usr/bin.

  2. I think your backup archive is relative to /. And

    tar -xzvf backup-<datetime>-pre-<packagename>-<version>.tgz -C /

will need sudo because it will place files in folders to which ordinary users don't have write permission.

  • Thanks! (1) Why does my backup file not have <version> in its name? (2) does checkinstall back up the installed one, only when the installed one exist in the --prefix=/dir where the new one will be installed? If the installed one exist in other directory, will checkinstall still back it up? (3) when roll back, does tar -xzvf backup-<datetime>-pre-<packagename>-<version>.tgz -C / need sudo? Why change to / by -C /? Isn't my previous --prefix, which is generally either /usr or /usr/local. – Tim Apr 23 '15 at 13:12
  • @Tim answer is edited. – taliezin Apr 23 '15 at 13:41
  • does tar -xzvf backup-<datetime>-pre-<packagename>-<version>.tgz -C / need sudo – Tim Apr 23 '15 at 13:58
  • It is in the third point. – taliezin Apr 23 '15 at 13:59
  • the third one is whether checkinstall needs sudo. not tar -xzvf backup-<datetime>-pre-<packagename>-<version>.tgz -C / need sudo – Tim Apr 23 '15 at 14:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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