sudo apt-get install和sudo apt install有什么区别

我从sudo apt-get install安装了很多软件包,但是当我键入sudo apt --help它直接选择通过sudo apt install [package name]进行安装……那么,这两者有什么区别? 如果我不使用’get’和’apt’,有什么问题吗?

不多。 apt是一个新命令,它应该将apt-getapt-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库上的新接口),因此可能存在一些边缘情况的变化。

还有一些明显的遗漏( downloadpolicy等),权力用户会错过,并且有大量未记录的命令( purge仍然有效,但我找不到任何东西)。

16.04更新:现在已经包含了很多遗漏但尚未记录,也没有Bash完成。 很遗憾,实现代码库中已经存在的function需要很长时间,但是很好。 我的建议是,如果你习惯了apt-{get,cache}命令,那就试试apt 。 它可能会奏效。


man apt页面中, DIFFERENCES TO APT-GET(8)部分也有一个DIFFERENCES TO APT-GET(8)之处:

  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-completions,我已经尝试为它编写一个完成文件 。 这些都包含在以后的Ubuntu安装中。