You need to make sure that you are purging the package which actually contains the config files. For example, /etc/mysql/my.cnf is not owned by the mysql-server package, but is owned by the mysql-common package. You can see this by running dpkg -S /etc/mysql
or dpkg -S /etc/mysql/my.cnf
. For apache2, its the apache2.2-common package which owns most of the config.
apt-file
is a handy utility you can install to search for this kind of thing as well. After apt-file update
, apt-file search /etc/mysql
should help figure out what package you need to reinstall.
Also note that you don't necessarily have to purge a package to replace missing config, there is a dpkg options --force-confmiss
to replace missing config and --force-confnew
to replace existing config, so you could probably fox your mysql problem with apt-get -o DPkg::options::=--force-confmiss install --reinstall mysql-common