gpt4 book ai didi

mysql - Linux-Ubuntu : Installing MySQL Server failed:

转载 作者:太空宇宙 更新时间:2023-11-04 05:16:44 26 4
gpt4 key购买 nike

我已经安装了apache2,安装了php 7。安装了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 clean :不返回任何内容

Sudo apt-get -f install:

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::pkgProblemResolver=yes dist-upgrade

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.

因为安装失败并且我遇到了一些其他错误,所以我还更改了源列表文件。

最佳答案

我找到了解决方案。就我而言,它与 etc/apt 目录中的源列表文件有关。

我更新了文件

# 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

请参阅Answer

关于mysql - Linux-Ubuntu : Installing MySQL Server failed:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48146562/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com