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

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
云数据库 RDS MySQL Serverless,价值2615元额度,1个月
简介: 一、在使用apt-get install XXX安装某个软件的时候,经常会出现一个错 例如以mysql为例:root@iZ2zeht3zvxbq5ycy698pwZ:~# apt-get install mysql-serverReading package lists.

一、在使用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:

四、解决啦

相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
3月前
|
Go C语言
安装go-sqlite3包时报exec: "gcc": executable file not found in %PATH%解决办法
安装go-sqlite3包时报exec: "gcc": executable file not found in %PATH%解决办法
|
4月前
|
C++ Windows
CMake中的find_package(xxx REQUIRED)在windows平台怎么解
CMake中的find_package(xxx REQUIRED)在windows平台怎么解
|
11月前
装R包(package)error:(as ‘lib’ is unspecified)installation of package had non-zero exit status]
装R包(package)error:(as ‘lib’ is unspecified)installation of package had non-zero exit status]
|
12月前
【报错解决】ERROR: pip‘s dependency resolver does not currently take into account all the packages
【报错解决】ERROR: pip‘s dependency resolver does not currently take into account all the packages
1566 0
No package ‘libusb‘ found
No package ‘libusb‘ found
120 0
Unable to locate package autoreconf
Unable to locate package autoreconf
97 0
onfigure: error: cannot find install-sh, install.sh, or shtool in
onfigure: error: cannot find install-sh, install.sh, or shtool in
201 0
解决办法:.No package ‘freetype2‘ found
解决办法:.No package ‘freetype2‘ found
223 0
|
Ubuntu Java 关系型数据库
Linux:Unable to locate package错误解决办法
Linux:Unable to locate package错误解决办法
1014 0