在使用apt-get install XXX,报E: Unable to locate package XXX

一、在使用apt-get install XXX安装某个软件的时候,经常会出现一个错
例如以mysql为例:

root@iZ2zeht3zvxbq5ycy698pwZ:~# apt-get install mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package mysql-server

二、一般这样的问题,多出现于只需要升级一下安装源就好了

root@iZ2zeht3zvxbq5ycy698pwZ:~# apt-get update
Get:1 http://mirrors.cloud.aliyuncs.com/ubuntu xenial InRelease [247 kB]
Get:2 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates InRelease [102 kB]
Get:3 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-security InRelease [102 kB]
Get:4 http://mirrors.cloud.aliyuncs.com/ubuntu xenial/main Sources [868 kB]
Get:5 http://mirrors.cloud.aliyuncs.com/ubuntu xenial/universe Sources [7728 kB]
Get:6 http://mirrors.cloud.aliyuncs.com/ubuntu xenial/main amd64 Packages [1201 kB]

三、再安装就好了,不会再报错了

root@iZ2zeht3zvxbq5ycy698pwZ:~# apt-get install mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libcgi-fast-perl libcgi-pm-perl libencode-locale-perl libevent-core-2.0-5
  libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl
  libhttp-date-perl libhttp-message-perl libio-html-perl
  liblwp-mediatypes-perl liburi-perl mysql-client-5.7 mysql-client-core-5.7
  mysql-common mysql-server-5.7 mysql-server-core-5.7
Suggested packages:
  libdata-dump-perl libipc-sharedcache-perl libwww-perl tinyca
The following NEW packages will be installed:

四、解决啦

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值