Unable to uninstall fpc (Free Pascal Compiler)

Hi,
During Lazarus installation an error occurred, something to do with fpc (Free Pascal Compiler).
Searching the internet I got advice to delete some files and folders related to fpc.
Deleted what I found .
Now in Synaptic it appears as installed. Perhaps it was installed (or at least partially installed) during Lazarus installation.
Uninstalling it in Synaptic gave the error “E: fpc: sub-process script pre-removal installed returned output state erro 2”

Tried many terminal commands like:

sudo apt-get update : lots of errors regarding not finding libs and files related to fpc and and E: Sub-process /usr/bin/dpkg returned an error code (1)

sudo dpkg --remove --force-remove-reinstreq fpc : a lot of not found files or directories like:
/usr/lib/fpc/3.0.2/samplecfg
/usr/lib/fpc/3.0.2/fpc-cross.cfg
and: cannot create /usr/lib/fpc/3.0.2/fpc-cross.cfg: Directory non-existent, and others.

sudo apt-get -f install: almost same

They could not be found because I have insanely deleted then.
The names of not found files and directories must be somewhere. If I delete those names in “somewhere”
will I be able to uninstall fpc?
Is there anything that can be done to fix this situation , and uninstall fpc?
In the internet I found those commands cited above, but nothing about the errors encountered, or something similar.

Thanks for any help,
Geraldo

.

I’ve never used the fps package so installed it in a virtual machine of 16.04. It’s a meta package that pulls in about 145 other packages.

It may be easier to install fps, forced if needed, or Synaptic’s reinstallation, just to be able to uninstall it cleanly.

I note that in Synaptic, when I uninstalled fps, 128 packages (a good start) appeared under “automatic removable”. Sure, it’s 17 packages short of full cleanup but not bad.

One thing you also have is Synaptic’s history. As a big user of Synaptic, I find that golden info at times.

Hi,
Bill_MI, thanks for replying.

I finally could uninstall fpc and install Lazarus.
After running: sudo apt-get remove fpc, a lot of errors appeared.
I found in the error message that the system was trying to write to files:
usr/lib/fpc/3.0.2/fpc-cross.cfg and usr/lib/fpc/samplecfg.
Well, to satisfy the system I created them and used again the apt-get remove fpc command : no errors.
Now in Synaptic fpc appears as not installed.
Installed again the three deb packs and Lazarus is working now.
My “solution” may not be the “proper” one, but it worked.
Regards
Geraldo