linux ubuntu:安装mysql server失败:

kx7yvsdv  于 2021-06-21  发布在  Mysql
关注(0)|答案(1)|浏览(561)

我已经安装了apache2,安装了PHP7。已安装phpmyadmin。然后我尝试用我创建的用户创建一个数据库。不幸的是,我无法创建数据库,因为我没有正确的权限。所以我决定从头开始删除所有内容(apache2、mysql、php、phpmyadmin)。
为了删除mysql服务器,我使用了以下命令±

sudo apt-get remove --purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean

现在我被mysql的安装困住了。我想我删除的比我应该删除的多。

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-5.6 : PreDepends: mysql-common (>= 5.5) but it is not 
installable
                Depends: libdbi-perl but it is not installable
                Depends: mysql-client-5.6 (>= 5.6.35-1+deb.sury.org~xenial+0                   
                .1) but it is not going to be installed
              Depends: mysql-common (>= 5.6.22-1~) but it is not installable              

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

当我使用apt get update时:

root@localhost:~# apt-get update
Hit:1 http://archive.canonical.com/ubuntu xenial InRelease
Hit:2 http://ppa.launchpad.net/ondrej/mysql-5.6/ubuntu xenial InRelease
Hit:3 http://ppa.launchpad.net/ondrej/mysql-5.7/ubuntu xenial InRelease
Hit:4 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease

当我使用:sudo apt get install-f

root@localhost:~# sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

善待干净:一无所获
sudo apt get-f安装:

root@localhost:~# sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

sudo apt get-o debug::pkgproblemrolver=yes dist升级

root@localhost:~# sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

因为安装没有成功´我不能工作,我陷入了一些其他错误我也改变了源列表文件。

zhte4eai

zhte4eai1#

我找到了解决办法。在我的例子中,它与etc/apt目录中的sourcelist文件有关。
我更新了文件


# deb cdrom:[Ubuntu-Studio 16.04 LTS _Xenial Xerus_ - Alpha amd64 (20151225)]/ xenial main multiverse restricted universe

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to

# newer versions of the distribution.

deb http://archive.ubuntu.com/ubuntu/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted
bug fix updates produced after the final release of the

## distribution.

deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu

## team, and may not be under a free licence. Please satisfy yourself as to

## your rights to use the software. Also, please note that software in

## universe WILL NOT receive any review or updates from the Ubuntu security

## team.

deb http://archive.ubuntu.com/ubuntu/ xenial universe
deb-src http://archive.ubuntu.com/ubuntu/ xenial universe
deb http://archive.ubuntu.com/ubuntu/ xenial-updates universe
deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu

## team, and may not be under a free licence. Please satisfy yourself as to

## your rights to use the software. Also, please note that software in

## multiverse WILL NOT receive any review or updates from the Ubuntu

## security team.

deb http://archive.ubuntu.com/ubuntu/ xenial multiverse
deb-src http://archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://archive.ubuntu.com/ubuntu/ xenial-updates multiverse
deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates multiverse

## N.B. software from this repository may not have been tested as

## extensively as that contained in the main release, although it includes

## newer versions of some applications which may provide useful features.

## Also, please note that software in backports WILL NOT receive any review

## or updates from the Ubuntu security team.

deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's

## 'partner' repository.

## This software is not part of Ubuntu, but is offered by Canonical and the

## respective vendors as a service to Ubuntu users.

deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner

deb http://security.ubuntu.com/ubuntu xenial-security main restricted
deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse

跑步:

sudo apt-get update

要应用任何更新,请运行以下命令之一:

sudo apt-get upgrade

看到答案了吗

相关问题