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

我的Ubuntu有时候运行得有点慢。现在我想检查一下是否所有的软件包都还安装着,也许我卸载了一个重要的软件包。
我该如何重新检查是否所有的初始软件包都还安装着?

实际上,在安装过程中,清单中的某些软件包将被删除,例如GParted,Ubiquity,各种语言包等。 - muru
我可以用egrep -v '(language-pack|ubiquity|linux-)来过滤掉这些,有什么我漏掉的吗? - rubo77
不确定,但我猜测一下。 - muru
1个回答

在每个发行版的清单文件中,有一个完整的列表,位于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

对于32位系统,请使用另一个以desktop-i386.manifest结尾的清单文件。
wget http://releases.ubuntu.com/utopic/ubuntu-14.10-desktop-i386.manifest -q -O - | cut -f 1 > packages.manifest.list 

现在只需弄清楚如何忽略那些在安装时被删除的软件包,比如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

已删除的软件包完整列表此处