Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I searched the whole internet for this but did not find any satisfactory answer for this question.

aptitude search ‘~i !~M’ | less

does not show the manually installed packages. On my system it shows a huge list:

i accountsservice - query and manipulate user account informat i acl - Access control list utilities
i acpi-support - scripts for handling many ACPI events
i acpid - Advanced Configuration and Power Interface i add-apt-key - Command line tool to add GPG keys to the A i adduser - add and remove users and groups
i alsa-base - ALSA driver configuration files
i alsa-utils - Utilities for configuring and using ALSA
i anacron - cron-like program that doesn't go by time i apache2 - Apache HTTP Server
i apache2-bin - Apache HTTP Server (binary files and modul i apache2-data - Apache HTTP Server (common files)
i apache2-mpm-prefork - transitional prefork MPM package for apach i apg - Automated Password Generator - Standalone i apt - commandline package manager
i apt-clone - Script to create state bundles
i apt-transport-https - https download transport for APT
i apt-utils - package managment related utility programs i apt-xapian-index - maintenance and search tools for a Xapian i aptdaemon - transaction based package management servi i aptdaemon-data - data files for clients
i aptitude - terminal-based package manager
i aptitude-common - architecture indepedent files for the apti i apturl - install packages using the apt protocol - i apturl-common - install packages using the apt protocol - i archdetect-deb - Hardware architecture detector
i ardour3 - digital audio workstation (graphical gtk2 i aspell - GNU Aspell spell-checker
i aspell-en - English dictionary for GNU Aspell
i at-spi2-core - Assistive Technology Service Provider Inte i avahi-autoipd - Avahi IPv4LL network address configuration i avahi-daemon - Avahi mDNS/DNS-SD daemon
i avahi-utils - Avahi browsing, publishing and discovery u i banshee - Media Management and Playback application i baobab - GNOME disk usage analyzer
i base-files - Debian base system miscellaneous files
i base-passwd - Debian base system master password and gro i bash - GNU Bourne Again SHell
i bash-completion - programmable completion for the bash shell i bc - GNU bc arbitrary precision calculator lang i bind9-host - Version of 'host' bundled with BIND 9.X
and many others...

But obviously I didnot install all of these. On the other hand a much more effective solution is this:

zcat /var/log/apt/history.log.*.gz | grep 'apt-get install'


Commandline: apt-get install wine1.7 winetricks Commandline: apt-get install ubuntu-restricted-extras Commandline: apt-get install pi Commandline: apt-get install gparted Commandline: apt-get install virtualbox Commandline: apt-get install ardour3 Commandline: apt-get install kubuntu-restricted-extras ubuntu-restricted-extras Commandline: apt-get install apache2 Commandline: apt-get install tasksel

which are exactly the packages I installed manually. But the problem with the above solution is that the logs can be messed up. So what I want is the exact same output of the history.log file from some aptitude command. So that the log messing up won't pose any problem.

share|improve this question
Please explain: "But the problem with the above solution is that the logs can be messed up." In what way can the logs be messed up? Thanks! – DK Bose Mar 12 '14 at 5:42
Also, I think using grep 'apt-get install' will omit software installed by any other way than by sudo apt-get. So you'll miss stuff you got by Synaptic or the Software Center. – DK Bose Mar 12 '14 at 5:45

To get a list of packages installed locally run this command:

dpkg --get-selections | grep -v deinstall

you can save a file list of all installed packages

dpkg --get-selections | grep -v deinstall > myInstalledPackages.txt
share|improve this answer

Your Answer


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.