Ubuntu 18.04 LTS无可用R CRAN仓库,咨询镜像更新时长
Hey there! I’ve been through similar headaches with new Ubuntu LTS releases, so let’s break down your questions and fix this step by step.
CRAN镜像更新周期
CRAN官方团队 typically rolls out support for new Ubuntu versions within 1-2 weeks of the OS’s official launch. But keep in mind that individual mirror sites (like the mtu.edu one you’re using) need to sync these updates from the official CRAN servers, which might add an extra day or two—global mirrors don’t all refresh at the exact same time.
If you can’t wait, you can temporarily use the Artful Aardvark repository to install R. Ubuntu LTS versions have solid backward compatibility, so Artful’s R packages should work just fine on Bionic. Once the Bionic repo goes live, you can switch over easily.
Fixing the add-apt-repository command failure
Chances are your system is missing a critical tool package needed to run that command. First, install the required dependencies:
sudo apt update && sudo apt install software-properties-common
Once that’s done, you can add the Artful CRAN repository without issues:
sudo add-apt-repository "deb https://cran.mtu.edu/bin/linux/ubuntu artful/"
Now update your package list and install R:
sudo apt update sudo apt install r-base r-base-dev
Installing R Studio
R Studio usually supports new Ubuntu versions faster than CRAN mirrors do. You can grab the Ubuntu 18.04-compatible .deb package directly, then install it with:
sudo dpkg -i rstudio-x.y.z-amd64.deb
(Replace rstudio-x.y.z-amd64.deb with the actual filename you downloaded.) If you hit dependency errors, run this to fix them:
sudo apt -f install
Switching to the Bionic repo later
Once CRAN mirrors update to support Bionic, don’t forget to swap out the Artful source:
- Open the CRAN source file:
sudo nano /etc/apt/sources.list.d/cran.list - Replace
artfulwithbionic - Save and exit, then run:
sudo apt update
内容的提问来源于stack exchange,提问作者stackinator

