Ubuntu – Will apt-get remove thesql-server-5.1 delete /var/lib/thesql

aptMySQLUbuntu

I installed mysql 5.5 in /usr/local/mysql . If I apt-get remove the old package, it won't delete the data directory in /var/lib/mysql will it?

UPDATE: Yes it's an official standard generic Ubuntu package

Best Answer

The one way to know for certain is to inspect the /var/lib/dpkg/info/mysql-server-5.1.postrm script. Without knowing if you are using the official package, or which version of the package, I cannot say with certainty what will happen.

Typically a apt-get remove will not purge any data or configuration scripts. If you want everything to be removed you use apt-get purge.

But why chance it? Make a backup first, and then remove.