在阿里云服务器(ubuntu操作系统)上采用apt 安装软件的时候会出现类似下面这样的错误:
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package gcc-multilib is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package gdb is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package git is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

感觉很明显就是下载源不对,如果是本地虚拟机的话可以使用Ubuntu的图形化界面修改下载来源,但是云服务器使用图形化界面就不太方便了。

事实上阿里云服务器已经做了相关的优化,
在命令行输入

sudo vim /etc/apt/sources.list

会发现其实阿里云服务器已经设置好了镜像路径

所以其实解决办法很简单:
输入

apt update

等update完之后就可以正常使用apt install了

更多推荐

阿里云服务器apt install 出错怎么办?出现Package gdb is not available, but is referred to by an