List manually installed packages
apt-mark showmanual
apt list '~i!~M'
List and remove packages with remaining configuration files
apt list '~c'
apt purge '~c'
List and remove packages not found in repositories
apt list '~o'
apt purge '~o'
Show holds
apt-mark showhold
More aggressive way to auto purge packages
apt -o 'Apt::AutoRemove::SuggestsImportant=false' autopurge
Even more aggressive way to auto purge packages
apt -o 'Apt::AutoRemove::SuggestsImportant=false' -o 'Apt::AutoRemove::RecommendsImportant=false' autopurge
Find leftover configuration files
find /etc -name '*.dpkg-*' -o -name '*.ucf-*' -o -name '*.merge-error'
Install systemd-resolved
sudo apt install systemd-resolved
Configure the following in /etc/systemd/resolved.conf
DNS=194.242.2.4#base.dns.mullvad.net
DNSOverTLS=yes
Domains=~.
Disable IPv4 and IPv6 Auto DNS in the Settings GUI, then switch the network off and on for these settings to take effect
Restart systemd-resolved and NetworkManager
sudo systemctl restart systemd-resolved NetworkManager
Verify the DNS settings
resolvectl status