开发者社区> 问答> 正文

云服务器 ECS Ubuntu 安装 MySQL Server 提示 mysql-server : Depends: mysql-server-5.5



问题现象



使用 Ubuntu 14.04 系统在安装 mysql-server 时出现如下报错信息: eading package lists... DoneBuilding dependency treeReading state information... DoneSome packages could not be installed. This may mean that you haverequested an impossible situation or if you are using the unstabledistribution that some required packages have not yet been createdor been moved out of Incoming.The following information may help to resolve the situation:The following packages have unmet dependencies:mysql-server : Depends: mysql-server-5.5 but it is not going to be instaedE: Unable to correct problems, you have held broken packages.
可以看到报错是无法解决 mysql-server 安装时的依赖关系导致的。
因为用户是使用 apt-get 的方式安装的,那么这种安装方式通常是能够自动解决依赖关系。

问题原因


因为系统自带的安装源无法解决安装包依赖问题,更换为新的安装源,解决包依赖问题,安装软件。

解决方案

  1. 方案一:修改系统 apt-get 更新配置文件
  2. 方案二:下载阿里云官方 apt-get 源更新脚本



方案一

cp -a /etc/apt/source.list /etc/apt/source.list.bak    //备份/etc/apt/source.list文件vim /etc/apt/source.list
在最前面添加一下内容 deb http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse执行 apt-get update 更新一下列表

方案二


1.下载 apt-get 更新源脚本 wget http://oss.aliyuncs.com/aliyunecs/update_source.tgz
2.解压并赋权脚本 tar xvf update_source.tgzchmod 777 update_source.sh
3.执行该脚本 ./update_source.sh

如果问题还未能解决,您可以到阿里云社区进行 免费咨询,或联系云市场商家 寻求帮助

展开
收起
boxti 2017-10-23 10:17:38 2877 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
如何运维千台以上游戏云服务器 立即下载
网站/服务器取证 实践与挑战 立即下载
ECS块储存产品全面解析 立即下载