在 "dpkg --get-selections" 和基于 ubuntu 之间获取差异?

Getting diff between "dpkg --get-selections" and base on ubuntu?

我知道 "dpkg --get-selections" 会列出我在 Ubuntu 上安装的软件包,但是有没有聪明的方法来区分它和基本软件包之间的差异。

换句话说:

  1. 我安装 Ubuntu,比如 14.04LTS
  2. 我安装了一个包,比方说"apt-get install apache"
  3. 有没有我可以 运行 会说 "you installed apache after your initial install"
  4. 的命令

使用 tasksel 确定基本系统中的软件包列表。

tasksel --task-packages ubuntu-desktop | sort > /tmp/base
dpkg --get-selections | awk '{print }' | sort >/tmp/selections
diff -u /tmp/base /tmp/selections | less

使用tasksel --list-tasks获取任务列表。

但是获取手动安装的软件包列表的最佳方法是在安装操作系统后立即保存 dpkg --get-selection 输出。