当使用yum
或 时dnf
,在要求确认安装或更新软件包之前会显示事务摘要,如下所示:
======================================================================================================================== 软件包 Arch 版本 存储库 大小 ======================================================================================================================== 安装: nodejs x86_64 1:6.14.3-1.el7 epel 4.7 M npm x86_64 1:3.10.10-1.6.14.3.1.el7 epel 2.5 M 安装依赖项: http 解析器 x86_64 2.7.1-5.el7_4 基础 28 k libuv x86_64 1:1.23.2-1.el7 epel 129 k 交易摘要 ======================================================================================================================== 安装 2 个包 (+2 个依赖包)
当使用apt
/时apt-get
,摘要如下所示:
将会安装以下新软件包: binutils binutils-common binutils-x86-64-linux-gnu build-essential cpp cpp-7 dpkg-dev fakeroot g++ g++-7 gcc gcc-7 gcc-7-base gyp javascript-common libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4 libatomic1 libbinutils libc-ares2 libc-dev-bin libc6-dev libcc1-0 libcilkrts5 libdpkg-perl libfakeroot libfile-fcntllock-perl libgcc-7-dev libgomp1 libhttp-parser2.7.1 libisl19 libitm1 libjs-async libjs-inherits libjs-jquery libjs-node-uuid libjs-underscore liblsan0 libmpc3 libmpx2 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libquadmath0 libssl1.0-dev libstdc++-7-dev libtsan0 libubsan0 libuv1-dev linux-libc-dev 制作 manpages-dev 节点缩写 节点ansi 节点ansi-color-table 节点archy 节点async 节点平衡匹配 节点块流 节点括号扩展节点内置模块节点组合流节点连接映射节点 cookie 罐节点延迟流 node-forever-agent node-form-data node-fs.realpath node-fstream node-fstream-ignore node-github-url-from-git node-glob node-graceful-fs node-gyp node-hosted-git-info node-inflight node-inherits node-ini node-is-builtin-module node-isexe node-json-stringify-safe node-lockfile node-lru-cache node-mime node-minimatch node-mkdirp node-mute-stream node-node-uuid node-nopt node-normalize-package-data node-npmlog node-once node-osenv node-path-is-absolute node-pseudomap node-qs node-read node-read-package-json node-request node-retry node-rimraf 节点 semver 节点 sha 节点幻灯片 节点 spdx 正确 节点 spdx 表达式解析 节点 spdx 许可证 ids 节点 tar node-tunnel-agent node-underscore node-validate-npm-package-license node-which node-wrappy node-yallist nodejs nodejs-dev nodejs-doc npm python python-minimal python-pkg-resources python2.7 python2.7-minimal 升级了 0 个,新安装了 125 个,删除了 0 个,并且未升级 0 个。 需要获取 2587 kB/51.1 MB 的档案。 此操作后,将使用227 MB的额外磁盘空间。
如你所见,在这种情况下,要安装的版本不明确。如果官方仓库中的最新包不是我需要的,我可能需要添加不同的仓库。所以在这种情况下,我必须apt-cache policy <package>
先运行以验证包版本。
我的问题是:此确认的格式是否可以配置?我可以像yum
之前一样显示软件包版本吗?
答案1
解决方法是,首先在模拟模式-s
。在下面的代码中,我想知道如果我安装的话,我的 Kubuntu 18.04 上会安装什么gedit
:
$ apt install -s gedit
NOTE: This is only a simulation!
apt needs root privileges for real execution.
Keep also in mind that locking is deactivated,
so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
gedit-common gir1.2-gtksource-3.0 gir1.2-peas-1.0 libgspell-1-1 libgspell-1-common libpeas-1.0-0 libpeas-common
Suggested packages:
gedit-plugins
The following NEW packages will be installed:
gedit gedit-common gir1.2-gtksource-3.0 gir1.2-peas-1.0 libgspell-1-1 libgspell-1-common libpeas-1.0-0 libpeas-common
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Inst libgspell-1-common (1.6.1-1 Ubuntu:18.04/bionic [all])
Inst libgspell-1-1 (1.6.1-1 Ubuntu:18.04/bionic [amd64])
Inst libpeas-common (1.22.0-2 Ubuntu:18.04/bionic [all])
Inst libpeas-1.0-0 (1.22.0-2 Ubuntu:18.04/bionic [amd64])
Inst gir1.2-gtksource-3.0 (3.24.7-1 Ubuntu:18.04/bionic [amd64])
Inst gedit-common (3.28.1-1ubuntu1 Ubuntu:18.04/bionic [all])
Inst gir1.2-peas-1.0 (1.22.0-2 Ubuntu:18.04/bionic [amd64])
Inst gedit (3.28.1-1ubuntu1 Ubuntu:18.04/bionic [amd64])
Conf libgspell-1-common (1.6.1-1 Ubuntu:18.04/bionic [all])
Conf libgspell-1-1 (1.6.1-1 Ubuntu:18.04/bionic [amd64])
Conf libpeas-common (1.22.0-2 Ubuntu:18.04/bionic [all])
Conf libpeas-1.0-0 (1.22.0-2 Ubuntu:18.04/bionic [amd64])
Conf gir1.2-gtksource-3.0 (3.24.7-1 Ubuntu:18.04/bionic [amd64])
Conf gedit-common (3.28.1-1ubuntu1 Ubuntu:18.04/bionic [all])
Conf gir1.2-peas-1.0 (1.22.0-2 Ubuntu:18.04/bionic [amd64])
Conf gedit (3.28.1-1ubuntu1 Ubuntu:18.04/bionic [amd64])
$