Today I returned to my desktop computer after having been away for a couple of days, during which I only used my laptop. Both machines run Ubuntu Linux, currently version 23.04.

The project I was going to work on required R, but for some reason R didn’t start. No error message, only an exit status of 1 and I was back at the shell prompt. Running R --version worked fine, but Rscript failed in the same way as regular R. I tried running R --vanilla, starting R as a different user, nothing helped.

Time to dig deeper. Make sure all Ubuntu packages are up to date. Reinstall the r-base and r-base-core packages, check whether those packages had been recently updated (no), check whether the package versions were identical to the ones on my laptop (where R worked fine). Nothing…

Maybe there is problem with a (missing) dynamic library? In the (distant) past I have had problems with that, so it is worth a shot:

$ ldd /usr/bin/Rscript (0x00007ffcac7d4000)
	/usr/local/lib/AppProtection/ (0x00007f01b9e00000) => /lib/x86_64-linux-gnu/ (0x00007f01b9bfb000) => /lib/x86_64-linux-gnu/ (0x00007f01ba204000) => /lib/x86_64-linux-gnu/ (0x00007f01ba1ff000)
	/lib64/ (0x00007f01ba22f000) => /lib/x86_64-linux-gnu/ (0x00007f01ba0c1000) => /lib/x86_64-linux-gnu/ (0x00007f01ba095000) => /lib/x86_64-linux-gnu/ (0x00007f01ba081000) => /lib/x86_64-linux-gnu/ (0x00007f01b9991000) => /lib/x86_64-linux-gnu/ (0x00007f01ba07b000) => /lib/x86_64-linux-gnu/ (0x00007f01ba073000) => /lib/x86_64-linux-gnu/ (0x00007f01ba05c000) => /lib/x86_64-linux-gnu/ (0x00007f01b98a8000) => /lib/x86_64-linux-gnu/ (0x00007f01ba038000) => /lib/x86_64-linux-gnu/ (0x00007f01b9893000) => /lib/x86_64-linux-gnu/ (0x00007f01ba02b000)

That’s strange: I usually don’t have stuff installed in /usr/local. What is this AppProtection library doing there? And then it hit me: I recently (the last time I had used my desktop PC) had to install Citrix’s ICA client to do some remote desktop work for one of my clients. When I installed that package I was asked something about installing some sort of app protection. I had selected “yes”… With a feature named like that I should have known better…

Anyway, time to see if this shared library was indeed the problem. I moved the /usr/local/lib/AppProtection/ directory out of the way and tried to start R. All was fine and dandy again! Except that even an ls command now gave an error:

$ ls /usr/local/lib/AppProtection
ERROR: object '/usr/local/lib/AppProtection/' from /etc/ cannot be preloaded (cannot open shared object file): ignored.
ls: cannot access '/usr/local/lib/AppProtection': No such file or directory
ERROR: object '/usr/local/lib/AppProtection/' from /etc/ cannot be preloaded (cannot open shared object file): ignored.

Apparently (obviously?), something still tried to preload the library, even though it no longer existed. It turns out this was done in the file /etc/


Given that this was the only content of that file, I opted to just delete it. Finally, my system is back in a working state.

Conclusion: be more careful when installing stuff from external sources and definitely don’t install anything you don’t really need, like Citrix’s App Protection.

P.S. It turns out this was also the reason why the Mattermost app wasn’t running successfully any more.

Related Images: