2

I've been using and upgrading Ubuntu since the version 9. Of course, I have 13.04 now and after installing a clean 13.04 to another computer, I've noticed quite a few differences (plymouth, lightdm, some software behaves differently, etc.). I've done quite a few customizations during the period so it's probably due to that.

So I wonder if there is a way to see what's different between my and the clean version. Not the complete file list diff, but perhaps software package differences (synaptic?) or something that will be easier to read and compare. Is there a way?

2
  • Well, the software sources should be the same (the packages are the same). The main difference are the config files and directories that end up piling up in your personal folder, I think. That is why a clean install is the recommended way to go, so the apps can "refresh their faces" (sorry for the metaphor) :)
    – edwin
    Jun 26, 2013 at 0:35
  • @edwin Yeah, debsums did the trick concerning the config files (though I expected a lot more changes there) and I couldn't/wouldn't do the clean install every time because of all the work data I have as well as all the customizations I've done (which I tend to forget about over the years and then I get surprised when I see a clean install) :)
    – Shomz
    Jun 26, 2013 at 22:42

3 Answers 3

2

You could compare the list of installed package with the ".manifest" file of your distribution,

For instance the manifest of 13.04/i386 can be found here :

http://mirrors.mit.edu/ubuntu-releases/13.04/ubuntu-13.04-desktop-i386.manifest

To get your installed packages :

#aptitude search ~i \!~M

Regarding the customization you could have made there is a tool that can helps you to compare the modified configuration files against the package checksum informations : debsums

#debsums -ce 

(-e to check only the configuration files, -c only the changed files)

Edit :

the packages installed during the year are logged in /var/log/apt. Older history logs are deleted by logrotate. I made that script to get the installed package (take care not to modify the awk patterns when copying).

# cd /var/opt/log
#(zcat $(ls -rt history*gz); cat history.log ) | awk '
 /^Commandline: (apt-get install|synaptic|aptitude)/{ 
         cmdl=$0 
         getline
         if(/^Install|^Remove/) {
            print cmdl
            print
         }
  }' | less
3
  • And is there a way to compare each referenced configuration file with the stock version?
    – Severo Raz
    Sep 25, 2013 at 0:43
  • @WolterHellmund Last time I did that I first listed the modified config files with debsum -ce, downloaded the package, extracted it in /tmp and did a diff with the conf files of the package. Maybe one can do it more simply, with a versioning tool doing a remote "diff" with the source repository.
    – Emmanuel
    Oct 7, 2013 at 13:11
  • @Emmanuel my thoughts exactly! I wonder if there is such a service! I had to reinstall and never noticed what was causing my previous problems.
    – Severo Raz
    Oct 7, 2013 at 23:32
2

The following script can be used to compare the list of installed package with the ".manifest" file for a distribution. I developed it with "ubuntu-16.04.1-desktop-amd64.manifest" against a Ubuntu 16.04.1 LTS instance having a number of packages added and removed.

#!/bin/bash

# The first parameter to this script is the manifest file name.

# Take the first column of the manifest. This is the name of the
# package without version information.
cut --fields=1 $1 | \
    sort > \
         manifestpkglist.tmp

# Get the list of packages installed on this sysem. Packages with
# deinstalled status are ignored. Only the first column of the output
# having the package names is considered.
dpkg --get-selections | \
    grep --invert-match deinstall | \
    cut --fields=1 | \
    sort > \
         installedpkglist.tmp

# Report the differences.
diff --side-by-side \
     --suppress-common-lines \
     manifestpkglist.tmp \
     installedpkglist.tmp

# Remove the intermediate files.
rm --force \
   manifestpkglist.tmp \
   installedpkglist.tmp

The script takes the manifest file as input. To run it, make the script executable $ chmod u+x manifest-diff.sh and execute by passing in the manifest file name as the first parameter: $ ./manifest-diff.sh ubuntu-16.04.1-desktop-amd64.manifest

A limitation of this script is that it does not make a distinction between packages that were explicitly installed and those that were added to fulfill dependencies. Presumably, such information is available on the system as it must be needed for the autoremove feature of the package manager. A better script would incorporate that information.

1
  • Pretty cool, thank you! I'll give it a shot when I return home.
    – Shomz
    Aug 14, 2016 at 18:37
1

For some reason the "!~M" pattern revoked the "~i" pattern, so I got all the packages (including the never-installed ones).

if you do a

# aptitude search ~i

it all works.

2
  • on bash the '!' has to be escaped some way. Did you try '!~M' or \!~M ?
    – Emmanuel
    Jun 27, 2013 at 8:32
  • Yes, even escaped with \ it did not work. But anyway, having the metapackages in the list is not a bad thing.
    – Hatredman
    Jul 6, 2013 at 15:08

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.