1

On Ubuntu 16.04 server with a relative default install of LEMP (w/mysql).

When installing using the instructions on the MariaDB site: https://downloads.mariadb.org/mariadb/repositories/#mirror=digitalocean-nyc&distro=Ubuntu&distro_release=xenial--ubuntu_xenial&version=10.1 all steps work except the last when it actually tries to install.

$ sudo apt install mariadb-server
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.17+maria-1~xenial) but it is not
going to be installed

E: Unable to correct problems, you have held broken packages.

I see others with a similar error throughout the years on this site but most have no answer, or the answer was specific to their version.

UPDATE After running command from comments the final installation step worked but after entering a password for root it mentioned an error occurred:

An error occurred while setting the password for the MariaDB administrative user. This may have happened because the account already has a password, or because of a communication problem with the MariaDB server.
You should check the account's password after the package installation.

Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for more information.

Clicked ok, and it continued to install many packages but then showed errors here:

Installing new version of config file /etc/mysql/debian-start ...
2016-09-27 14:15:23 139954230032640 [Note] /usr/sbin/mysqld (mysqld 10.1.17-MariaDB-1~xenial) starting as process 8339 ...
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mariadb-server-10.1 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mariadb-server:
mariadb-server depends on mariadb-server-10.1 (= 10.1.17+maria-1~xenial); however:
Package mariadb-server-10.1 is not configured yet.

dpkg: error processing package mariadb-server (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for systemd (229-4ubuntu8) ...
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
mariadb-server-10.1
mariadb-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
1

You can try 'sudo apt-mark showhold' to see which packages might be 'held' ("you have held broken packages"). You could then 'unhold' them with 'sudo apt-mark unhold package-name'.

Generally 'sudo apt-get update' is also a good idea, to make sure your local apt cache knows what is and isn't available.

  • Ran 'sudo apt-mark showhold' and didn't show anything. But copied and pasted all the mariaDB instructions again and this time it worked! So weird since I assume your command was suppose to show packages not actually fix it, but i'll take it! Thanks so much! - Update - While it installed this time, got new errors now noted above. – cchiera Sep 27 '16 at 18:14
1

Everytime i encounter with this problem i consider refreshing my sources.list file..:

 sudo apt-get autoclean

remove sources.list file.and create new sources.list...

sudo rm /etc/apt/sources.list 

Then, type in

sudo software-properties-gtk 

enter image description here This will open software-properties-gtk and a newsources.list will be created automatically.

Then change the server to US or to any other server of your choice. You must enable repositories from the new dialog in order to create new sources.list.

Tick all the boxes then click on Revert then click close.

Need to restore default repositories

 sudo apt-get update && sudo apt-get dist-upgrade -y

(it is good practice to backup this file before installing to recover if such things happen)

Now install anything! sudo apt-get install mariadb-server

  • I should clarify this is in regards to ubuntu servers on Digital Ocean (not a a local Ubuntu OS) – cchiera Sep 27 '16 at 19:35
  • It works everywhere... atleast debian unity mint – minigeek Sep 28 '16 at 3:33
  • You are welcome @TwitchBronBron – minigeek Jan 26 '17 at 4:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.