Remove package and purge configuration files (apt)
apt remove --purge package1
Removes the package and its installed files, and with --purge also removes system-wide configuration files from /etc and dpkg's info so the package is fully removed.