无法在 16.04 上安装 MariaDB - 未满足的依赖项

Ami*_*tel 5 mysql apt mariadb 16.04

以下是步骤

  1. sudo apt-get install software-properties-common
  2. sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8

  3. $ sudo add-apt-repository 'deb [arch=amd64,i386] http://mirror.fibergrid.in/mariadbrepo/10.1/ubuntu xenial main'

  4. sudo apt-get update
  5. sudo apt-get install mariadb-server

错误

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.
Run Code Online (Sandbox Code Playgroud)

Aja*_*rot 5

请检查您的机器中是否存在 Apache 和 php 包。

请按照以下步骤彻底删除 MySQL

现在打开终端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
Run Code Online (Sandbox Code Playgroud)

安装阿帕奇

sudo apt-get install apache2
Run Code Online (Sandbox Code Playgroud)

安装 php

sudo apt-get install libapache2-mod-php mysql-server mysql-client
sudo mysql_install_db
sudo mysql_secure_installation
Run Code Online (Sandbox Code Playgroud)

现在在终端打开mysql

mysql -u root -p
Run Code Online (Sandbox Code Playgroud)

请注意php的版本。参考原因 php 7

如果你想要版本 5 php,他们是通过添加 ppa 来安装 php 5 的一种方法。

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.6
Run Code Online (Sandbox Code Playgroud)

其他参考:php 版本问题

谢谢阿杰


Eof*_*fla 0

以下是在 Ubuntu 系统上安装 MariaDB 所需运行的命令:

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://mirrors.hustunique.com/mariadb/repo/10.1/ubuntu xenial main'
Run Code Online (Sandbox Code Playgroud)

导入密钥并添加存储库后,您可以使用以下命令安装 MariaDB:

sudo apt-get update
sudo apt-get install mariadb-server
Run Code Online (Sandbox Code Playgroud)