update、upgrade、dist-upgrade三者的區別

update:  

update is used to resynchronize the packageindex files from their sources. The indexes of available packages are fetchedfrom the location(s) specified in /etc/apt/sources.list. For example, whenusing a Debian archive, this command retrieves and scans the Packages.gz files,so that information about new and updated packages is available. An updateshould always be performed before an upgrade or dist-upgrade. Please be awarethat the overall progress meter will be incorrect as the size of the packagefiles cannot be known in advance.

upgrade:

upgrade is used to install the newestversions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list.Packages currently installed with new versions available are retrieved and upgraded; under no circumstancesare currently installed packages removed, or packages not already installed retrieved and installed. Newversions of currently installed packages that cannot be upgraded without changing the install statusof another package will be left at their current version. An update must be performed first so that apt-getknows that new versions of packages are available.

dist-upgrade:

 dist-upgrade in addition to performing the function of upgrade, alsointelligently handles changing dependencies with new versions of packages; apt-get has a"smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of lessimportant ones if necessary. The /etc/apt/sources.list file contains a list of locations from which toretrieve desired package files. See also apt_preferences(5) for a mechanism for overriding the generalsettings for individual packages.

上面內容均是從apt-get的man文檔裏面截取下來的,從英文內容我們可以知道:

update:當執行apt-get update時,update重點更新的是來自軟件源的軟件包的索引記錄(即index files)。

upgrade:當執行apt-get upgrade時,upgrade是根據update更新的索引記錄來下載並更新軟件包。

dist-upgrade:當執行apt-get dist-upgrade時,除了擁有upgrade的全部功能外,dist-upgrade會比upgrade更智能地處理需要更新的軟件包的依賴關係。

從上述可以看出,在執行apt-get upgrade和apt-get dist-upgrade之前應該先執行apt-get update。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章