Score:1

Can't restore corrupted compiler on Kubuntu 20.04

br flag

I use the FreePascalCompiler (FPC) version 3.0.4 on command line level under Kubuntu 20.04.2 LTS and ended up corrupting it myself. Now I find no way to do a clean reinstall of FPC. I suppose the problem is Ubuntu-specific, that's why I put my question here.

This what I have done: I wanted to use in a tiny program of mine a special function that is only available when the unit LConvEncoding is included. The compiler threw up the fatal error message: Unit not found. A lengthy search in different forums brought me two insights:

  1. This unit should be present, when FPC 3.0.4 is installed correctly.
  2. I should check the symbolic links that start FPC, because with Ubuntu paths are different.

which fpc delivers this output: /usr/bin/fpc. This is a symbolic link to /etc/alternatives/fpc, again a symbolic link to /usr/bin/x86_64-linux-gnu-fpc-3.0.4. This is an executable trying to run /usr/lib/x86_64-linux-gnu/fpc/3.0.4/ppcx64. ppcx64 is the actual compiler for my Mac-64bit-system.

So /usr/lib/x86_64-linux-gnu/fpc/3.0.4/units/ was the directory where to search for the desired unit. Unit LConvEncoding was unfortunately not present. This made me think that my FPC installation was incomplete. Therefore I uninstalled it with sudo apt-get purge fpc. And then reinstalled it. This changed literally nothing at all.

Now, to make sure that the directory /usr/lib/x86_64-linux-gnu/fpc/3.0.4/ is really rewritten, I manually deleted /usr/lib/x86_64-linux-gnu/fpc. No good idea as I know by now. The following installation process went through without error messages, but did not rewrite the directory - it is still missing. So I no longer have an existing Pascal compiler. Every call of the compiler now produces this error message: Error: ppcx64 can't be executed, error message: Failed to execute "ppcx64", error code: 127.

My guess is that the specific deb package for FPC 3.0.4 under Ubuntu 20.04 contains a buggy un-installer, which doesn't clean up all relevant files. And that's why the installer aborts the installation without an error message, as it encounters already existing files of the desired program version and therefore assumes that the job is already done.

If this assumption is no nonsense, the question is: Which files do I have to delete in order to make sudo apt-get install fpc to do the full job again?

Or did I get the whole thing wrong?

Hardware: Mac Mini (6.2 dating from 2012 with 4 × Intel Core i5-2415M [email protected])

System: Kubuntu 20.04.2 LTS only. No other operating system installed.

Score:1
zw flag

At first you should not delete or rename any files which are controlled by APT (and by update-alternatives as the result).

To reinstall FPC packages you have execute the following command:

sudo apt-get install --reinstall fpc fpc-3.0.4 fp-compiler fp-compiler-3.0.4 fpc-source fpc-source-3.0.4 fp-docs fp-docs-3.0.4 fp-ide fp-ide-3.0.4 fp-units-base fp-units-base-3.0.4 fp-units-db fp-units-db-3.0.4 fp-units-fcl fp-units-fcl-3.0.4 fp-units-fv fp-units-fv-3.0.4 fp-units-gfx fp-units-gfx-3.0.4 fp-units-gtk2 fp-units-gtk2-3.0.4 fp-units-math fp-units-math-3.0.4 fp-units-misc fp-units-misc-3.0.4 fp-units-multimedia fp-units-multimedia-3.0.4 fp-units-net fp-units-net-3.0.4 fp-units-rtl fp-units-rtl-3.0.4 fp-utils fp-utils-3.0.4

and for their 32-bit variants use commands below

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install --reinstall fp-units-i386 fp-units-i386-3.0.4

then all folder structures will be fixed.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.