Failed to Download Packages from Github via Devtools in RStudio

35 views Asked by At

I am just beginning to learn R and have built up an RStudio Server by WSL (Ubuntu 22.04.2)(yes, my PC is on Win11 and just want to use Unix environment). So here it is, I tried to download some packages by devtools::install_github(), yet the console simply showed:

Error: Failed to install 'unknown package' from GitHub:
  Failed to connect to api.github.com port 443 after 0 ms: Connection refused

So I thought it may be a proxy problem. Since I am not familiar with network-things, I asked my friend to nail it. He helped me to link to the github in terminal. And I searched online for similar situation, I checked like below:

sudo ufw status
Status: inactive
ping github.com
PING github.com (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.016 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.019 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.016 ms
64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.018 ms
64 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.016 ms

There is no firewall and linking to github is solid in terminal. Also I checked /etc/hosts and github.com was already there.

But in RStudio nothing has changed:( Some may say just download packages from github and copy into the shell, but I just don't want to waste devtools. What could I do?

0

There are 0 answers