我已经安装了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.
When i use 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
When i use: 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 : returns nothing
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.
因为安装不起作用而且我遇到了其他一些错误,所以我也更改了源列表文件 .
1 回答
我找到了解决方案 . 在我的情况下,它与etc / apt目录中的sourcelist文件有关 .
我更新了文件
跑:
要应用任何更新,请运行以下命令之一:
见Answer