“ sudo apt-get更新”有什么作用?

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"
Get Root Privileges with “sudo”
使用“ sudo”获取root特权

更新有关存储库的软件包信息(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
Update Package Information About Repositories
更新有关存储库的软件包信息

升级套餐(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
Upgrade Packages
升级套餐
LEARN MORE  Apt Command "Hash Sum mismatch" Error and Solution On Ubuntu, Debian, Mint, Kali
在Ubuntu,Debian,Mint和Kali上了解更多Apt命令“哈希和不匹配”的错误和解决方案

翻译自: https://www.poftut.com/sudo-apt-get-update/

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值