What I would like to do is get a comparison of my current ubuntu installation against a fresh version (probably a listing of all files changed/added/removed). I made the mistake of not documenting well enough when I was making small tweaks and now I would like to change VPS providers without rediscovering all of those tweaks that make the system run. Additionally, I would like to document these changes, so just copying everything wouldn't really solve my problem.

Is this possible with any current tools?

  • It should be possible to get a list of packages that you explicitly installed (without listing dependencies). Additionally, some package managers have a feature to list all files that are not managed by them and/or were modified, but I'm not that familiar with apt-get and dpkg and can't try it, because I don't have any debian or ubuntu installation. – FSMaxB Nov 16 '13 at 9:10
  • Great. Would you happen to have any thoughts on what I can research to figure out that feature? I'm using Ubuntu 12.14, so I have apt for my package manager. – Seiyria Nov 16 '13 at 15:42
  • Look at features that are provided by apt-get and dpkg. There is a tool called debsums that verifies packages, but I'm not sure if it verifies the installed files or the deb file only. Also take a look at dpkg -S and the dpkg-query man page. Probably all those options work only on single files, so you would have to use find to recursively apply the commands to the whole system. Debian based systems may also provide tools to handle config files, so maybe that's worth investigating. – FSMaxB Nov 16 '13 at 21:27
  • And you always have the option to set up a virtual machine and install the same packages in it and then make a diff. – FSMaxB Nov 16 '13 at 21:29
  • Good to know! Thanks a ton for that. If you want to submit some information as an answer, I'd gladly accept it. – Seiyria Nov 17 '13 at 16:42

For Ubuntu/Debian

This is an old question, but for other people arriving here from Google searches in the future:

You can list the configuration files that were changed from the original in the installed packages by using debsums (or see How to check for modified config files on a Debian system? for alternative options):

sudo apt install debsums
sudo debsums -ce

After you have a list of the changed files, you can then diff the changes in configuration file, e.g. (using debsums):

cd /tmp
for FILE in $(sudo debsums -ce);
    do echo $FILE;
    PKG=$(dpkg -S $FILE | cut -d: -f1);
    diff <(apt-get download $PKG;dpkg-deb --fsys-tarfile $PKG*.deb | tar xOf - .$FILE) $FILE;
    echo "";
  • Thanks. Regretfully I have no idea if this works or can test it, as I've moved on. – Seiyria Mar 4 '19 at 16:30
  • 1
    No problem! I actually came across this question while facing the same problem and posted my solution as a future reference to me and others. It worked perfectly in my case (i.e., found all changes made in the /etc configuration files). – divieira Mar 5 '19 at 17:15


One thing that can help is to put the configuration files under version control to keep track of changes to the system. For instance check out etckeeper, discussed in using git to manage /etc.

Obviously you'd want to start using this right after a fresh install, then you can keep track and document changes just as you would when managing source code. Afterwards you can have a look at the history of changes, extract a single change of interest etc... And if the repo is stored on another machine it has some backup benefits as well.

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.