[英]How to compare installed Linux packages between two machines
我需要显示Linux软件包的列表,这些Linux软件包的版本在“构建机器”和各种“开发者机器”之间可能会随构建VM的不同而有所差异。
通过执行“ dpkg –l”可以获得安装在黄金VM上的软件包相对于其他设备的文本转储,然后在两个列表中执行“ diff”或“ awk grep”之类的事情,我可以走得很远。我想知道是否已经有一种工具比我为该工作编写脚本更好的工作。
你们是怎么做到的?
让 - 皮埃尔·
我只是编写了此脚本,它还比较了软件包版本:
https://github.com/lepe/scripts/blob/master/compare_ubuntu_apt.pl
用法:
1)在两台计算机上生成软件包列表,例如:
apt --installed list | tail -n+2 > that_server.lst
2)执行perl脚本:
./compare_ubuntu_apt.pl this_server.lst that_server.lst
结果:(示例)
----------------------------------
DIFFERENCES
----------------------------------
@ apparmor : 2.8.95~2430-0ubuntu5.2 -> 2.8.95~2430-0ubuntu5.3
@ apt : 1.0.1ubuntu2.8 -> 1.0.1ubuntu2.10
@ apt-transport-https : 1.0.1ubuntu2.8 -> 1.0.1ubuntu2.10
@ apt-utils : 1.0.1ubuntu2.8 -> 1.0.1ubuntu2.10
@ base-files : 7.2ubuntu5.2 -> 7.2ubuntu5.3
@ bash-completion : 1:2.1-4 -> 1:2.1-4ubuntu0.1
----------------------------------
MISSING IN this_server.lst
----------------------------------
+ acl : 2.2.52-1
+ acpid : 1:2.0.21-1ubuntu2
+ apport : 2.14.1-0ubuntu3.11
+ apport-symptoms : 0.20
+ at : 3.1.14-1ubuntu1
+ at-spi2-core : 2.10.2.is.2.10.1-0ubuntu1
+ attr : 1:2.4.47-1ubuntu1
+ autotools-dev : 20130810.1
----------------------------------
MISSING IN that_server.lst
----------------------------------
- apcupsd : 3.14.10-2build1
- apcupsd-doc : 3.14.10-2build1
- beep : 1.3-3
- btrfs-tools : 3.12-1
- discover : 2.1.2-5.2ubuntu1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.