Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I just upgraded several PC to Ubuntu Trusty 14.04. For this, I used to install everything from scratch to get a clean system, keeping only /home (and /etc for reference).

This time however I upgraded using the upgrade tool, and I want to know what differences my PCs have compared to a nominal system. Because I installed many different packages from different sources, and might have edited some files here and there. Of course I know that apt should handle everything auto-magically, but I'm the paranoid type, and I really want to make sure.

Basically, here what I'd like to have:

  1. Get a list of all packages installed and for each of them, the repository it is coming from (if available). This would be basically an apt-cache policy for each package, but summarized in a neat list.

  2. For packages coming from "unofficial sources", an indication whether there is a version available from the official sources (I mean the repo listed in /etc/apt/sources.list).

    Sometime I installed patched packages from some 3rd-party, and this package is not updated because of conflicting version number. I want to have a list telling me whether it makes sense to fall-back to official version.

  3. The list of all files on the file system coming from an installed package (incl. configuration files), but that have been modified afterwards.

  4. The list of all files on the file system (excluding /home, and possibly /etc) that are not coming from an installed package.

Basically I want to know the differences that my system have if I did the upgrade versus a clean install, and decide on a case by case basis whether these differences might cause some instability.

share|improve this question

1 Answer 1

My question is already partially answered at How do I get a list of obsolete packages?.

The answers suggest to use

apt-show-versions | grep 'No available version'   # Show all package not coming from repo
aptitude search '~o'                              # Similar

I guess we can do as well:

apt-show-versions | grep -v uptodate              # All packages that are not up-to-date

This would give packages that are not up-to-date, i.e. packages that are upgradeable from enabled repositories, or packages not coming from such repositories.

To get a list of all available versions for such packages, we could do:

apt-show-versions -a $(apt-show-versions | grep -v uptodate | sed -r 's/:.*//')

I also found a question referencing deborphan -a (How to list installed packages in apt that are not backed by a repository?)

deborphan -a             # List all packages that have no reverse dependencies

So to summarize, I have some answers for item 1 and 2, but still looking for 3 and 4:

  1. apt-show-versions is a good answer
  2. Idem, one of the command combo above. The key step here of course is first make sure that only official repositories are enabled in /etc/apt.
  3. ?
  4. ?
share|improve this answer
    
For 3, dpkg -L packagename gives a list of files installed by the package, but not their modification status (or if it still exists on the system). –  saiarcot895 May 7 at 22:36
    
Yes, interesting. I could write a script that does that for all packages, collate in some list, and then compare to the list of all files on my system. But surely there must be some tool for that? Actually my question is really how debian/ubuntu admin masters do manage their boxes. I use Ubuntu for years now, but I'm not sure I'm doing it right. –  fuujuhi May 8 at 14:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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