• 1
  • 2
  • 3
  • 4
  • 5
阿里云主机ECS 首 页  »  帮助中心  »  云服务器  »  阿里云主机ECS
ECS Ubuntu14.04 配置软件源解决安装依赖包问题
发布日期:2015-12-26 22:12:47

  使用ubuntu 14.04系统,使用apt-get 安装mysql-server时报错如下所示:

  eading 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 : Depends: mysql-server-5.5 but it is not going to be installed

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

  可看到报错信息是apt-get没有解决依赖包,导致mysql-server-5.5没有安装。

  此错误原因通常是软件安装源的问题,可参见以下方法修改安装源:

  方法一:

  1.通过wget http://oss.aliyuncs.com/aliyunecs/update_source.tgz 下载update_source的压缩包。

  2.tar xvf update_source.tgz解压后予执行权限 chmod 777 update_source.sh。

  3.执行该脚本./update_source.sh进行自动变更源操作。


 

    更新成功会提示”Success, exit now!“

  方法二:

  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 multiverse

  deb http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse

  deb http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse

  deb http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse

  deb http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse

  deb-src http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse

  deb-src http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse

  deb-src http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse

  deb-src http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse

  deb-src http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse

  apt-get update //更新一下列表

  更新完成后会显示:

  Reading package lists... Done