在终端中安装mysql-server,报错,如下图所示
详细错误信息如下显示:
test@test-Lenovo ~ $ sudo apt-get install mysql-server
[sudo] test 的密码:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
下列软件包将被升级:
mysql-server
升级了 1 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 679 个软件包未被升级。
需要下载 10.8 kB 的归档。
解压缩后将会空出 66.6 kB 的空间。
错误:1 http://archive.ubuntu.com/ubuntu xenial-updates/main i386 mysql-server all 5.7.22-0ubuntu0.16.04.1
404 Not Found [IP: 91.189.88.152 80]
错误:1 http://security.ubuntu.com/ubuntu xenial-security/main amd64 mysql-server all 5.7.22-0ubuntu0.16.04.1
404 Not Found [IP: 91.189.88.152 80]
错误:1 http://security.ubuntu.com/ubuntu xenial-security/main i386 mysql-server all 5.7.22-0ubuntu0.16.04.1
404 Not Found [IP: 91.189.88.152 80]
错误:1 http://security.ubuntu.com/ubuntu xenial-security/main i386 mysql-server all 5.7.22-0ubuntu0.16.04.1
404 Not Found [IP: 91.189.88.152 80]
E: 下载 http://security.ubuntu.com/ubuntu/pool/main/m/mysql-5.7/mysql-server_5.7.22-0ubuntu0.16.04.1_all.deb 404 Not Found [IP: 91.189.88.152 80] 失败
原因:是因为有很多源找不到,需要重新寻找更新源
解决方法:找到/etc/apt/sources.list文件,如下图
找到该文件后,右击以管理员身份打开,并添加以下代码
deb http://mirrors.163.com/ubuntu/ lucid main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ lucid-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ lucid-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ lucid-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ lucid-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ lucid main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ lucid-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ lucid-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ lucid-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ lucid-backports main restricted universe multiverse
如下图所示:
在次打开终端,输入:sudo apt-get update ,按回车键,会更新信息,更新成功后再次执行sudo apt-get install mysql-server
这时候正常安装即可。