View Single Post
free's Avatar
Posts: 739 | Thanked: 159 times | Joined on Sep 2007 @ Germany - Munich
#10
dpkg -l : get the list of installed packages (name + description)

dpkg -l| grep mail : filter only with input containing mail. As our input is list of (name,description), you get the list of package which names or desc contain mail.

dpkg -l| grep mail | grep -v lib : remove lines containing lib


dpkg -l| grep mail | grep -v lib | awk '{print $2}': take column 2 of each line (which is the package name, description is column 3, column 1 is status)

dpkg -l| grep mail | grep -v lib | awk '{print $2}' | xargs apt-get -y remove
Put the result in the input of apt-get remove and -y to force saying yes.

No that's not really safe, it removes everything that contains "mail" :)))

dpkg -l| grep mail | grep -v lib : this will just display the list