Unable to install MariaDB on 16.04 - unmet dependency
Solution 1
Please check that Apache and php packages exist or not in your machine.
Please follow this steps to completely remove MySQL
Now open the terminal Ctrl + T
sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean
Install apache
sudo apt-get install apache2
Install php
sudo apt-get install libapache2-mod-php mysql-server mysql-client
sudo mysql_install_db
sudo mysql_secure_installation
Now open mysql in terminal
mysql -u root -p
Please note the version of php. ref reason why php 7
Their is one way to install php 5 by adding ppa If you want version 5 php.
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.6
Other Ref : php version issue
Thanks Ajay
Solution 2
In my case, the ibdata1 file was corrupt. I fixed as follows:
$ sudo apt-get purge mariadb-*
$ sudo rm -f /var/lib/mysql/ib*
$ sudo apt-get install mariadb-server
Solution 3
I got the same error, but it turned out to be because I had installed std mysql and had uninstalled it. The cure was deleting the /var/lib/mysql
directory and running the mariadb install again.
Solution 4
If you installed MariaDB/MySQL server before, remove them first:
sudo apt-get remove mariadb-server mariadb-client mysql-server mysql-client
Then make sure no mysqld process is running.
sudo kill -9 $(pgrep mysql)
After that, install MariaDB server. if you still see the same error, you should check out MariaDB error log /var/log/mysql/error.log to find out the cause.
source: linuxbabe.com - install MariaDB 10.1 on Ubuntu 14.04 and 16.04
Related videos on Youtube
Amit Patel
Updated on September 18, 2022Comments
-
Amit Patel over 1 year
Here are the steps
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
$ sudo add-apt-repository 'deb [arch=amd64,i386] http://mirror.fibergrid.in/mariadbrepo/10.1/ubuntu xenial main'
sudo apt-get update
sudo apt-get install mariadb-server
Error
sudo: /etc/sudoers.d is world writable 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: mariadb-server : Depends: mariadb-server-10.1 (= 10.1.14+maria-1~trusty) but it is not going to be installed E: Unable to correct problems, you have held broken packages.
-
Admin almost 8 yearsFirst run
sudo apt-get remove --purge mariadb-server
& then try to install -
Admin almost 8 years
sudo: /etc/sudoers.d is world writable
is the error in your case, the directory is world writable ? if yes, correct this first.
-
Amit Patel almost 8 yearsYes. I followed all the steps from downloads.mariadb.org/mariadb/repositories/…. Updated the questions to include those steps
-
Eofla almost 8 yearssudo apt-get install mariadb-server-10.1=10.1.14+maria-1~trusty
-
d a i s y almost 8 years@Eofla
sudo apt-get install mariadb-server-10.1=10.1.14+maria-1~trusty
is completely wrong. -
Eofla almost 8 yearsI meant sudo apt-get install mariadb-server-10.1
-
Sylvain Pineau over 7 yearsCould you please detail the commands to perform to both clean /var/lib/mysql and reinstall mariadb?
-
tripleee about 6 years
kill -9
is dubious advice.