Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Couldn't install mysql-server E: Sub-process /usr/bin/dpkg returned an error code 1 [closed]

Tags:

mysql

ubuntu

Cant reinstall mysql-service

root@xxx:~# apt-get install mysql-server -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  mysql-server-5.5
Suggested packages:
  tinyca mailx
The following NEW packages will be installed:
  mysql-server mysql-server-5.5
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 1760 kB of archives.
After this operation, 32.8 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/main mysql-server-5.5 amd64 5.5.47-0ubuntu0.14.04.1 [1748 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty-updates/main mysql-server all 5.5.47-0ubuntu0.14.04.1 [11.8 kB]
Fetched 1760 kB in 2s (669 kB/s)
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76, <> line 2.)
debconf: falling back to frontend: Readline
Preconfiguring packages ...
(Reading database ... 15862 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.5_5.5.47-0ubuntu0.14.04.1_amd64.deb ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
Aborting downgrade from (at least) 10.1 to 5.5.
If are sure you want to downgrade to 5.5, remove the file
/var/lib/mysql/debian-*.flag and try installing again.
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.5_5.5.47-0ubuntu0.14.04.1_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.5.47-0ubuntu0.14.04.1_all.deb ...
Unpacking mysql-server (5.5.47-0ubuntu0.14.04.1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/mysql-server-5.5_5.5.47-0ubuntu0.14.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've tried "sudo apt-get clean" and "sudo apt-get install -f" yet it still shows the above message.

Runnning "sudo dpkg --configure -a" gives me the below message.

root@xxx:~# dpkg --configure -a
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not installed.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-server
like image 850
meylah15 Avatar asked Feb 20 '16 14:02

meylah15


1 Answers

I had the same issue. This tutorial helped solve my issue: Package mysql-server-5.5 is not configured yet

sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean

After completely uninstalling mysql run the following command

sudo apt-get dist-upgrade

Then reinstall mysql

sudo apt-get install mysql-server
like image 186
bendozy Avatar answered Oct 05 '22 04:10

bendozy