Sigh ....
I should have been clearer I guess. Ram, when you used the dpkg commands, it showed you that apt thinks it has fpc-laz, fpc-src, lazarus-ide-2.0, lazarus-project and lazarus-src-2.0. Unfortunately, you have removed some or all of the files associated with those packages, manually, with the rm command.
So, you should not have proceeded until you cleaned up that situation. I should have mentioned that the actual package names vary depending on where they origionally came from, thats why the dpkg -l command to determine the actual names for you to use in the "sudo apt purge <package_name>"
I am afraid you need to remove them, one by one, in reverse order until the dpkg -l | grep <fpc or lazarus> commands return nothing.
Please do not proceed with installing until you have removed the broken ones.
And, again, I should have been clearer, when installing, I said to check for error messages, I should have added, do not proceed if you get an error message.
Generally, when someone gives you a set of instructions, step by step, you should stop when one step fails ! The following steps will probably fail too !
So, please repeat my previous set of instructions, this time, using the correct package name in the "sudo apt purge <package_name>".
You should be able to get to the stage where you can run -
dpkg -l | grep fpc <enter>
dpkg -l | grep lazarus <enter>
and get no response. Do not proceed to install anything until you can get to that stage. Just to be clear, do not try and install FPC nor Lazarus until you get no response back to the two commands above.
Use the command -
sudo apt purge <package_name> <enter>
Where the package_name is, one by one -
lazarus-src-2.0
lazarus-project
lazarus-ide-2.0
fpc-src
fpc-laz
I think you are going to have problems with that stage, so lets get it done before proceeding !
Davo