Error ! The following packages have unmet dependencies: mysql-server - mysql

I tried to install mysql on my ubuntu16.04 for a django project. The installation has some problem with some existing files, getting the error:
mysql-server is already the newest version (5.7.19-0ubuntu0.16.04.1).
You might want to run 'apt-get -f 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
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution)
I tried, sudo apt-get -f install which gives error:
Preparing to unpack .../mysql-server-5.7_5.7.19-0ubuntu0.16.04.1_amd64.deb ...
grep: /etc/mysql/: No such file or directory
Aborting downgrade from (at least) 10.2 to 5.7.
If are sure you want to downgrade to 5.7, remove the file
/var/lib/mysql/debian-*.flag and try installing again.
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.7_5.7.19-0ubuntu0.16.04.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.19-0ubuntu0.16.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I have tried installation steps also but gets the first error.

Had a similar issue with another package and solved my problem like that.
sudo dpkg -i --force-overwrite /var/cache/apt/archives/libmysqlclient20_5.7.20-1ubuntu16.04_amd64.deb

Related

E: Unable to locate package mysql-community-server

in my case i am trying to install mysql 5.7, by following this tutorial https://www.vultr.com/docs/how-to-install-mysql-5-7-on-ubuntu-20-04/ , after running this command :
sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb
In the prompt, they ask me to choose the Ubuntu version ,and by mistake i have chosen anything ;( , so when i want to install mysql server by the command :
sudo apt install -f mysql-client=5.7* mysql-community-server=5.7* mysql-server=5.7*
they tells me :
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '5.7*' for 'mysql-client' was not found
E: Unable to locate package mysql-community-server
E: Version '5.7*' for 'mysql-server' was not found
is there any solution please , or how to restart all the installation process from the 0

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.

Cannot install MySQL - libaio.so.1: cannot open shared object file: No such file or directory - Live Installation with Persistence

I decided to sign up to askubuntu.com, because i really need an advice from experts: I made, with mkusb, a persistent USB Live installation of Ubuntu 16.10, since I'd like to have a portable development environment. Everything went good, and I'm writing from that Live right now.
Now the question: I managed to install apache2, but after hours and hours of searching in the web, and also on this site, I cannot still properly install MySQL server. After re-executing many time the installation, I continue to get this error:
Setting up mysql-server-5.7 (5.7.17-0ubuntu0.16.10.1) ...
ERROR: Unable to start MySQL server:
mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
Please take a look at https://wiki.debian.org/Teams/MySQL/FAQ for tips on fixing common upgrade issues.
Once the problem is resolved, run apt-get --fix-broken install to retry.
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script 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)
And if I run
sudo mysqld --initialize
The terminal still reports
mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
So i thought to search for this "libaio.so.1" as well, and I finished up installing the libraries "libaio1" and "libaio-dev" (which seems to be the same). The result, however didn't change even if those libraries are correctly installed.
Is this caused from the fact that I'm in a LiveUSB? Or is there another procedure to install/make MySQL recognize (since it's already installed, and I verified that the file exists) libaio.so.1?
I really hope you can help me, because i tried everything. I apologize in advance for any possible mistake made in this question. Thank you.
Oh, and there is an unanswered duplicate on the Ubuntu community made by me, so feel free to remove this question if it stays unanswered. Thank you in advance again.
After more many hours of research, i found that the problem wasn't the LiveUSB or the library itself. The problem was AppArmor, who blocked MySQL to use that library. So I disabled it:
sudo /etc/init.d/apparmor stop
sudo /etc/init.d/apparmor teardown
sudo update-rc.d -f apparmor remove
And a not-so-orthodox way, I completely removed AppArmor, to prevent future problems with:
sudo apt-get purge apparmor
Then I uninstalled and reinstalled MySQL Server flawlessy. It works!
If you got here while installing MariaDB, you can install the libaio1 using below command. The above solutions did not work for me
sudo apt-get install libaio1
Reference is here
maybe you should uninstall mysql and install it again using these command
remove mysql -
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
reinstall
sudo apt-get update
sudo apt-get install mysql-server
sudo mysql_install_db
sudo /usr/bin/mysql_secure_installation

Install Apache on Debian VPS & unmet dependencies error

I have a VPS and it runs on Debian GNU/Linux 8 (jessie). I try to install Apache, PHP, and MySQL on it. I get the below error:
The following packages have unmet dependencies:
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).
When I run apt-get -f install, i get below error:
Preconfiguring packages ...
(Reading database ... 39521 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.5_5.5.52-0+deb8u1_amd64.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_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)
I have basic knowledge of Linux, so any suggestion or help. I search online and try to uninstall and remove and reinstall MySQL... but no luck.
from you error output i did a quick apt-cache search to see the version numbers of mysql-server
from what i seen you might have installed mariadb-server-10.0 installed instead of mysql-server
do a dpkg -l | grep mysql and look at the results. you could also try dpkg -l | grep server and look at that output also.
ADDED COMMENT-
did you remove the file that it's asking you to do?
if you need to have both db-servers running i would follow along with this
https://superuser.com/questions/1029228/mysql-and-mariadb-instances-on-the-same-server
if you don't need both dbs, then i would apt-get remove mariadb-.. from your server and then apt-get -f install to get mysql-server installed

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...