Mysql installation error (unmet dependencies) - mysql

I just wanted to re-install the mysql from my ubuntu. So i have purge the mysql but when i am trying to install it. It's show dependencies unmet error.
sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version (5.7.22-0ubuntu0.17.10.1).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
mysql-server : Depends: mysql-server-5.7 but it is not going to be installed
mysql-testsuite-5.7 : Depends: mysql-server-5.7 (= 5.7.22-0ubuntu0.17.10.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
When i try to update it shows:-
sudo apt-get update
Hit:1 http://archive.ubuntu.com/ubuntu artful InRelease
Hit:2 http://de.archive.ubuntu.com/ubuntu artful InRelease
Hit:3 http://security.ubuntu.com/ubuntu artful-security InRelease
Err:4 http://ppa.launchpad.net/canonical-kernel-team/pti/ubuntu artful InRelease
403 Forbidden
Ign:5 http://archive.ubuntu.com/ubuntu trusty InRelease
Hit:6 http://de.archive.ubuntu.com/ubuntu artful-updates InRelease
Hit:7 http://archive.ubuntu.com/ubuntu trusty Release
Hit:8 http://de.archive.ubuntu.com/ubuntu artful-backports InRelease
Hit:9 http://ppa.launchpad.net/mutlaqja/ppa/ubuntu artful InRelease
Reading package lists... Done
E: Failed to fetch http://ppa.launchpad.net/canonical-kernel-team/pti/ubuntu/dists/artful/InRelease 403 Forbidden
E: Some index files failed to download. They have been ignored, or old ones used instead.
When i try to fix dependency the problem we get is still the same:-
sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
mysql-server-5.7
Suggested packages:
mailx tinyca
The following NEW packages will be installed:
mysql-server-5.7
0 upgraded, 1 newly installed, 0 to remove and 105 not upgraded.
3 not fully installed or removed.
Need to get 3,189 kB of archives.
After this operation, 48.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 mysql-server-5.7 amd64 5.7.22-0ubuntu0.17.10.1 [3,189 kB]
Fetched 3,189 kB in 0s (14.9 MB/s)
Preconfiguring packages ...
(Reading database ... 158292 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.22-0ubuntu0.17.10.1_amd64.deb ...
grep: /etc/mysql/: No such file or directory
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
invoke-rc.d returned 5
There is a MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.7_5.7.22-0ubuntu0.17.10.1_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.7_5.7.22-0ubuntu0.17.10.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
none of the fix works for me.
Thanks in advance :)
Happy coding

Seems your system is stuck in the process of mysql. Restart your system and run the following code.
sudo apt-get update
sudo apt-get -f install
sudo apt purge -y mysql-server
sudo apt install -y mysql-server
Then you should be prompted by the mysql installer to provide a password and it should work just fine.

Related

MySQL has problems with dependencies and not installing

i fully deleted mysql* from my Ubuntu focal. Then i reinstalled all with this commands:
sudo -i
wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.11-1_all.deb
dpkg -i mysql-apt-config_0.8.11-1_all.deb
apt update
apt-get -f install -o Dpkg::Options::="--force-overwrite"
apt update
apt-get install mysql-server
And then i get this error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
mysql-server : Depends: mysql-server-8.0 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
This question from stackoverflow DOES NOT WORK FOR ME unable to install mysql on ubuntu 16.04

Can't install mysql-server package

I am trying to install the mysql-server package on debian and I am getting an error:
t#mintserver:~$ sudo apt install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
mysql-server
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/2.942 kB of archives.
After this operation, 111 kB of additional disk space will be used.
Selecting previously unselected package mysql-server.
(Reading database ... 372098 files and directories currently installed.)
Preparing to unpack .../mysql-server_5.7.29-0ubuntu0.18.04.1_all.deb ...
Unpacking mysql-server (5.7.29-0ubuntu0.18.04.1) ...
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not installed.
I read many other replies that told me to purge the packages, correct dependencies, but nothing works.
t#mintserver:~$ sudo apt install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 0 B/2.933 kB of archives.
After this operation, 0 B of additional disk space will be used.
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not installed.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
Please, run sudo dpkg --audit or sudo dpkg -C, it's the same. It probably will suggest to you what to do.
Edit: According to your comment,
Setting up mysql-server-5.7 (5.7.29-0ubuntu0.18.04.1) ... update-alternatives: error: alternative path /etc/mysql/mysql.cnf doesn't exist dpkg: error processing package mysql-server-5.7 (--configure): installed mysql-server-5.7 package post-installation script subprocess returned error exit status 2 Errors were encountered while processing: mysql-server-5.7
the update-alternatives program failed to find this mysql.cnf file.
Could you try creating that file?
Please, do:
sudo nano /etc/mysql/mysql.cnf
filling with this content:
[mysql]
Then, try again dpkg --configure <package>
Or, this will probably do the job:
sudo apt-get remove --purge mysql-\*
sudo apt-get install mysql-server mysql-client
If interested, you could also read A Quick Guide to Using the MySQL APT Repository. They provide different installation approaches for different scenarios.

unable to uninstall mysql broken mysql / install new mysql

I have made some shitty things to MySQL and I facing this.
I am trying to re-install MySQL. directly deleted the MySQL folder using sudo rights and tried to re-install.
the fix will be greatly appreciated
command I am running
sudo apt-get install mysql-server
following is the output I am receiving
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version (5.7.26-0ubuntu0.18.04.1).
0 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mysql-server-5.7 (5.7.26-0ubuntu0.18.04.1) ...
/var/lib/dpkg/info/mysql-server-5.7.postinst: line 191: /usr/share/mysql-common/configure-symlinks: No such file or directory
dpkg: error processing package mysql-server-5.7 (--configure):
installed mysql-server-5.7 package post-installation script subprocess returned error exit status 127
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
https://askubuntu.com/a/1134184/653440
do: sudo apt edit-sources and look for anything containing mariadb like: deb [arch=amd64,arm64,ppc64el] http://ftp.nluug.nl/db/mariadb/repo/10.3/ubuntu bionic main
comment it out by putting a # in front of it. then run
sudo apt update
sudo apt purge mysql-common
sudo apt install mysql-common
after that you can installed mysql-server properly via sudo apt install mysql-server
Helped me fix the issue.

Raspbian - dpkg error when trying to install mysql-server

I'm running a lighttpd web server on my Raspberry Pi and I'm trying to add php and mysql support. I'm currently trying to install mysql-server with the command
'sudo apt-get install mysql-server'
which results in the following error:
[my user name]#raspberrypi:~ $ sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libaio1 libhtml-template-perl mysql-server-5.5 mysql-server-core-5.5
Suggested packages:
libipc-sharedcache-perl mailx tinyca
The following NEW packages will be installed:
libaio1 libhtml-template-perl mysql-server mysql-server-5.5
mysql-server-core-5.5
0 upgraded, 5 newly installed, 0 to remove and 15 not upgraded.
Need to get 0 B/4,938 kB of archives.
After this operation, 46.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
WARNING: The following packages cannot be authenticated!
libaio1 mysql-server-core-5.5 mysql-server-5.5 libhtml-template-perl
mysql-server
Install these packages without verification? [y/N] y
Preconfiguring packages ...
Selecting previously unselected package libaio1:armhf.
(Reading database ... 121517 files and directories currently installed.)
Preparing to unpack .../libaio1_0.3.110-1_armhf.deb ...
Unpacking libaio1:armhf (0.3.110-1) ...
Selecting previously unselected package mysql-server-core-5.5.
Preparing to unpack .../mysql-server-core-5.5_5.5.52-0+deb8u1_armhf.deb ...
Unpacking mysql-server-core-5.5 (5.5.52-0+deb8u1) ...
Preparing to unpack .../mysql-server-5.5_5.5.52-0+deb8u1_armhf.deb ...
Aborting downgrade from (at least) 10.0 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.52-0+deb8u1_armhf.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Selecting previously unselected package libhtml-template-perl.
Preparing to unpack .../libhtml-template-perl_2.95-1_all.deb ...
Unpacking libhtml-template-perl (2.95-1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.5.52-0+deb8u1_all.deb ...
Unpacking mysql-server (5.5.52-0+deb8u1) ...
Processing triggers for man-db (2.7.0.2-5) ...
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.5_5.5.52-0+deb8u1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I know the same problem was reported here:
https://raspberrypi.stackexchange.com/questions/28312/raspberry-pi-2-installing-mysql-server
But the solution in that case seemed to be enabling the loopback interface. In my case, the loopback interface is working fine but that doesn't solve my problem.
ifconfig output:
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1096 errors:0 dropped:0 overruns:0 frame:0
TX packets:1096 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:91408 (89.2 KiB) TX bytes:91408 (89.2 KiB)
I tried the following commands, repeatedly, with no result:
'sudo apt-get -f install'
'sudo apt-get autoremove'
'sudo apt-get autoclean'
'sudo apt-get update'
'sudo apt-get upgrade'
'sudo dpkg --configure -a'
The problem is in the preinstall script. It should install perfectly. You have some options here:
1) Open a bug at Debian Bug Tracking System (BTS). Make sure you are using the latest version.
2) Try to fix it by yourself.
If you decide to go with 2), you want to make this script verbose, so, edit a file name /var/lib/dpkg/info/mysql-server-5.5_5.5.52-0*.preinst
Then replace the initial line from:
#!/bin/sh
to
#!/bin/sh -x
Then, call # apt-get install -f and see the new log messages
Try with:
sudo apt-get autoremove --purge <package>

Unable to install libjpeg-turbo8-dev on Ubuntu

I tried to install libjpeg-turbo8-dev like this.
feng#HP:~$ sudo apt-get install libjpeg-turbo8-dev
[sudo] password for feng:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
kde-l10n-engb libasn1-8-heimdal:i386 libasound2:i386 libasyncns0:i386
libaudio2:i386 libavahi-client3:i386 libavahi-common-data:i386
{***many packages***}
libxml2:i386 libxmu6:i386 libxrender1:i386 libxt6:i386
libxxf86vm1:i386 mysql-common openjdk-7-jre-lib
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
libjpeg-turbo8-dev
0 upgraded, 1 newly installed, 0 to remove and 39 not upgraded.
1 not fully installed or removed.
Need to get 0 B/420 kB of archives.
After this operation, 1 219 kB of additional disk space will be used.
(Reading database ... 261347 files and directories currently installed.)
Unpacking libjpeg-turbo8-dev:amd64 (from .../libjpeg-turbo8-dev_1.3.0-0ubuntu1.1_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/libjpeg-turbo8-dev_1.3.0-0ubuntu1.1_amd64.deb (--unpack):
trying to overwrite '/usr/include/jmorecfg.h', which is also in package libjpeg-turbo-devel 1.3.0-3
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/libjpeg-turbo8-dev_1.3.0-0ubuntu1.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
My Ubuntu is 13.10
I want to install libjpeg-turbo8-dev, because I want to install mysql-server and mysql-client. Thet depends on this package.
feng#HP:~$ sudo apt-get install mysql-server mysql-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libjpeg8-dev : Depends: libjpeg-turbo8-dev (>= 1.1.90+svn722-1ubuntu6) but it is not going to be installed
mysql-client : Depends: mysql-client-5.5 but it is not going to be installed
mysql-server : Depends: mysql-server-5.5 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
What you could try is to install the synaptic package manager:
sudo apt-get install synaptic
Here is someone who had a similar problem with the java runtime. Maybe this can help you if synaptic doesn't.
Otherwise I am not sure if you do really need the dev package...