How to install devtools on Ubuntu

October 29, 2019 169 views

I was following your tutorial [1] on how to install R devtools on Ubuntu but I am stuck at the first step:

sudo apt install build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev

I get an error that some of the packages could not be installed:

The following packages have unmet dependencies:
 libssl-dev : Depends: libssl1.1 (= 1.1.0g-2ubuntu4) but 1.1.1-1ubuntu2.1~18.04.4 is to be installed
              Recommends: libssl-doc but it is not going to be installed
 libxml2-dev : Depends: libicu-dev but it is not going to be installed
               Depends: libxml2 (= 2.9.4+dfsg1-6.1ubuntu1) but 2.9.4+dfsg1-6.1ubuntu1.2 is to be installed
E: Unable to correct problems, you have held broken packages.

I tried to search as well as some forums and tried different solutions listed here but nothing helped. I am using Ubuntu 18.04 and it was a fresh installation (it’s a new laptop). Do you have any idea what I can do about it?

Thank you!


2 Answers


I’ve just tested that on a new Ubuntu 18.04 droplet and it worked out of the box.

What is your exact Ubuntu version that you are using?

I would recommend running the following:

sudo apt update

And then try again with the apt install command.


  • Thank you for your answer. Maybe the description of my OS was misleading, I have installed various software and packages before, so it’s not out-of-the-box. What I meant to say it was a fresh installation as opposed to upgrade from, e.g. Ubuntu 16.04.

    This is the exact Ubuntu version:

    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 18.04.3 LTS
    Release: 18.04
    Codename: bionic

    I have run

    sudo apt update

    but that didn’t solve the issue. When I run

    sudo apt upgrade

    I get

    The following packages have been kept back:
      gdal-bin grass-core libgdal20 liblas-c3 liblas3 python-gdal python3-gdal
    0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
    • Hi @janpisl

      Thank you for your clarification. It looks like that you have a libssl-dev dependency issue.

      What you could try is reinstalling the libssl package:

      sudo apt install --reinstall libssl1.1=1.1.0g-2ubuntu4
      sudo apt install libssl-dev

      And then try running the apt install command again as stated in the tutorial.

      However to be on the safe side make sure to create a backup of your droplet in case that this affects your existing services in an unexpected way.

      Let me know how it goes!


      • Unfortunately reinstalling the libssl package would cause removing over 200 packages, some of which I cannot remove:

        ubuntu-desktop ubuntu-drivers-common
        ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk ubuntu-session ubuntu-software ubuntu-system-service
        ubuntu-web-launchers unattended-upgrades unity-control-center update-manager

        I am unfortunately new to Linux and don’t have a deep understanding of this issue but it seems strange to me that those above mentioned packages - which are,I believe, part of every Ubuntu 18.-4 - would cause the problem. Do you perhaps have any suggestion what else can I try?

        Thank you very much!

Have another answer? Share your knowledge.