AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1387775
Accepted
Noob
Noob
Asked: 2022-01-19 07:25:25 +0800 CST2022-01-19 07:25:25 +0800 CST 2022-01-19 07:25:25 +0800 CST

sudo apt upgrade 回显/输出解释中的差异

  • 772

我运行 Ubuntu 20.04,刚刚跑了sudo apt update两次,发布了下面的输出。

我的问题:

  • 为什么 2 apt run 不同?(1 到 16 另一个到 4)

(仅供参考:我在sudo apt upgrade两者之间做了一个,但我用 Ctrl+C 取消了它)

blabla@PMQG:~$ sudo apt update
[sudo] password for noob: 
Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]    
Hit:2 http://de.archive.ubuntu.com/ubuntu focal InRelease                    
Get:3 http://de.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:4 http://de.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:5 http://de.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [279 kB]
Get:6 http://security.ubuntu.com/ubuntu focal-security/main i386 Packages [356 kB]
Get:7 http://de.archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [363 kB]
Get:8 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [1.135 kB]
Get:9 http://de.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [944 B]
Get:10 http://de.archive.ubuntu.com/ubuntu focal-backports/main amd64 DEP-11 Metadata [8.012 B]
Get:11 http://de.archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [11,3 kB]
Get:12 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [38,2 kB]
Get:13 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [675 kB]
Get:14 http://security.ubuntu.com/ubuntu focal-security/universe i386 Packages [532 kB]
Get:15 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [66,3 kB]
Get:16 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 DEP-11 Metadata [2.464 B]
Fetched 3.804 kB in 8s (448 kB/s)                                              
Reading package lists... Done
Building dependency tree       
Reading state information... Done
3 packages can be upgraded. Run 'apt list --upgradable' to see them.



blabla@PMQG:~$ apt list --upgradable 
Listing... Done
linux-generic-hwe-20.04/focal-updates 5.13.0.25.26~20.04.12 amd64 [upgradable from: 5.11.0.46.51~20.04.23]
linux-headers-generic-hwe-20.04/focal-updates 5.13.0.25.26~20.04.12 amd64 [upgradable from: 5.11.0.46.51~20.04.23]
linux-image-generic-hwe-20.04/focal-updates 5.13.0.25.26~20.04.12 amd64 [upgradable from: 5.11.0.46.51~20.04.23]

blabla@PMQG:~$ sudo apt update
[sudo] password for noob: 
Hit:1 http://security.ubuntu.com/ubuntu focal-security InRelease             
Hit:2 http://de.archive.ubuntu.com/ubuntu focal InRelease                    
Hit:3 http://de.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:4 http://de.archive.ubuntu.com/ubuntu focal-backports InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
3 packages can be upgraded. Run 'apt list --upgradable' to see them.




updates
  • 2 2 个回答
  • 140 Views

2 个回答

  • Voted
  1. Best Answer
    karel
    2022-01-20T03:54:28+08:002022-01-20T03:54:28+08:00

    您从中下载更新的镜像会跟踪用户上次从您的 Ubuntu 连接到更新服务器的时间。它可以通过将您尝试更新的已安装软件列表与从同一个镜像下载更新的 Ubuntu 用户保存的已安装软件列表进行比较,从而智能地猜测连接到哪个 Ubuntu 实例。如果您最近连接到更新服务器,那么它会为您提供上次连接到该镜像的增量更改,并从它们的源重新同步包索引文件,而不是让您每次都从它们的源下载所有包索引文件如果您更改为不同的更新服务器,您必须这样做。

    • 1
  2. Artur Meinild
    2022-01-20T04:47:14+08:002022-01-20T04:47:14+08:00

    为了进一步解释这篇文章:运行 apt-get update 时,或意味着什么?IgnGetHit (我仍然认为这是问答是重复的..)

    回顾:

    • Hit意味着 apt 检查了包列表(Release/ InRelease* 和Index文件)上的时间戳,它们匹配并且没有更改。

    • Get意味着 apt 检查了包列表(Release/ InRelease* 和Index文件)上的时间戳,有更改并将被下载。

    因此,第一次运行时, 4 个存储库中的 3 个文件(前 4 行返回的文件)以及底层组件的文件(最后 12 行)sudo apt update发生了更改。InReleaseGetIndex

    但是,第二次运行时sudo apt update,它只有文件,Hits这InRelease意味着基础文件没有更改Index。

    因此,apt不必费心再次检查底层Index文件,因为它知道这次没有更改(因为所有InRelease文件都返回了Hit)。

    focal第一次运行的最后 12 行中没有一个包含repo ,这一事实进一步证明了这一点。所有后续的GetsorHits都来自focal-security,focal-updates并且focal-backports- 只有那些Get从InRelease文件中返回 a 的 3 个。

    * :和files之间的区别:文件是内联签名的,而文件应该有一个随附的 Release.gpg 文件。ReleaseInReleaseInReleaseRelease

    • 0

相关问题

  • 无法更新雷鸟

  • 如何从命令行仅安装安全更新?关于如何管理更新的一些提示

  • iPod Touch (iPhone) 的固件更新?

  • 如何让 Ubuntu 减少检查更新的频率?对于 11.04 及更高版本对于赶时间的人!通过 Ubuntu 软件中心

  • 如何启用自动更新?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve