Ubuntu 20.04.1 LTS:“ubuntu-security-status”显示“0 使用 LTS 接收软件包更新”。我需要担心吗?

Ubuntu 20.04.1 LTS:“ubuntu-security-status”显示“0 使用 LTS 接收软件包更新”。我需要担心吗?

可能有东西坏了。在我的机器上我看到了以下内容:

# ubuntu-security-status 
2131 packages installed, of which:
   0 receive package updates with LTS until 4/2025
2131 packages are from third parties

Packages from third parties are not provided by the official Ubuntu
archive, for example packages from Personal Package Archives in
Launchpad.
For more information on the packages, run 'ubuntu-security-status
--thirdparty'.

This machine is not attached to an Ubuntu Advantage subscription.
See https://ubuntu.com/advantage

什么东西坏了?什么原因导致ubuntu-security-status0 receive package updates with LTS until 4/2025

笔记

  • 第二台机器曾经是 12.04,后来一直更新到 20.04.1,现在显示了类似的输出。
  • 我使用如下所示的 apt-cache 192.168.XX.XX:3142
  • ddebs需要为了stap发挥作用
  • /etc/apt/sources.list为 0 字节,因为所有内容都在下面管理/etc/apt/sources.list.d/
  • 系统最初安装的是20.04,现在是20.04.1

有关我的机器的更多信息:

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:        20.04
Codename:       focal

$ uname -a
Linux XXXX 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

# apt update && apt upgrade
Hit:1 http://packages.microsoft.com/repos/vscode stable InRelease
Ign:2 https://apache.bintray.com/couchdb-deb focal InRelease        
Hit:3 http://dl.google.com/linux/chrome/deb stable InRelease        
Get:4 https://apache.bintray.com/couchdb-deb focal Release [1838 B]
Hit:5 http://192.168.XX.XX:3142/de.archive.ubuntu.com/ubuntu focal InRelease
Hit:7 http://192.168.XX.XX:3142/de.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:8 http://192.168.XX.XX:3142/de.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:9 http://192.168.XX.XX:3142/security.ubuntu.com/ubuntu focal-security InRelease
Ign:10 http://192.168.XX.XX:3142/ddebs.ubuntu.com focal InRelease
Ign:11 http://192.168.XX.XX:3142/ddebs.ubuntu.com focal-updates InRelease
Ign:12 http://192.168.XX.XX:3142/ddebs.ubuntu.com focal-proposed InRelease
Hit:13 http://192.168.XX.XX:3142/ddebs.ubuntu.com focal Release
Hit:15 http://192.168.XX.XX:3142/ddebs.ubuntu.com focal-updates Release
Hit:17 http://192.168.XX.XX:3142/ddebs.ubuntu.com focal-proposed Release
Fetched 1838 B in 3s (551 B/s)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

答案1

该程序的逻辑是测试软件包源,看它们是否来自archive.canonical.com。如果不是,则假定它们是第三方的。

通过将 apt 源从其当前 URL 更改为 archive.canonical.com 来进行测试。然后再次运行 ubuntu-security-status。它应该可以正常工作。

这可以说是一个错误,因为使用一些合法镜像和 apt-proxies 的人会得到虚假结果。这是一个 Python 3 脚本 (/usr/bin/ubuntu-security-status),因此欢迎任何人遵循逻辑并编写解决方案以做出贡献。

答案2

为了读者的利益,感谢user535733 的回答我找到了如何在不更改 Ubuntu 脚本的情况下解决此问题的方法。

/usr/bin/ubuntu-security-status识别$MY_MIRROR变量以提供额外的官方镜像。只需稍加调整,即可自动填充此变量。如下所示:

MY_MIRROR="$(sed -n '/^#MIRROR#//p' /etc/apt/sources.list.d/*.conf)" /usr/bin/ubuntu-security-status

您只需添加以下形式的行

#MIRROR# URL

到你的文件中来/etc/apt/sources.list.d/*.list提示这个 hack。

示例运行:

# grep '^#MIRROR#' /etc/apt/sources.list.d/*.list
/etc/apt/sources.list.d/20.04.list:#MIRROR# http://192.168.XX.XX:3142/de.archive.ubuntu.com/ubuntu/
/etc/apt/sources.list.d/20.04.list:#MIRROR# http://192.168.XX.XX:3142/security.ubuntu.com/ubuntu/
/etc/apt/sources.list.d/20.04.list:#MIRROR# http://192.168.XX.XX:3142/ddebs.ubuntu.com
#
# MY_MIRROR="$(sed -n 's/^#MIRROR#//p' /etc/apt/sources.list.d/*.list)" 
2412 packages installed, of which:
1835 receive package updates with LTS until 4/2025
 574 could receive security updates with ESM Apps until 4/2030
   3 packages are from third parties

Packages from third parties are not provided by the official Ubuntu
archive, for example packages from Personal Package Archives in
Launchpad.
For more information on the packages, run 'ubuntu-security-status
--thirdparty'.

Enable Extended Security Maintenance (ESM Apps) to get 2 security
updates (so far) and enable coverage of 574 packages.

This machine is not attached to an Ubuntu Advantage subscription.
See https://ubuntu.com/advantage

#

我将添加此解决方案到我的更新脚本很快。

相关内容