Skip to content

Instantly share code, notes, and snippets.

@doxt3r
Created July 14, 2021 10:41
Show Gist options
  • Save doxt3r/d516ae15129db64abe0eb000f7f35fb3 to your computer and use it in GitHub Desktop.
Save doxt3r/d516ae15129db64abe0eb000f7f35fb3 to your computer and use it in GitHub Desktop.
Mysql error installation on Ubuntu
habeeb@machine2 info $ sudo apt reinstall mysql-server-core-8.0
The following packages will be REINSTALLED:
mysql-server-core-8.0
The following partially installed packages will be configured:
mysql-server-8.0
0 packages upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 2 not upgraded.
Need to get 18,1 MB/19,4 MB of archives. After unpacking 0 B will be used.
Get: 1 http://ubuntu.univ-nantes.fr/ubuntu focal-updates/main amd64 mysql-server-core-8.0 amd64 8.0.25-0ubuntu0.20.04.1 [18,1 MB]
Fetched 18,1 MB in 29s (633 kB/s)
dpkg: warning: files list file for package 'mysql-server-8.0' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-client-core-8.0' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-workbench-data' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-server-core-8.0' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-client-8.0' missing; assuming package has no files currently installed
(Reading database ... 500495 files and directories currently installed.)
Preparing to unpack .../mysql-server-core-8.0_8.0.25-0ubuntu0.20.04.1_amd64.deb ...
Unpacking mysql-server-core-8.0 (8.0.25-0ubuntu0.20.04.1) over (8.0.25-0ubuntu0.20.04.1) ...
Setting up mysql-server-core-8.0 (8.0.25-0ubuntu0.20.04.1) ...
dpkg: error processing package mysql-server-8.0 (--configure):
package is in a very bad inconsistent state; you should
reinstall it before attempting configuration
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Errors were encountered while processing:
mysql-server-8.0
E: Sub-process /usr/bin/dpkg returned an error code (1)
and also:
habeeb@machine2 info $ sudo aptitude remove mysql-server-core-8.0
The following packages will be REMOVED:
mysql-server-core-8.0
The following partially installed packages will be configured:
mysql-server-8.0{b}
0 packages upgraded, 0 newly installed, 1 to remove and 2 not upgraded.
Need to get 0 B/1 282 kB of archives. After unpacking 134 MB will be freed.
The following packages have unmet dependencies:
mysql-server-8.0 : Depends: mysql-server-core-8.0 (= 8.0.25-0ubuntu0.20.04.1) but it is not going to be installed
The following actions will resolve these dependencies:
Remove the following packages:
1) mysql-server-8.0 [8.0.25-0ubuntu0.20.04.1 (focal-security, focal-updates, now)]
Accept this solution? [Y/n/q/?] Y
The following packages will be REMOVED:
mysql-server-8.0{a} mysql-server-core-8.0
0 packages upgraded, 0 newly installed, 2 to remove and 2 not upgraded.
Need to get 0 B of archives. After unpacking 135 MB will be freed.
Do you want to continue? [Y/n/?] Y
dpkg: error processing package mysql-server-8.0 (--remove):
package is in a very bad inconsistent state; you should
reinstall it before attempting a removal
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)
Solutions:
go in this path :
/var/lib/dpkg/info$
and delete all files with mySQL
sudo rm mysql-*
sudo mv /var/lib/dpkg/info/<packagename>.* /tmp/
sudo dpkg --remove --force-remove-reinstreq <packagename>
sudo apt-get remove <packagename>
sudo apt-get autoremove && sudo apt-get autoclean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment