检查是否从 Ubuntu 清单安装了所有默认软件包

rub*_*o77 5 package-management

我的 Ubuntu 有时运行速度有点慢。现在我想检查是否所有软件包都已安装,也许我卸载了一个重要的软件包。

如何重新检查所有初始软件包是否仍然安装?

rub*_*o77 5

http://releases.ubuntu.com上每个发行版的清单文件中有一个完整列表

要生成列表,请使用

cd /tmp/
# 14.10: $ wget http://old-releases.ubuntu.com/releases/utopic/ubuntu-14.10-desktop-amd64.manifest
# 16.04.2: $ wget http://releases.ubuntu.com/releases/xenial/ubuntu-16.04.2-desktop-amd64.manifest
# for 16.10: 
wget http://releases.ubuntu.com/releases/16.10/ubuntu-16.10-desktop-amd64.manifest \
     -q -O - | cut -f 1 > packages.manifest.list
# compare it with the list generated by 
dpkg --get-selections  | cut -f 1 > packages.installed.list
# from moreutils you can use combine:
combine packages.manifest.list not packages.installed.list > packages.diff.list
Run Code Online (Sandbox Code Playgroud)

对于 32 位,使用另一个带有结尾的清单desktop-i386.manifest

wget http://releases.ubuntu.com/utopic/ubuntu-14.10-desktop-i386.manifest -q -O - | cut -f 1 > packages.manifest.list 
Run Code Online (Sandbox Code Playgroud)

现在只要弄清楚如何忽略那些在安装时删除的包,例如 GParted、Ubiquity、各种语言包等:

IGNORE="language-pack|ubiquity|linux-|locale-|spell-|-help-|hyphen-|l10n|wbrazilian|wfrench|witalian|wportuguese|wspanish|mythes-"
cat packages.diff.list |egrep -v '('$IGNORE')' |less
Run Code Online (Sandbox Code Playgroud)

(已删除软件包的完整列表在这里