我一直在努力解决这个错误。我正在运行 Ubuntu16.04.1 LTS(GNU/Linux 4.4.0-31-通用 x86_64)。
The following additional packages will be installed:
mariadb-client-10.0 mariadb-client-core-10.0 mariadb-server-10.0
Suggested packages:
mailx mariadb-test tinyca
The following packages will be upgraded:
mariadb-client-10.0 mariadb-client-core-10.0 mariadb-server-10.0
3 upgraded, 0 newly installed, 0 to remove and 68 not upgraded.
9 not fully installed or removed.
Need to get 0 B/7,717 kB of archives.
After this operation, 13.5 MB disk space will be freed.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
dpkg: regarding .../mariadb-client-core-10.0_10.0.29+maria-1~xenial_amd64.deb containing mariadb-client-core-10.0:
mariadb-client-10.0 conflicts with mysql-client-core-5.5
mariadb-client-core-10.0 provides mysql-client-core-5.5 and is to be installed.
dpkg: error processing archive /var/cache/apt/archives/mariadb-client-core-10.0_10.0.29+maria-1~xenial_amd64.deb (--unpack):
conflicting packages - not installing mariadb-client-core-10.0
dpkg: regarding .../mariadb-client-10.0_10.0.29+maria-1~xenial_amd64.deb containing mariadb-client-10.0:
mariadb-client-core-10.0 conflicts with mysql-client-5.5
mariadb-client-10.0 provides mysql-client-5.5 and is to be installed.
dpkg: error processing archive /var/cache/apt/archives/mariadb-client-10.0_10.0.29+maria-1~xenial_amd64.deb (--unpack):
conflicting packages - not installing mariadb-client-10.0
Errors were encountered while processing:
/var/cache/apt/archives/mariadb-client-core-10.0_10.0.29+maria-1~xenial_amd64.deb
/var/cache/apt/archives/mariadb-client-10.0_10.0.29+maria-1~xenial_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
通过手动安装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://nyc2.mirrors.digitalocean.com/mariadb/repo/10.1/ubuntu xenial main'
sudo apt-get update
sudo apt-get install mysql-common mariadb-common libmysqlclient18 libmariadbclient18
mariadb-client-core-10.0 mariadb-client-10.0 mariadb-server-core-10.0
mariadb-server-10.0 libmariadbclient-dev mariadb-server
之后设置与您之前相同的 root 密码。
答案2
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://nyc2.mirrors.digitalocean.com/mariadb/repo/10.1/ubuntu xenial main'
sudo apt-get update
sudo apt-get install mariadb-client mariadb-server
That will install mariaDb 10.1 using the ppa you just selected. What you did,
sudo apt-get install mysql-common mariadb-common libmysqlclient18 libmariadbclient18
mariadb-client-core-10.0 mariadb-client-10.0 mariadb-server-core-10.0
mariadb-server-10.0 libmariadbclient-dev mariadb-server
使用操作系统自带的 ripo 安装 mariaDb-10.0。我认为这不是一个好主意。
您的错误是因为操作系统附带了 mariaDB 10.0 和 5.5,并且您的安装指定了这两者。