当我运行“sudo apt install ...”时缺少软件包

当我运行“sudo apt install ...”时缺少软件包

我使用 Ubuntu 16.04。APT 似乎找不到该软件包m4

root@kevin:/# sudo apt install m4

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package m4 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

E: Package 'm4' has no installation candidate

我跑了:

sudo apt-get upgrade && apt-get update

这并没有什么区别。

root@kevin:/# grep main /etc/apt/sources.list
# deb cdrom:[Ubuntu 16.04.3 LTS _Xenial Xerus_ - Release amd64 (20170801)]/ xenial main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
## extensively as that contained in the main release, although it includes
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted

答案1

您的文件sources.list不包含任何二进制源。

转到系统设置->软件和更新,并在第一个选项卡中启用所有源。

然后系统会建议更新,您将能够从存储库安装所有内容。

答案2

您的命令后面sudo apt-get upgrade && apt-get update没有必要的第二个命令,因此 apt 没有正确更新所需的权限。sudo&&

请运行sudo apt update。然后您就可以安装 m4 了。

相关内容