
我安裝了許多軟體包,sudo apt-get install
但是當我輸入時, sudo apt --help
它給出了直接安裝的選項sudo apt install [package name]
... 那麼,兩者之間有什麼區別?如果我不將“get”與“apt”一起使用,是否會出現任何問題?
答案1
不多。apt
是一個新命令,應該將多個功能合併apt-get
到apt-cache
一個命令中。它的邊緣仍然有點粗糙,但以下是命令列表--help
:
Basic commands:
list - list packages based on package names
search - search in package descriptions
show - show package details
update - update list of available packages
install - install packages
remove - remove packages
upgrade - upgrade the system by installing/upgrading packages
full-upgrade - upgrade the system by removing/installing/upgrading packages
edit-sources - edit the source information file
等效函數被設計為以類似的方式工作,但它不是代理命令(它不調用舊命令 - 它是直接連接到 Apt 庫的新介面),因此可能會有一些邊緣情況的更改。
還有一些高級用戶會錯過的明顯遺漏(download
、policy
等),並且有大量未記錄的命令(purge
仍然有效,但我找不到任何內容)。
16.04更新:現在已經包含了許多遺漏,但尚未記錄,也沒有 Bash 補全。遺憾的是,花了這麼長時間來實現程式碼庫中已經存在的功能,但哦,好吧。我的建議是,如果您習慣了apt-{get,cache}
命令,請嘗試一下apt
。它可能會起作用。
DIFFERENCES TO APT-GET(8)
該頁面還有一個man apt
有趣的部分:
The apt command is meant to be pleasant for end users and does
not need to be backward compatible like apt-get(8). Therefore
some options are different:
· The option DPkgPM::Progress-Fancy is enabled.
· The option APT::Color is enabled.
· A new list command is available similar to dpkg --list.
· The option upgrade has --with-new-pkgs enabled by default.
如果你想要 Bash 補全,我已經有了嘗試編寫完成文件已經為它了。這些包含在以後的 Ubuntu 安裝中。