为什么我不能在未受影响的 Ubuntu 21.04 上安装 apt-file?

For*_*vin 3 package-management apt 21.04

我刚刚创建了一个 Ubuntu 21.04 USB 拇指驱动器并在 Live/Try 模式下启动它。

我打开一个终端,运行sudo apt updatesudo apt-get install apt-file

ubuntu@ubuntu:~$ sudo apt update
Ign:1 cdrom://Ubuntu 21.04 _Hirsute Hippo_ - Release amd64 (20210420) hirsute InRelease
Hit:2 cdrom://Ubuntu 21.04 _Hirsute Hippo_ - Release amd64 (20210420) hirsute Release
Hit:4 http://archive.ubuntu.com/ubuntu hirsute InRelease                   
Get:5 http://archive.ubuntu.com/ubuntu hirsute-updates InRelease [109 kB]  
Get:6 http://security.ubuntu.com/ubuntu hirsute-security InRelease [101 kB]
Fetched 209 kB in 1s (286 kB/s)                                     
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
280 packages can be upgraded. Run 'apt list --upgradable' to see them.
ubuntu@ubuntu:~$ sudo apt-get install apt-file
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package apt-file 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 'apt-file' has no installation candidate
Run Code Online (Sandbox Code Playgroud)

但正如你所见,它失败了。

所以,我检查apt-cache,它应该确实可用:

ubuntu@ubuntu:~$ apt-cache dump | grep apt-file
Package: apt-file
  Depends: apt-file (null)
Run Code Online (Sandbox Code Playgroud)

然后我检查它是否已经安装:

ubuntu@ubuntu:~$ which apt-file
ubuntu@ubuntu:~$
Run Code Online (Sandbox Code Playgroud)

但是不...

然后我检查了在线数据库:https : //packages.ubuntu.com/hirsute/apt-file
再次它应该在那里。

然后我尝试,只是为了好玩,安装一个不同的包。sudo apt-get install ncdu,但我遇到了同样的错误......然后我尝试安装sudo apt-get install vim并且成功了!但是我仍然无法安装其他软件包。

这里发生了什么?

gui*_*erc 6

您提供的链接

https://packages.ubuntu.com/hirsute/apt-file

应该给你提示,它清楚地告诉你这是一个粗体的社区包(即在“ Universe ”中找到),虽然默认情况下启用了口味(即来自社区的发行版),但它需要为 Ubuntu 特定启用。

sudo add-apt-repository universe
Run Code Online (Sandbox Code Playgroud)

如果您的发行版是 LTS 发行版,则 Ubuntu ISO 上提供的软件包支持 5 年,而“universe”中的软件包没有 5 年支持(例如,对于 18.04,许多风格软件包都是 LTS,这意味着 3 年的支持,而其他不是LTS 意味着他们只有 9 个月的支持;例如Lubuntu Next [LXQt] 或 Ubuntu Studio 18.04不是LTS 产品)。通过默认情况下不启用“universe”,您知道在产品安装的整个生命周期内都支持所有软件包。

启用“universe”后,您将能够安装“universe”中的社区支持包

更多详情请查看https://help.ubuntu.com/community/Repositories/Ubuntu