Quite surprisingly it's hard to find a workable solution around this.
I have an EC2 instance launched with Ubuntu 18.04 distribution.
I do sudo-get install r-base but the installed R version is R3.4
I've followed the steps here below where it asks to edit the source.list file https://cran.r-project.org/bin/linux/ubuntu/README.html#installation
However, AWS declines the update as the source link is not secured.