Ubuntu MATE 21.04: is it safe to remove Debian keyring GPG files?
I just noticed that, there are alot of Debian keyring GPG files inside /usr/share/keyrings/
directory of my Ubuntu MATE 21.04 installation (which have been upgraded from previous versions regularly).
$ ls -lsh /usr/share/keyrings/
total 32M
12K -rw-r--r-- 1 root root 8.5K Mar 26 16:41 debian-archive-bullseye-automatic.gpg
12K -rw-r--r-- 1 root root 8.6K Mar 26 16:41 debian-archive-bullseye-security-automatic.gpg
4.0K -rw-r--r-- 1 root root 2.4K Mar 26 16:41 debian-archive-bullseye-stable.gpg
8.0K -rw-r--r-- 1 root root 8.0K Mar 26 16:41 debian-archive-buster-automatic.gpg
8.0K -rw-r--r-- 1 root root 8.0K Mar 26 16:41 debian-archive-buster-security-automatic.gpg
4.0K -rw-r--r-- 1 root root 2.3K Mar 26 16:41 debian-archive-buster-stable.gpg
56K -rw-r--r-- 1 root root 55K Mar 26 16:41 debian-archive-keyring.gpg
40K -rw-r--r-- 1 root root 37K Mar 26 16:41 debian-archive-removed-keys.gpg
8.0K -rw-r--r-- 1 root root 7.3K Mar 26 16:41 debian-archive-stretch-automatic.gpg
8.0K -rw-r--r-- 1 root root 7.3K Mar 26 16:41 debian-archive-stretch-security-automatic.gpg
4.0K -rw-r--r-- 1 root root 2.3K Mar 26 16:41 debian-archive-stretch-stable.gpg
28M -rw-r--r-- 1 root root 28M Mar 25 02:40 debian-keyring.gpg
2.6M -rw-r--r-- 1 root root 2.6M Mar 25 02:40 debian-maintainers.gpg
772K -rw-r--r-- 1 root root 771K Mar 25 02:40 debian-nonupload.gpg
28K -rw-r--r-- 1 root root 26K Mar 25 02:40 debian-role-keys.gpg
4.0K -rw-r--r-- 1 root root 2.3K May 11 15:49 ubuntu-advantage-cis.gpg
4.0K -rw-r--r-- 1 root root 2.2K May 11 15:49 ubuntu-advantage-esm-apps.gpg
4.0K -rw-r--r-- 1 root root 2.3K May 11 15:49 ubuntu-advantage-esm-infra-trusty.gpg
4.0K -rw-r--r-- 1 root root 2.3K May 11 15:49 ubuntu-advantage-fips.gpg
8.0K -rw-r--r-- 1 root root 7.3K Sep 18 2018 ubuntu-archive-keyring.gpg
8.0K -rw-r--r-- 1 root root 6.6K Oct 27 2016 ubuntu-archive-removed-keys.gpg
4.0K -rw-r--r-- 1 root root 3.0K Mar 27 05:04 ubuntu-cloudimage-keyring.gpg
0 -rw-r--r-- 1 root root 0 Jan 17 2018 ubuntu-cloudimage-removed-keys.gpg
4.0K -rw-r--r-- 1 root root 1.2K May 27 2010 ubuntu-master-keyring.gpg
$
When I compared this with a fresh, virtual installation of Ubuntu MATE 21.04, it only had Ubuntu keyring files.
So, is it safe to remove those Debian keyring files? Thanks.
Edit-1:
dpkg -S /usr/share/keyrings/debian-* | awk -F: '{print $1}' | sort -u
debian-archive-keyring
debian-keyring
aptitude why debian-archive-keyring
i packaging-dev Recommends ubuntu-dev-tools
i A ubuntu-dev-tools Recommends debian-archive-keyring
aptitude why debian-keyring
i packaging-dev Recommends ubuntu-dev-tools
i A ubuntu-dev-tools Recommends debian-keyring
Direct removal of files is a bad idea.
You can remove their packages - find them by
dpkg -S '/usr/share/keyrings/debian-*' | awk -F: '{print $1}' | sort -u
and then remove by
sudo apt-get purge $(dpkg -S '/usr/share/keyrings/debian-*' | awk -F: '{print $1}' | sort -u)
For example on my 18.04 LTS I see two packages debian-archive-keyring and debian-keyring. Aptitude says that they were installed as recommendations:
$ aptitude why debian-archive-keyring i bikeshed Recommends ubuntu-dev-tools i A ubuntu-dev-tools Recommends debian-archive-keyring $ aptitude why debian-keyring i bikeshed Recommends ubuntu-dev-tools i A ubuntu-dev-tools Recommends debian-keyring
You can try to execute all above commands on your machine and then decide.
For my machine it is safe to remove these keyrings, I'll save about 35,6 MB.