Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 apologise in advance: this question has probably been asked about 100 times but I can't seem to find a solution.

My problem: I'm trying to remove Qt Creator (and everything else Qt-related) from my laptop because I have been experiencing this problem with Qt creator 2.8. Having entered the command dpkg --get-selections | grep qt, I get a list of about 20-30 packages. Most of these packages are listed as install but some are listed as either deinstall or purge. When I attempt to apt-get purge the packages listed as purge or deinstall, I am informed that the package in question is not installed on my system. Why are the packages still listed when I have removed them?

1) Is there a way to remove all packages containing a specific keyword (e.g. by using grep)?

2) Why are some packages listed as purge or deinstall? I read somewhere that the command apt-get dselect-upgrade will perform these operations but this but that did not work.

3) Why is dpkg giving me a list of packaged that includes packages that I have removed?

There's obviously a lot I have to learn about package management in Ubuntu, any help is appreciated.

I am using Ubuntu 13.10.

share|improve this question
1. Yes 2. Because they are either purged or just deinstalled. 3. Because dpkg is listing it's database. Now, for the real question, can you just sudo apt-get remove them? – Braiam Dec 13 '13 at 22:42
Could you elaborate on your answers for 1 and 2? Yes, apt-get remove works but I was hoping for an easier way than having to type the name of every package. – Jack Jefferson Dec 13 '13 at 22:45
up vote 1 down vote accepted

You can use aptitude or apt-get. The problem with this is that just qt selects too many packages and you could very well uninstalling other stuff that shouldn't/doesn't need to be uninstalled:

sudo apt-get -s remove qt*

This won't remove any packages, but will let you see what will you be removing.

sudo apt-get install aptitude
sudo aptitude search '?and(?name(qt), ~i)'

This will search any package that has qt and it's installed. Change the search for remove to remove it.

share|improve this answer
The first command you gave me outputs `Package 'packagename' is not installed, so not removed' for a long list of packages, most of which do not even contain 'qt'. The second command gives no output at all. – Jack Jefferson Dec 14 '13 at 16:29
If the second command (I'm guessing aptitude search '?and(?name(qt), ~i)') doesn't give output, it means that you don't have any qt package installed. Congratz! You can also use aptitude search '?and(qt, ~i, !~M)' to broad the search. – Braiam Dec 14 '13 at 16:38
OK so I've accomplished that task... now how do I stop dpkg listing packages that I've removed? – Jack Jefferson Dec 14 '13 at 16:44
if you mean dpkg --get-selections it will show them whatever you do, since it list all package status not just the ones you have installed. – Braiam Dec 14 '13 at 16:47
Oh, it seems I have been missing the point of --get-selections. Thanks for all your help. – Jack Jefferson Dec 14 '13 at 16:50

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.