r-lib / rig

The R Installation Manager
MIT License
663 stars 22 forks source link

linux: rig add release leads to [ERROR] Failed to resolve R version #223

Closed florianorgeret closed 7 months ago

florianorgeret commented 7 months ago

Many thanks for the work!

I am on linux using the PopOS distribution, but since it is almost entirely based on ubuntu, everything is working nicely except for installing R versions I've got the following error:

rig add release

[ERROR] Failed to resolve R version: Cannot download JSON: HTTP status client error (404 Not Found) for url (https://api.r-hub.io/rversions/resolve/release/linux-pop-20.04/x86_64)

rig system detect-platform

Detected platform: Architecture: x86_64 OS: linux Distribution: pop Version: 20.04 PPM support: false

gaborcsardi commented 7 months ago

If rig does not detect your OS, set the RIG_PLATFORM environment variable, in your case it would be RIG_PLATFORM=ubuntu-20.4.

E.g:

root@b7c4b4279840:~# rig system detect-platform
Detected platform:
Architecture: x86_64
OS:           linux
Distribution: ubuntu
Version:      22.04
PPM support:  true
PPM URL:      https://packagemanager.posit.co/cran/__linux__/jammy/latest
root@b7c4b4279840:~# RIG_PLATFORM=ubuntu-20.04 rig system detect-platform
Detected platform:
Architecture: x86_64
OS:           linux
Distribution: ubuntu
Version:      20.04
PPM support:  true
PPM URL:      https://packagemanager.posit.co/cran/__linux__/focal/latest
florianorgeret commented 7 months ago

Many thanks for the answer!

running the command did change the platform but it is not saved for future commands: RIG_PLATFORM=ubuntu-20.04 rig system detect-platform

Detected platform: Architecture: x86_64 OS: linux Distribution: ubuntu Version: 20.04 PPM support: true PPM URL: https://packagemanager.posit.co/cran/__linux__/focal/latest

then running rig system detect-platform still gives 'pop' as distribution and I am having the same error

I thus copied RIG_PLATFORM=ubuntu-20.04 in the file from nano ~/.bashrc source ~/.bashrc

which provide now the right distribution rig system detect-platform

Detected platform: Architecture: x86_64 OS: linux Distribution: ubuntu Version: 20.04 PPM support: true PPM URL: https://packagemanager.posit.co/cran/__linux__/focal/latest

but I am still having the same error rig add 4.2.2

[ERROR] Failed to resolve R version: Cannot download JSON: HTTP status client error (404 Not Found) for url (https://api.r-hub.io/rversions/resolve/4.2.2/linux-pop-20.04/x86_64)

gaborcsardi commented 7 months ago

Yes, you need to set the RIG_PLATFORM=ubuntu-20.04 for your user or for your computer. Read your docs on how to set environment variables. E.g. https://www.xda-developers.com/set-environment-variable-in-ubuntu/

florianorgeret commented 7 months ago

It worked! many thanks for the help, and for the great work!