1

I am using an Ubuntu 20.04 VPS.

I've recently been having some issues with MySQL, so I decided the best way to fix it would be to reinstall it. So I made a backup of all my DB's and wanted to purge it. However, when I try to purge it, I get this error:

root@vmi386795:/usr/share/mysql-common# apt purge mysql*
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'mysql-source-8.0' for glob 'mysql*'
Note, selecting 'mysqltcl' for glob 'mysql*'
Note, selecting 'mysql-client-5.0' for glob 'mysql*'
Note, selecting 'mysql-client-5.1' for glob 'mysql*'
Note, selecting 'mysql-client-5.5' for glob 'mysql*'
Note, selecting 'mysql-client-5.6' for glob 'mysql*'
Note, selecting 'mysql-client-5.7' for glob 'mysql*'
Note, selecting 'mysql-common-5.6' for glob 'mysql*'
Note, selecting 'mysql-server-4.1' for glob 'mysql*'
Note, selecting 'mysql-server-5.0' for glob 'mysql*'
Note, selecting 'mysql-server-5.1' for glob 'mysql*'
Note, selecting 'mysql-server-5.5' for glob 'mysql*'
Note, selecting 'mysql-server-5.6' for glob 'mysql*'
Note, selecting 'mysql-server-5.7' for glob 'mysql*'
Note, selecting 'mysql-client-8.0' for glob 'mysql*'
Note, selecting 'mysql-testsuite' for glob 'mysql*'
Note, selecting 'mysql-server' for glob 'mysql*'
Note, selecting 'mysql-router' for glob 'mysql*'
Note, selecting 'mysql-server-8.0' for glob 'mysql*'
Note, selecting 'mysql-client' for glob 'mysql*'
Note, selecting 'mysql-sandbox' for glob 'mysql*'
Note, selecting 'mysql-client-core-5.0' for glob 'mysql*'
Note, selecting 'mysql-client-core-5.1' for glob 'mysql*'
Note, selecting 'mysql-client-core-5.5' for glob 'mysql*'
Note, selecting 'mysql-client-core-5.6' for glob 'mysql*'
Note, selecting 'mysql-client-core-5.7' for glob 'mysql*'
Note, selecting 'mysql-client-core-8.0' for glob 'mysql*'
Note, selecting 'mysql-testsuite-5.5' for glob 'mysql*'
Note, selecting 'mysql-testsuite-5.6' for glob 'mysql*'
Note, selecting 'mysql-testsuite-5.7' for glob 'mysql*'
Note, selecting 'mysql-common' for glob 'mysql*'
Note, selecting 'mysql-testsuite-8.0' for glob 'mysql*'
Note, selecting 'mysqltuner' for glob 'mysql*'
Note, selecting 'mysql-server-core-5.0' for glob 'mysql*'
Note, selecting 'mysql-server-core-5.1' for glob 'mysql*'
Note, selecting 'mysql-server-core-5.5' for glob 'mysql*'
Note, selecting 'mysql-server-core-5.6' for glob 'mysql*'
Note, selecting 'mysql-server-core-5.7' for glob 'mysql*'
Note, selecting 'mysql-server-core-8.0' for glob 'mysql*'
Package 'mysql-client-5.7' is not installed, so not removed
Package 'mysql-client-core-5.7' is not installed, so not removed
Package 'mysql-server-5.5' is not installed, so not removed
Package 'mysql-server-5.7' is not installed, so not removed
Package 'mysql-server-core-5.7' is not installed, so not removed
Package 'mysql-client-core-5.5' is not installed, so not removed
Package 'mysql-client-core-5.6' is not installed, so not removed
Package 'mysql-client-5.5' is not installed, so not removed
Package 'mysql-client-5.6' is not installed, so not removed
Package 'mysql-server-core-5.5' is not installed, so not removed
Package 'mysql-server-core-5.6' is not installed, so not removed
Package 'mysql-server-5.6' is not installed, so not removed
Package 'mysql-testsuite-5.5' is not installed, so not removed
Package 'mysql-testsuite-5.6' is not installed, so not removed
Package 'mysql-testsuite-5.7' is not installed, so not removed
Package 'mysql-client-5.0' is not installed, so not removed
Package 'mysql-client-5.1' is not installed, so not removed
Package 'mysql-client-core-5.0' is not installed, so not removed
Package 'mysql-client-core-5.1' is not installed, so not removed
Package 'mysql-server-4.1' is not installed, so not removed
Package 'mysql-server-5.0' is not installed, so not removed
Package 'mysql-server-5.1' is not installed, so not removed
Package 'mysql-server-core-5.0' is not installed, so not removed
Package 'mysql-server-core-5.1' is not installed, so not removed
Package 'mysql-sandbox' is not installed, so not removed
Package 'mysqltcl' is not installed, so not removed
Package 'mysqltuner' is not installed, so not removed
Package 'mysql-client' is not installed, so not removed
Package 'mysql-server' is not installed, so not removed
Package 'mysql-router' is not installed, so not removed
Package 'mysql-source-8.0' is not installed, so not removed
Package 'mysql-testsuite' is not installed, so not removed
Package 'mysql-testsuite-8.0' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  libaio1 libevent-core-2.1-7 libevent-pthreads-2.1-7
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  mysql-client-8.0* mysql-client-core-8.0* mysql-common* mysql-server-8.0 mysql-server-core-8.0*
0 upgraded, 0 newly installed, 5 to remove and 101 not upgraded.
1 not fully installed or removed.
After this operation, 203 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 124775 files and directories currently installed.)
Removing mysql-server-8.0 (8.0.28-0ubuntu0.20.04.3) ...
/var/lib/dpkg/info/mysql-server-8.0.postrm: line 68: /usr/share/mysql-common/configure-symlinks: Is a directory
dpkg: error processing package mysql-server-8.0 (--remove):
 installed mysql-server-8.0 package post-removal script subprocess returned error exit status 126
dpkg: too many errors, stopping
Errors were encountered while processing:
 mysql-server-8.0
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
5
  • 1
    It looks like your package management is in bad shape. Make sure your system is up-to-date before doing anything else in apt. Also, instead of using a wildcard, just purge the packages that are actually installed in your system. Finally, it's better if you use sudo from your user for commands that need permissions. Logging in as root is really not recommended for any purpose.
    – Nmath
    Apr 16, 2022 at 17:25
  • How can I find out what packages are installed in my system? @Nmath
    – Megami
    Apr 17, 2022 at 9:08
  • askubuntu.com/a/17829
    – Nmath
    Apr 17, 2022 at 16:23
  • I would concentrate on mysql-server-8.0, as this is the trouble maker. A possible solution is to reinstall it, before removing it: sudo apt-get install mysql-server-8.0 --reinstall. Apr 18, 2022 at 6:31
  • Sadly, that did not help. Output. @MarcVanhoomissen
    – Megami
    Apr 19, 2022 at 11:11

0

You must log in to answer this question.

Browse other questions tagged .