To piggyback on @ArturMeinild answer, I'd like to add a general explanation from Apt's perspective, which can help explain what data would not be deleted, as it's always safe to assume that the answer would be no.
In general, apt remove
only removes files installed by the deb package. It does not touch configuration files (which are usually under /etc
) nor user-generated files*.
The other option is to use apt prune
, but generally, it just deletes what apt remove
deletes, plus the configuration under /etc
. But it also ignores user-generated files.
* User-generated files don't necessarily mean the user needs to create them manually, but they can also be files that are generated by the binary (such as containers and images in this case)
docker system prune
does not delete everything either if there are running containers. As those containers and their images and the attached network and volumes will be kept. – Dan Jun 03 '22 at 09:26