How to install R on Ubuntu 21.10 - r

I just bought a new machine and made a fresh installation of Ubuntu 21.10 since I've read that the newer kernel works better with graphics drivers. I'm planning to update to the 22.04 LTS when it will be available. I didn't realize, however, that I might run into challenges with R.
There are plenty of questions here in SO on installing R on Ubuntu, but none seemed recent enough to address the Ubuntu version 21.10.
Ubuntu Packages For R - Full Instructions state that
As of May 19, 2021 the supported releases are
Hirsute Hippo (21.04, amd64 only)
Groovy Gorilla (20.10, amd64 only),
Focal Fossa (20.04; LTS and amd64 only),
Bionic Beaver (18.04; LTS), and
Xenial Xerus (16.04; LTS).
So, if I understand correctly, I have three options:
Uninstall 21.10 and replace with 21.04
Wait for support for 21.10
Install R from source
Now, the question is, have I understood correctly, or could I use, for example, the 21.04 repository (hirsute-cran40/)?

Apparently, it is ok to use a repository of older releases.
I was encouraged by Andre Wildeberg (thanks!) and added the 21.04 repository (hirsute-cran40/) into my /etc/apt/sources.list:
deb https://cloud.r-project.org/bin/linux/ubuntu hirsute-cran40/
Then, you can follow the rest of the CRAN instructions.
Add the relevant GPG key (under "Secure APT", half way through the document):
$ wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
Finally, install R:
$ sudo apt-get update
$ sudo apt-get install r-base
And everything should be working fine.

You need a newer signing key for that repo:
root:~# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
Executing: /tmp/apt-key-gpghome.MsSJzqgwfx/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
gpg: key 51716619E084DAB9: "Michael Rutter <marutter#gmail.com>" 1 new signature
gpg: failed to start agent '/usr/bin/gpg-agent': No such file or directory
gpg: can't connect to the agent: No such file or directory
gpg: Total number processed: 1
gpg: new signatures: 1
root:~# apt update
Get:1 https://cloud.r-project.org/bin/linux/ubuntu hirsute-cran40/ InRelease [3628 B]
Get:2 http://security.ubuntu.com/ubuntu impish-security InRelease [110 kB]
Hit:3 http://archive.ubuntu.com/ubuntu impish InRelease
Get:4 http://archive.ubuntu.com/ubuntu impish-updates InRelease [110 kB]
Get:5 http://archive.ubuntu.com/ubuntu impish-backports InRelease [101 kB]
Fetched 325 kB in 1s (422 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
root:#
One you have that, impish works fine. That said, hirsute binaries should work too (or even focal binaries, as one does with the 5000+ r-cran-* binaries the 'cran2deb4ubuntu' repo for the LTS release).

Related

Log in firebase in codeanywhere or upload webapp files in firebase without cli

I have a webapp firebase project in codeanywhere but I can't login in firebase, I have installed firebase-tools#9.23.3 and when I run "firebase login --no-localhost" I have a link to log in, but when I click on link another page is opened with:
"Errore 400: invalid_request The version of the app you're using
doesn't include the latest security features to keep you protected.
Please make sure to download from a trusted source and update to the
latest, most secure version."
I wrote to support of codeanywhere and they said that don't officially support firebase. So I want to know if there is a workaround to deploy the webapp in firebase inside codeanywhere or eventually upload the webapp files in firebase without cli.
Basically I would not like to install any editor and any cli on my pc and be able to work only online on my firebase project. I can also use another environment like codeanywhere as long as it allows me to work (edit and deploy) only online to my firebase project.
Update:
cabox#nodejs-white-lion:~/workspace/GAU$ sudo apt-get remove nodejs npm
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'npm' is not installed, so not removed
The following packages will be REMOVED:
nodejs
0 upgraded, 0 newly installed, 1 to remove and 10 not upgraded.
After this operation, 125 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 40238 files and directories currently installed.)
Removing nodejs (14.21.1-deb-1nodesource1) ...
Processing triggers for man-db (2.7.5-1) ...
cabox#nodejs-white-lion:~/workspace/GAU$ curl -sL deb.nodesource.com/setup_16.x | sudo -E bash -
## Installing the NodeSource Node.js 16.x repo...
## Populating apt-get cache...
+ apt-get update
Get:1 http://repo.mysql.com/apt/ubuntu xenial InRelease [22.2 kB]
Err:1 http://repo.mysql.com/apt/ubuntu xenial InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29
Hit:2 https://deb.nodesource.com/node_14.x xenial InRelease
Hit:3 http://archive.ubuntu.com/ubuntu xenial InRelease
Hit:4 http://ppa.launchpad.net/git-core/ppa/ubuntu xenial InRelease
Hit:5 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:6 http://archive.canonical.com/ubuntu xenial InRelease
Hit:7 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Fetched 22.2 kB in 0s (36.5 kB/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repo.mysql.com/apt/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29
W: Failed to fetch http://repo.mysql.com/apt/ubuntu/dists/xenial/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29
W: Some index files failed to download. They have been ignored, or old ones used instead.
## Confirming "xenial" is supported...
+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_16.x/dists/xenial/Release'
## Adding the NodeSource signing key to your keyring...
+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodesource.gpg >/dev/null
## Creating apt sources list file for the NodeSource Node.js 16.x repo...
+ echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x xenial main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x xenial main' >> /etc/apt/sources.list.d/nodesource.list
## Running `apt-get update` for you...
+ apt-get update
Get:1 http://repo.mysql.com/apt/ubuntu xenial InRelease [22.2 kB]
Err:1 http://repo.mysql.com/apt/ubuntu xenial InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29
Hit:2 http://archive.canonical.com/ubuntu xenial InRelease
Hit:3 http://archive.ubuntu.com/ubuntu xenial InRelease
Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:5 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:6 http://ppa.launchpad.net/git-core/ppa/ubuntu xenial InRelease
Get:7 https://deb.nodesource.com/node_16.x xenial InRelease [4,584 B]
Get:8 https://deb.nodesource.com/node_16.x xenial/main amd64 Packages [774 B]
Fetched 27.6 kB in 0s (28.2 kB/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repo.mysql.com/apt/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29
W: Failed to fetch http://repo.mysql.com/apt/ubuntu/dists/xenial/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29
W: Some index files failed to download. They have been ignored, or old ones used instead.
## Run `sudo apt-get install -y nodejs` to install Node.js 16.x and npm
## You may also need development tools to build native addons:
sudo apt-get install gcc g++ make
## To install the Yarn package manager, run:
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
cabox#nodejs-white-lion:~/workspace/GAU$ udo apt-get update && sudo apt-get install yarn
bash: udo: command not found
cabox#nodejs-white-lion:~/workspace/GAU$ sudo apt-get update && sudo apt-get install yarn
Get:1 http://repo.mysql.com/apt/ubuntu xenial InRelease [22.2 kB]
Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease
Err:1 http://repo.mysql.com/apt/ubuntu xenial InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29
Hit:3 http://archive.canonical.com/ubuntu xenial InRelease
Hit:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:5 https://deb.nodesource.com/node_16.x xenial InRelease
Hit:6 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:7 http://ppa.launchpad.net/git-core/ppa/ubuntu xenial InRelease
Fetched 22.2 kB in 0s (41.8 kB/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repo.mysql.com/apt/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29
W: Failed to fetch http://repo.mysql.com/apt/ubuntu/dists/xenial/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package yarn
cabox#nodejs-white-lion:~/workspace/GAU$ node -v
v14.16.0
cabox#nodejs-white-lion:~/workspace/GAU$

Unmet dependencies installing R 3.6.2 on Ubuntu 18.14 LTS

I use 18.04.4 LTS (Bionic Beaver)
I wanted to upgrade my R version from 3.4.4 to 3.6.2, but now I have no R at all.
here are my actions:
1 step:
sudo apt update
sudo apt-get upgrade
sudo apt-get dist-upgrade
2 step:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
3 step:
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'
return:
Hit:1 http://ua.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://ua.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://ua.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:4 http://cran.rstudio.com/bin/linux/ubuntu bionic-cran35/ InRelease
Hit:5 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease
Hit:6 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:7 https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/ InRelease
Hit:8 https://cloud.r-project.org/bin/linux/ubuntu disco-cran35/ InRelease
Hit:9 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ InRelease
Reading package lists... Done
4 step:
sudo apt update
sudo apt install r-base
return:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
r-base : Depends: r-base-core (>= 3.6.2-1xenial) but it is not going to be installed
Depends: r-recommended (= 3.6.2-1xenial) but it is not going to be installed
Recommends: r-base-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
then I try:
R --version
return:
Command 'R' not found, but can be installed with:
sudo apt install r-base-core
I try:
sudo apt install r-base-core
The following packages have unmet dependencies:
r-base-core : Depends: libreadline6 (>= 6.0) but it is not
installable
Recommends: r-recommended but it is not going to be
installed
Recommends: r-base-dev but it is not going to be
installed
E: Unable to correct problems, you have held broken packages.
You can try two things:
As you already appear to have installed, just to sudo apt-get dist-upgrade. It will list candidate upgrades, you can still back out. Advantage: it resolved interdependent upgrades for you.
Continue what you did but list the affected packages, i.e. sudo apt-get install r-base r-recommended r-base-hmtml. This will work, but may requires several iterative steps.
I took a look at the etc/apt/sources.list file and realised that I had the same repository repeated. I deleted two lines and the problem was solved.

Upgrade R in Ubuntu xenial

I am trying to update R in my Ubuntu Xenial machine. When I run:
R --version
the output is
R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
I have been checking a lot of post about how to do it. My main steps have been:
Open the source list and add the link
sudo nano /etc/apt/sources.list
deb http://cran.rstudio.com/bin/linux/ubuntu xenial/
(Maybe I am adding the link in the wrong place of the source.list? I don't know, I am new in Ubuntu). After adding the link, I save and exit the source.list. Then my steps have been:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
gpg -a --export E084DAB9 | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install r-base
Once the process is finished, I run again:
R --version
And the output is still
R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
I don't have a lot of experience with Linux yet but based on previous post and their solutions I cannot manage to solve the problem.
By the way, I need to update R since some of the packages I need to use (such as rgdal) are not available under the version I currently have
Thanks for the help
M
See this, as you are already doing you have to use the distribution from CRAN:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/'
sudo apt-get update
sudo apt-get install r-base
The CRAN README probably is the right place to read first.
What you have it pretty good. I would make it
a) use a file, say cran.list inside of /etc/apt/sources.list.d/
b) use https://, ie I have deb https://cloud.r-project.org/bin/linux/ubuntu zesty/ (and that actually points to the same CDN servers as what you have)
c) run apt-get update and then check via apt-cache policy r-base-core
It should show both the newer (at CRAN) and older (from Ubuntu):
edd#bud:~$ apt-cache policy r-base-core
r-base-core:
Installed: 3.4.3-1zesty0
Candidate: 3.4.3-1zesty0
Version table:
*** 3.4.3-1zesty0 500
500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
100 /var/lib/dpkg/status
3.4.2-2zesty 500
500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
3.4.2-1zesty1 500
500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
3.4.1-2zesty0 500
500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
3.4.1-1zesty0 500
500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
3.4.0-1zesty 500
500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
3.3.2-1 500
500 http://us.archive.ubuntu.com/ubuntu zesty/universe amd64 Packages
edd#bud:~$
The three stars show that that is the installed version.
d) Now when you see the desired version available, install the usual way via apt-get install r-base-core. You should get the highest version as expected.

Installing R Language on Ubuntu 16 - unmet dependencies

Installing the R language following the instructions at the site [ here ] .
During installation I receive an error "unmet dependencies" at the r-base component using the apt-get install command. See the log with the command sequence below:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
Executing: /tmp/tmp.QQyv0HB7mS/gpg.1.sh --keyserver
keyserver.ubuntu.com
--recv-keys
E298A3A825C0D65DFD57CBB651716619E084DAB9
gpg: requesting key E084DAB9 from hkp server keyserver.ubuntu.com
gpg: key E084DAB9: "Michael Rutter <marutter#gmail.com>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
/data/shared/datascience# add-apt-repository 'deb [arch=s390x] https://cran.rstudio.com/bin/linux/ubuntu xenial/'
apt-get update
Hit:1 https://cran.rstudio.com/bin/linux/ubuntu xenial/ InRelease
Hit:2 http://ports.ubuntu.com/ubuntu-ports xenial InRelease
Get:3 http://ports.ubuntu.com/ubuntu-ports xenial-updates InRelease [102 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports xenial-security InRelease [102 kB]
Get:5 http://ports.ubuntu.com/ubuntu-ports xenial-updates/main s390x Packages [554 kB]
Get:6 http://ports.ubuntu.com/ubuntu-ports xenial-updates/universe s390x Packages [494 kB]
Fetched 1252 kB in 12s (104 kB/s)
Reading package lists... Done
apt-get install r-base
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
r-base : Depends: r-base-core (>= 3.4.0-1xenial0) but it is not going to be installed
Depends: r-recommended (= 3.4.0-1xenial0) but it is not going to be installed
Recommends: r-base-html but it is not going to be installed
Recommends: r-doc-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Is this an error in my install procedure, or is this packet broken?
By using the Universal Ubuntu repository and command shown below, the issue was solved:
sudo apt-get install r-base r-base-dev

How to fix heartbleed without apt-get upgrading everything?

I ran apt-get install openssl
and verified that the new version .1g is installed
root#nyc2-04-www:~# apt-cache policy openssl
openssl:
Installed: 1.0.1g-1
Candidate: 1.0.1g-2
Version table:
1.0.1g-2 0
500 http://http.debian.net/debian/ sid/main amd64 Packages
*** 1.0.1g-1 0
100 /var/lib/dpkg/status
1.0.1e-2+deb7u6 0
500 http://security.debian.org/ wheezy/updates/main amd64 Packages
1.0.1e-2+deb7u4 0
500 http://ftp.us.debian.org/debian/ wheezy/main amd64 Packages
500 http://http.debian.net/debian/ wheezy/main amd64 Packages
However, I notice that even though the new openssl is installed, my servers are still vulnerable unless I do a full apt-get upgrade
See here: http://filippo.io/Heartbleed/#www.uat.phantomjscloud.com
How can I avoid doing the full apt-get upgrade, but ensure the new openssl is being used?
FYI I did verify that doing apt-get upgrade will fix heartbleed (i did that in my production server) But I'm currious as to why updating openssl isn't good enough.
FYI I am using nginx. I also did apt-get install nginx afterwards but that didn't resolve the issue either
UPDATE: running openssl version -a shows that 1.0.1f is still active, even after reboot.
apt-get install libssl1.0.0 fixes the problem

Resources