Cannot install mysql server on Debian 11 - mysql

I have installed MySQL APT Repository on my OS, then tried to execute the following command:
sudo apt update
sudo apt install mysql-server
It shows me these errors:
$ sudo apt install mysqL-server
Reading package lists.. Done
Building dependency tree.. Done
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:
mariadb-client-core-10.5 : Conflicts: virtual-mysql-client-core
mariadb-server-core-10.5 : Conflicts: virtual-mysql-server-core
E: Error, pkgProblemResolver: :Resolve generated breaks, this may be caused by held
packages
I have never installed mariadb on my device. Why is this error reported? I need to install mysql server on my device.
Please help me.

remove mariadb with
apt remove mariadb-common
then install mysql did it for me

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 on ubuntu 20.4

I am unable to install mysql server on my linux-20.4 machine.I get the following error:
The following packages have unmet dependencies:
mysql-server : Depends: mysql-community-server (= 8.0.27-1ubuntu20.04) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I have tried deleting and then reinstall several times but got the same result.Then i tried to manually install all the packages. But I got stuck in libaio1 and libmecab2. I did apt-get upgrade but still
get the error : Package 'libaio1' has no installation candidate.
This is the first time I am installing mysql.Also I am new to linux.May be I didn't delete existing mysql completely.Please help me install mysql.
Try to install mysql-common and mysql-community-client-plugins both on a single command. It will fix the issue.
sudo apt install mysql-community-client-plugins mysql-common

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

Error while installing postgreSQL database

I have to change my databasefrom MySQL to postgreSQL in django. But postgreSQL is not installing .
Error while installing postgreSQL using commands-
sudo apt-get update && sudo apt-get upgrade
sudo apt-get purge postgresql*
sudo apt-get -f install
sudo apt-get install postgresql
At terminal-
(jango)dc#dc-comp-4:~/website$ sudo apt-get install postgresql
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:
postgresql : Depends: postgresql-9.3 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
but its not working.how can i do this.and what changes i have to made. Plz help
aptitude might be able to resolve this issue. It's a more sophisticated dependency management tool than apt-get.
You may install it with apt-get:
sudo apt-get install aptitude
You may use aptitude to install postgresql
sudo aptitude install postgresql-9.3
If aptitude encounters any problems it automatically devises a possible solution to install this package. Be aware that aptitude might suggest remove conflicting packages. So if you get prompted by aptitude please read the prompt carefully.