我安装了许多软件包,sudo apt-get install
但是当我键入时sudo apt --help
,直接给出了通过sudo apt install [package name]
...进行安装的选项。因此,两者之间有什么区别?如果我不将'get'与'apt'一起使用,是否有任何问题?
不多。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安装中。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句