Issues in installing r-base-dev - r

I am currently using Ubuntu 12.04 64 bit .I was trying to install R as specified on this link . I am successfully able to install r-base but getting errors when trying to install r-base-dev . Here is the error
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-dev : Depends: gfortran but it is not installable
Depends: libblas-dev but it is not installable or
libatlas-base-dev but it is not going to be installed
Depends: liblapack-dev but it is not installable or
libatlas-base-dev but it is not going to be installed
Depends: libreadline-dev but it is not installable
Depends: libjpeg-dev but it is not installable
Depends: libpcre3-dev but it is not installable
Depends: libpng-dev but it is not installable
Depends: libbz2-dev but it is not installable
Depends: cdbs but it is not installable
E: Unable to correct problems, you have held broken packages.
I have added the security key as stated in that link as well as the following line deb http://cran.r-project.org/bin/linux/ubuntu precise/ to /etc/apt/sources.list
I have also added the following ppa : sudo add-apt-repository ppa:marutter/rrutter .
Any help would be appreciable.
PS: I was also doubtful with my lists in /var/lib/apt/lists so I deleted and created it again. Still having the same error .

I made sure that the restricted and universe repositories are enabled (which was disabled in case of mine ). For doing this , Hit Alt + F2 type software-properties-gtk and hit Enter.
Under Ubuntu Software tab enable all the repositories.
After which run
sudo apt-get update
Again run
sudo apt-get install r-base-dev
And done successfully.
I got the above solution from this link

Related

Completely remove R and its files in Linux mint

I was having trouble with R packages so I decided to uninstall to do fresh install. Now I cannot even re-install R. I am using Linux Mint. what I did is:
Removed all directories found with .libPaths()
And in the terminal:
sudo apt-get remove r-base-core
sudo apt-get remove r-base
sudo apt-get autoremove
Now when I try to install R following https://cran.r-project.org/ tutorial, I get many errors:
sudo apt update -qq
E: The repository 'https://cloud.r-project.org/bin/linux/ubuntu una-cran40/ Release' does not have a Release file.
apt install --no-install-recommends 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-recommended (= 3.6.3-2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
apt install r-recommended
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-recommended : Depends: r-cran-foreign (>= 0.7-2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
apt install r-cran-foreign
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-cran-foreign : Depends: r-base-core (>= 4.0.0-1.2004.0) but 3.6.3-2 is to be installed
Depends: r-api-4.0 but it is not installable
E: Unable to correct problems, you have held broken packages.

Best way to install R on Ubuntu 20.04?

Does anyone have a good approach to installing R on Ubuntu 20.04? I can't seem to find a solution for this specific to 20.04 focal through apt.
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal
Edit: after going through the link here and adding the entry to sources.list, I ran into issues with dependencies:
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 (>= 4.0.2-1.2004.0) but it is not going to be installed
Depends: r-recommended (= 4.0.2-1.2004.0) 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.
Per #DirkEddelbuettel's comment, I ran sudo apt install r-base-core r-recommended r-base-html to see next level dependencies:
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-core : Depends: libblas3 but it is not installable or
libblas.so.3 but it is not installable
Depends: liblapack3 but it is not installable or
liblapack.so.3 but it is not installable
Depends: libtcl8.6 (>= 8.6.0) but it is not installable
Depends: libtk8.6 (>= 8.6.0) but it is not installable
Recommends: r-base-dev but it is not going to be installed
Recommends: r-doc-html but it is not going to be installed
r-recommended : Depends: r-cran-kernsmooth (>= 2.2.14) but it is not going to be installed
Depends: r-cran-mgcv (>= 1.1.5) but it is not going to be installed
Depends: r-cran-rpart (>= 3.1.20) but it is not going to be installed
Depends: r-cran-survival (>= 2.13.2-1) but it is not going to be installed
Depends: r-cran-matrix but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
There was a more underlying issue when I worked on trying to install r-base. I ended up finding out that I had problems with unmet dependencies after adding a PPA. I used this link here to fix the underlying problem of unmet dependencies, which in turn allowed me to apt install and not have any issues installing.
Here is what I do in the Rocker container r-ubuntu for the 20.04 image:
Install software-properties-common to be able to say add-apt-repository
Add the rrutter4.0 PPA for R itself (same as CRAN)
add-apt-repository --enable-source --yes "ppa:marutter/rrutter4.0"
Add the c4d4u.teams repo for over 4k CRAN packages:
add-apt-repository --enable-source --yes "ppa:c2d4u.team/c2d4u4.0+"
Run apt install r-base (and a few more).
In a narrow sense you only need 2 (as you likely do not 1 on a full Ubuntu system) and 4 but you may as well do 3.
You can of course also just to docker pull rocker/r-ubuntu:20.04 and get that container pre-made, but I use both: a container for tests, and these settings on my 20.04 machine(s).
Prerequisites
You will need an Ubuntu 20.04 with:
at least 1GB of RAM
a root user / non-root user with sudo privileges
Installing R
Because R is a fast-moving project, the latest stable version isn’t always available from Ubuntu’s repositories, so we’ll start by adding the external repository maintained by CRAN.
Note: CRAN maintains the repositories within their network, but not all external repositories are reliable. Be sure to install only from trusted sources.
Let’s first add the relevant GPG key.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
Note that if you’re not using 20.04, you can find the relevant repository from the R Project Ubuntu list, named for each release. Ubuntu 20.04 is referred to as Focal Fossa, and the most recent version of R is 4.0.0, hence the naming convention of the repository below — focal-cran40.
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
Now, we’ll need to run update after this in order to include package manifests from the new repository.
sudo apt update
At this point, we’re ready to install R with the following command.
sudo apt install r-base
If prompted to confirm installation, press y to continue.
Finally get into R shell-
sudo -i R
This confirms that we’ve successfully installed R and entered its interactive shell.

Unable to install latest R version on Ubuntu 18.04 linux

I want to be able to install the latest stable R release for Ubuntu 18.04, I had the ubuntu version installed and so I removed it and then followed several guides like in this link.
No matter what I do I get the following output when I issue a sudo apt-get install r-base:
sudo apt 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.6.1-3disco) but it is not going to be installed
Depends: r-recommended (= 3.6.1-3disco) 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.
What's wrong?

Errors when trying to install qtbase5-dev in Ubuntu

I'm trying to install the qt5 development libraries using sudo apt-get install qtbase5-dev, but I'm getting an error:
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:
qtbase5-dev : Depends: libgles2-mesa-dev or
libgles2-dev but it is not installable
Depends: libqt5gui5 (= 5.2.1+dfsg-1ubuntu14.3) but it is not going to be installed
Depends: libqt5printsupport5 (= 5.2.1+dfsg-1ubuntu14.3) but it is not going to be installed
Depends: libqt5widgets5 (= 5.2.1+dfsg-1ubuntu14.3) but it is not going to be installed
Recommends: libqt5opengl5-dev (= 5.2.1+dfsg-1ubuntu14.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
The problem is I don't have held packages - I checked using dpkg --get-selections | grep hold, but it showed nothing.
For me, this was caused by the oibaf graphics PPA being installed.
sudo apt-get install ppa-purge
sudo ppa-purge ppa:oibaf/graphics-drivers
will revert to stock graphics libs.
Manually installing libgles2-mesa-dev and then qtbase5-dev worked. I had to ran it in separate commands though:
sudo apt-get install libgles2-mesa-dev
sudo apt-get install qtbase5-dev

re- installing R linux ubuntu: unmet dependencies R

I used aptitude install to install a package, Ubuntu 11.10 oneiric, that apparently I couldn't install because of dependencies. I removed a couple of more libraries while doing it. I uninstalled Rstudio but still can't install R on my machine. I'm on ubuntu and this is what I get while running
sudo apt-get install r-base
The following packages have unmet dependencies:
r-base : Depends: r-base-core (>= 2.15.3-1quantal0) but it is not going to be installed
Depends: r-recommended (= 2.15.3-1quantal0) 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.
any ideas how to start from scratch and get R running again?
More of the Error log:
The following packages have unmet dependencies r-base-core : Depends: libblas3 but it is not installable or libblas.so.3 but it is not installable or libatlas3-base but it is not installable Depends: libc6 (>= 2.15) but 2.13-20ubuntu5.3 is to be installed Depends: liblapack3 but it is not installable or liblapack.so.3 but it is not installable or libatlas3-base but it is not installable Depends: liblzma5 (>= 5.1.1alpha+20120614) but it is not installable –
Try this
If you have added a line from new ubuntu repository to /etc/apt/sources.list, erase the line.
Then, run the commands
sudo add-apt-repository ppa:marutter/rrutter
sudo apt-get update
sudo apt-get upgrade
It worked for me, the answer comes from here
http://r.789695.n4.nabble.com/Upgrading-on-Ubuntu-from-2-11-1-to-2-15-1-td4636965.html
Uninstall previous R installation:
sudo R --no-save
pkgList <- installed.packages(priority='NA')
remove.packages(pkgList)
q()
sudo apt-get remove --purge r-cran* r-base*
Follow instructions (for R part) from:
How to install R, JGR and Deducer in Ubuntu
To list what you installed with aptitude type the following
xyz#sxyzcom~$ sudo apt-get remove
This should list what remains of your R install and possibly anything else missing dependencies Then you can run
xyz#sxyzcom~$ sudo apt-get autoremove
and that should get you back to square one.
If you are facing problems regarding Broken packages then first of all remove that package by first checking dependencies and then forcefully remove that package, and don't ever forget to reboot when you do make enormous changes in your system. To remove that package use these shell commands
$ sudo su
Then Enter your password
# apt-cache rdepends package-name
# apt-get --purge remove --force package-name
Use these shell commands
# apt-get clean
# apt-get autoclean
# apt-get update
# apt-get upgrade
# apt-get dist-upgrade
# reboot
This worked for me, Try this, I believe this will fix all your problems, Good luck.
If you want to remove the package forcefully,you can do
sudo dpkg --remove --force-remove-reinstreq package_name
and then
sudo apt-get update

Resources