Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to run this command (see section 4 from here https://help.ubuntu.com/community/AptGet/Howto#Removal_commands):

dpkg -l | grep '^rc' | awk '{print $2}' | xargs dpkg --purge

I use sudo at the beginning but anyway I get an error:

user@user-desktop:~$ sudo dpkg -l | grep '^rc' | awk '{print $2}' | xargs dpkg --purge
[sudo] password for user:
dpkg: error: requested operation requires superuser privilege

Why sudo doesn't work? What else should I type?

share|improve this question

2 Answers 2

sudo -i dpkg -l | grep '^rc' | awk '{print $2}' | xargs dpkg --purge

This may run your command with ROOT priviliges. Sudo and root is different. Reference

share|improve this answer

try to login as root, to gain the super-power, you can do this by typing:

sudo -i

then write (copy/paste :: Ctrl + C / Ctrl + Shift + V <-- paste in terminal) your command in terminal, and it should work

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.