Ubuntu12.04上安装MySQL Server提示mysql-server : Depends: mysql-server-5.1

     今天帮师弟安装服务器,在安装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.1 but it is not going to be instaed

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

   初步估计是系统自带安装源出了问题,在网上搜索了几个安装源来更新都没解决。后来在阿里云帮助中心找到了一个解决方案。

   方法一:

               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
               sudo apt-get update  && sudo apt-get -y upgrade//更新一下列表
         

   方法二:     

             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进行自动变更源操作。

    我采用的是方法一,更新了源之后,再输入命令:

             sudo apt-get install mysql-server

              即可以正常安装mysql。

  

 

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值