I used to run R 3.6 but I updated it to 4.0.3 and now I can't even open R. I'm not sure how I managed to break it. I followed the installation instructions on this and this site.
When I run R --version on the command line it looks like R is installed:
R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out" Copyright
(C) 2020 The R Foundation for Statistical Computing Platform:
x86_64-pc-linux-gnu (64-bit)
But when I try to start R by typing R I get an error:
Fatal error: unable to open the base package
I tried removing the current installation with sudo apt purge r-base r-base-core r-recommended and reinstalling it with sudo apt install r-base r-base-core r-recommended but it doesn't seem to help.
When I removed my old version of R is manually removed .libPaths folders. I have later tried to recreate them (without the installed packages) but this didn't solve the problem.
Any ideas how to fix it?