There may be times when you need to view a list of the packages that were recently installed in Ubuntu for troubleshooting purposes or maybe just to find a program you installed that does not display in the menu. There are two ways to find out what was installed recently. You can view recently installed packages by date using the Synaptic Package Manager and from the command prompt using a Terminal window.
Use the Synaptic Package Manager
To view software packages installed recently using the Synaptic Package Manager, select Administration | Synaptic Package Manager from the System menu.
On the Synaptic Package Manager dialog box, select History from the File menu.
The History dialog box displays. All packages installed and removed using the Synaptic Package Manager are listed by month and date. Click the arrow to the left of a month in the left pane to display dates within that month on which software packages were installed or removed. Click a date to view what packages were installed or removed on that date in the right pane.
NOTE: Only software packages installed using the Synaptic Package Manager are displayed on the History dialog box. If you installed other software using other methods, such as the Ubuntu Software Center, they are not listed here.
To close the History dialog box, click the Close button.
To close the Synaptic Package Manager, select Quit from the File menu.
Use a Terminal window
If you prefer working in a Terminal window, you can get a list of installed software packages using the command line. To do this, select Accessories | Terminal from the Applications menu.
Enter the following command at the prompt and press Enter.
cat /var/log/dpkg.log | grep “\ install\ “
NOTE: There is a space after each of the backslashes.
This command displays entries from the dpkg.log file that match the term “ install “, including the spaces before and after. The “install” entries indicate packages that have been fully installed.
All the “install” entries in the dpkg.log file are displayed in the Terminal window, the most recent entries listed last.
If the dates in the dpkg.log file don’t go back as far as you need, there may be other dpkg log files. The dpkg.log file is rotated and archived weekly. You can find available dpkg log files by listing the contents of the /var/log directory.
To do this, enter the following command at the prompt and press Enter.
$ ls –l /var/log
NOTE: After “ls ” is one dash and a lowercase “L” followed by another space.
Notice that you get a listing of all the logs in the /var/log directory, not just the logs for dpkg. To display only the log files for dpkg, enter the following command at the prompt and press Enter.
$ ls –l /var/log/dpkg*
NOTE: Again, after the “ls ” is one dash and a lowercase “L” followed by another space.
Only one dpkg.log file displays in our system, because it is a new system we installed recently. To open the dpkg.log file for viewing, enter the following command at the prompt and press Enter.
$ gedit /var/log/dpkg.log
The dpkg.log file opens in gedit. All packages are listed, not only the ones with the “install” status. This makes it harder to find the fully installed packages.
TIP: Using the cat /var/log/dpkg.log | grep “\ install\ “ command is probably the best way of viewing a list of installed packages, because only “install” entries in the log file are displayed. If you need to view installed packages that are older than those available in the dpkg.log file, simply replace the dpkg.log filename in the cat command with other dpkg log filenames you find using the ls –l /var/log/dpkg* command.
To close gedit, select Quit from the File menu.
You may notice that the list generated using the Terminal window is more complete. Programs installed using any method are listed, not just programs installed using the Synaptic Package Manager.
by Lori Kaufman