By the way, just uninstalling the old deb won't remove your configuration, I don't know if the Lazarus deb makers implement the full "full clean", probably not.
/users/{$user}/.Lazarus and its files are not removed and
/etc/fpc.cfg is not removed. There may be more. Manual environment configuration is of course also not removed. (paths, exports). This is for Debian debs from the standard repositories. There may be more, but that's it, afaik. One file for fpc and one hidden directory for Lazarus. Both are configuration, so may be on purpose. If you want a
clean install, first uninstall both Lazarus and FPC (both separately) with apt (remove or purge, then apt autoremove), remove /etc/fpc.cgg, remove /users/{$user}/.Lazarus. Only then install new..
apt autoremove removes dependencies that are only registered for Lazarus and fpc and that can be quite a lot.
On my machine :
# purge Debian-installed FPC and Lazarus
sudo apt purge fpc lazarus
# remove unused dependencies and purged package config
sudo apt autoremove --purge
# remove remaining user config. sudo only if they persist.
# check with ls -a ~/
rm -rf ~/.lazarus
rm -f ~/.fpc.cfg
rm -rf ~/.fppkg
# remove remaining global FPC config, if still present and only if you do not have a self build fpc.
# otherwise leave it alone: Lazarus installs ~/.fpc.cfg ~/.fppkg and ~/.Lazarus
sudo rm -f /etc/fpc.cfg
# check /etc for remnants if it is your only fpc/Lazarus install you removed!
# do not remove when you build fpc and Lazarus from source
# if it is your only install remove these too
ls /etc/f*
# finally check again with whereis fpc
whereis fpc
Warning: if you are running Debians (all) in WSL2, do not remove the paths from the environment. They are /mnt/ or /media/ paths to Windows directories.
WSL2 is usually completely hyperV'd and shares all real resources, not like a vm with a virtual disk, like VirtualBox. A cross compiler may need these.
The above is NOT for fpcupdeluxe installs but for installations from the Debian repositories.