We have examined the apt-get
and its commands in a detailed manner previously. apt-get
is used to manage installed packages in a Linux distribution like Ubuntu, Debian, Mint, Kali, etc. Here we will look simply sudo apt-get update
and related commands to update a deb based Linux distribution. For detailed tutorials look following.
先前,我们已经详细地检查了apt-get
及其命令。 apt-get
用于管理Linux发行版中的已安装软件包,如Ubuntu,Debian,Mint,Kali等。在这里,我们将简单地看一下sudo apt-get update
和相关命令来更新基于debLinux发行版。 有关详细的教程,请参见以下内容。
How To Apt-Get Update, Upgrade, Dist-Upgrade, Full-Upgrade and Their Similarities and Diffirencies
如何Apt-Get更新,升级,远程升级,完整升级及其相似性和差异
How To Install Updates In Ubuntu, Debian, Mint, Kali
如何在Ubuntu,Debian,Mint,Kali中安装更新
使用“ sudo”获取root特权(Get Root Privileges with “sudo”)
Actually this is not separate command or step. It is used with apt-get update
but I wanted to explain in detail. apt-get
command requires root-level privileges to change package database. This is security enforcement for the Linux systems. In order to write changes to the apt database, we need to be root or root-level user or gain privilege with sudo command. For example, the following command will run as root and provide root
user information.
实际上,这不是单独的命令或步骤。 它与apt-get update
一起使用,但我想详细解释。 apt-get
命令需要root级特权才能更改软件包数据库。 这是Linux系统的安全性强制措施。 为了将更改写入apt数据库,我们需要是root或root级用户或使用sudo命令获得特权。 例如,以下命令将以root身份运行并提供root
用户信息。
$ sudo whoami
![Get Root Privileges with "sudo"](https://i-blog.csdnimg.cn/blog_migrate/ffd8f0fcae0abe38b7c7ceca80ed3351.png)
更新有关存储库的软件包信息(Update Package Information About Repositories)
Now we will examine the real command sudo apt-get update
. This command will update the deb or apt-get package database. The newer version information will be written into this database. But keep in mind that packages will not be upgraded as it is separate or the next step. This is useful if we want to upgrade some specific packages and do not upgrade others.
现在,我们将检查真正的命令sudo apt-get update
。 此命令将更新deb或apt-get软件包数据库。 较新的版本信息将被写入此数据库。 但是请记住,软件包将不会升级,因为它们是单独的或下一步。 如果我们要升级某些特定的软件包,而不升级其他软件包,这将很有用。
Update information will be fetched from configured repositories which are us repositories in this example as we can see. This will only download packages metadata that have updates and do not download whole packages.
如我们所见,将从配置的存储库中获取更新信息,该存储库是本示例中的我们的存储库。 这只会下载具有更新的软件包元数据,而不会下载整个软件包。
$ sudo apt-get update
![Update Package Information About Repositories](https://i-blog.csdnimg.cn/blog_migrate/e41f86b682709b6e042a103045f2dde7.png)
升级套餐(Upgrade Packages)
The last step is upgrading the packages. We have already the information about updates and this step will trigger the upgrade process the real packages will be downloaded, installed and configured accordingly. We will use sudo apt-get upgrade
which requires root privileges too.
最后一步是升级软件包。 我们已经有了有关更新的信息,此步骤将触发升级过程,实际的软件包将进行相应的下载,安装和配置。 我们将使用sudo apt-get upgrade
,它也需要root特权。
$ sudo apt-get upgrade
![Upgrade Packages](https://i-blog.csdnimg.cn/blog_migrate/645e9f85489323129b68cc8246138302.png)