Finding Out Which Packages Were Installed
If you didn’t record which packages were installed, you can follow these steps to get that information:
These instructions are for Ubuntu 11.10, using the Unity interface and the
I expect the instructions to be similar for other environments, but no guarantee is made.
I had hoped to use the Log Viewer, but that application doesn’t work in Ubuntu 11.10 (at least not as of 02-Nov-2011). See here for bug report.
Opening the Installation History Log File
All installation and uninstallation operations that happen using
apt-get or Ubuntu Software Center are stored in
/var/log/apt/history.log. Examining the contents of this file allows us to determine which packages were installed.
1) Click on the Home Folder icon:
2) Click on File System:
3) Double-click on the
4) Double-click on the
5) Double-click on the
6) Double-click on the
history.log file – this should open it with
gedit, the default text editor in Ubuntu 11.10:
A Quick Overview of the history.log File
history.log file contains all the operations performed on your system using
Each block of operations (yellow) contains:
- a Start-Date and End-Date (red) for the operation
- the operation performed (blue)
- additional information about the operation (green)
In our case, we are interested in the
Finding the Installation Data
7) Search for the package you installed. If it was the last package you installed, then it will be at the end of the file. The records are stored with the newest operations towards the end (bottom) of the file and the oldest at the beginning (top) of the file:
In the sample below, you can see I had installed
lubuntu-desktop on 01-Nov-2011:
Start-Date: 2011-11-01 19:41:06
Commandline: apt-get install lubuntu-desktop
Install: libopenal1:i386 (1.13-2, automatic), libxfcegui4-4:i386 (4.8.1-5, automatic), chromium-browser-l10n:i386 (14.0.835.202~r103287-0ubuntu1, automatic), libobrender27:i386 (3.5.0-0ubuntu3, automatic), lxsession:i386 (0.4.6.1-1, automatic), libts-0.0-0:i386 (1.0-9, automatic), libswscale2:i386 (0.7.2-1ubuntu1, automatic), chromium-codecs-ffmpeg:i386 (14.0.835.202~r103287-0ubuntu1, automatic), libavutil51:i386 (0.7.2-1ubuntu1, automatic), libhttp-daemon-perl:i386 (6.00-1, automatic), and, many, many others ...
End-Date: 2011-11-01 19:51:55
8) Cut and paste: the Install data into an editor. You can start a new document in
gedit by clicking on the Create a new document icon:
9) Edit the data to be to remove all unnecessary text.
Looking at the data, we see that it has the following form:
<package name>:i386 (something in parentheses),
Only the package name is of interest. The :i386 (something in parentheses), needs to be deleted.
libopenal1:i386 (1.13-2, automatic) becomes
If you have a lot of text to edit (as in this example), you might consider using a text editor that offers regular expression matching – like LibreOffice Writer – for search and replace.
Using LibreOffice Writer, you can use the following regular expression (I think it is complete, but it might miss the odd expression):
:i386 \([0-9\.\-\~\+a-zA-Z, ]\),
It seems the above macro doesn’t work with newer versions of LibreOffice (at least version 3.4.4 and up). Use this one instead:
:i386 \([0-9\.\-\+a-zA-Z, ]*\),?
Ctrl + Alt + F to launch the Search and Replace dialog in LibreOffice Writer.
- Click on the More Options button (it will change to Fewer Options.
- Click on the Regular expressions box.
- Enter the regular expression into the Search for field.
- Click on the Replace All button.
- Clean up the last entry. This regular expression misses the last one and requires manual clean up.
10) Add the following at the start of the edited package list: sudo apt-get remove –auto-remove
11) Cut and paste this package list with the
apt-get command from step 10 into a
Terminal to completely uninstall the package.
WARNING ! ! !
This should work perfectly if the package you are uninstalling is the LAST package you (or anybody else) installed on your system. In other words: No one has installed anything else – not even updates – since this package was installed!
If other packages have been installed, if updates have been installed, then there is a RISK that those packages or updates may have a dependency on one or more of the packages you are uninstalling.
If you uninstall a package that some other package depends on, then that package will no longer function correctly.
Examining all package dependencies is very complicated. Proceed at your own risk – backups are strongly recommended.