0

I wanted to upgrade my MySQL server and client from v5.5.49 to the latest v5.6.*. To do this I firstly tried to uninstall the old version:

$ apt-get remove mysql-server-5.5 mysql-server-core-5.5 mysql-client-5.5 mysql-client-core-5.5

I didn't use the --purge argument, in order to keep the current settings.

But it the mysql-server-5.5 could not be uninstalled:

$ dpkg --get-selections | grep mysql
libdbd-mysql-perl               install
libmysqlclient18:amd64          install
mysql-common                    install
mysql-server-5.5                deinstall
php7.0-mysql                    install

However, I installed then the new version:

$ apt-get install mysql-client-5.6 mysql-client-core-5.6
$ apt-get install mysql-server-5.6 mysql-server-core-5.6

Now two MySQL Server versions are installed:

$ dpkg --get-selections | grep mysql
libdbd-mysql-perl               install
libmysqlclient18:amd64          install
mysql-client-5.6                install
mysql-client-core-5.6           install
mysql-common                    install
mysql-server-5.5                deinstall
mysql-server-5.6                install
mysql-server-core-5.6           install
php7.0-mysql                    install

But the newer one is in usage:

mysql> SELECT VERSION();
+-------------------------+
| VERSION()               |
+-------------------------+
| 5.6.30-0ubuntu0.14.04.1 |
+-------------------------+
1 row in set (0.00 sec)

Anyway though the upgrade itself was successful I would like to get my system clean again and uninstall the old version.

How to uninstall the old MySQL Server version (without to remove the configs)? Is it possible to do this over an apt package manager (apt-get/aptitude)?


UPDATE

Answering fkraiem's comment:

$ dpkg -l | grep mysql
ii  libdbd-mysql-perl                         4.025-1                                             amd64        Perl5 database interface to the MySQL database
ii  libmysqlclient18:amd64                    5.5.49-0ubuntu0.14.04.1                             amd64        MySQL database client library
ii  mysql-client-5.6                          5.6.30-0ubuntu0.14.04.1                             amd64        MySQL database client binaries
ii  mysql-client-core-5.6                     5.6.30-0ubuntu0.14.04.1                             amd64        MySQL database core client binaries
ii  mysql-common                              5.7.12-1~exp1+deb.sury.org~trusty+1                 all          MySQL database common files, e.g. /etc/mysql/my.cnf
rc  mysql-server-5.5                          5.5.49-0ubuntu0.14.04.1                             amd64        MySQL database server binaries and system database setup
ii  mysql-server-5.6                          5.6.30-0ubuntu0.14.04.1                             amd64        MySQL database server binaries and system database setup
ii  mysql-server-core-5.6                     5.6.30-0ubuntu0.14.04.1                             amd64        MySQL database server binaries
ii  php7.0-mysql                              7.0.3-4+deb.sury.org~trusty+1                       amd64        MySQL module for PHP
automatix
  • 645
  • 2
  • 5
  • 15

1 Answers1

2

rc mysql-server-5.5 means, that the package is uninstalled (r), but some configuration files remain (c) (in case you want to install it again later). In order to remove them (and make the package disappear from dpkg -l altogether), use sudo apt-get purge mysql-server-5.5.

automatix
  • 645
  • 2
  • 5
  • 15
fkraiem
  • 12,555
  • 4
  • 35
  • 40