How do I remove only one specific package with apt-get?

apt-get won't let you do that, since it's a potentially dangerous step for a package management system to allow.

As long as you are aware that there may be consequences, use dpkg with the --remove option to do it. For example:

sudo dpkg --remove mysql-common

Note: On my 12.04 system with apache2, php5, mysql-server installed separately, using apt-get to remove mysql-common DOES NOT want to remove apache2 or php5.

From insomnia's comment: If you need to override the dependency system's decision you can (with great care and making sure you know what you are doing) use an additional --force-depends.

sudo dpkg --remove --force-depends mysql-common

Tags:

Apt