5 # Import is_package_installed
6 .
/usr
/local
/lib
/tails-shell-library
/common.sh
8 echo "Removing unwanted packages"
10 ### Deinstall dev packages.
12 # We use apt-get as aptitude doesn't know about globs.
13 # There are packages we could be tempted to remove but we can't:
14 # - gcc-*-base (libstdc++6 depends on it)
15 # - libgcc1 (apt depends on it)
16 # - cpp, cpp-* (big parts of GNOME depend on it)
29 '^libgcc-[0-9]+-dev$' \
34 ### Deinstall a few unwanted packages that were pulled by tasksel
35 ### since they have Priority: standard.
41 ### We'll remove packages listed in this variable. It's purpose is to
42 ### gather *several* packages we might want to remove below and purge
43 ### then at the same time, which has less overhead than purging them
47 ### Remove packages that can get a different priority in the security
48 ### archive (see https://bugs.debian.org/867668).
49 for package
in mutt rpcbind tcpd
; do
50 if is_package_installed
"${package}"; then
51 packages_to_purge
="${packages_to_purge} ${package}"
55 ### Remove unwanted packages that might, or might not,
56 ### have been installed during the build.
57 for package
in gcc-7 libgcc-7-dev procmail
; do
58 if is_package_installed
"${package}"; then
59 packages_to_purge
="${packages_to_purge} ${package}"
63 if [ -n "${packages_to_purge}" ]; then
64 apt-get
--yes purge
"${packages_to_purge}"
67 ### Deinstall some other unwanted packages.
75 ### Deinstall some other unwanted packages whose regexp might not be match
76 ### anything when building with partial, tagged APT snapshots.
77 if dpkg
--get-selections |
grep -qs -E '^geoclue'; then
78 apt-get
--yes purge
'^geoclue*'
80 if dpkg
--get-selections |
grep -qs -E '^exim4'; then
81 apt-get
--yes purge
'^exim4*'
84 ### Deinstall dependencies of the just removed packages.
85 apt-get
--yes --purge autoremove