ubuntu apt-get update的作用

Posted 庐州月光

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ubuntu apt-get update的作用相关的知识,希望对你有一定的参考价值。

问题:

测试docker ubuntu镜像,无法直接通过apt-get install安装常用的包。

输入apt-get update命令之后,可以正常安装。

记录:

apt-get update
Get:1 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:5 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [761 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1344 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB]
Get:8 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [795 kB]
Get:9 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [6781 B]
Get:10 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [19.2 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [13.5 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1322 kB]
Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [10.5 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [32.7 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [1057 kB]
Get:17 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [4244 B]
Get:18 http://archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages [2496 B]
Fetched 17.4 MB in 7s (2558 kB/s)
Reading package lists... Done

 

理解:

从运行过程可以看出,update读取所有源的软件列表,需要联网下载,作用是激活和更新源。 

以上是关于ubuntu apt-get update的作用的主要内容,如果未能解决你的问题,请参考以下文章

Docker Ubuntu apt-get update 错误 Temporary failure resolving

ubuntu apt-get update错误

关于ubuntu安装软件的问题:apt-get和dpkg区别?

Ubuntu apt-get update 失败

Ubuntu用sudo apt-get update出错:E: Problem executing scripts APT::Update::Post-Invoke-Success

ubuntu apt-get update 失败解决