1

I am trying to install rbenv using this guide. To do so the following dependencies are needed:

$ sudo apt install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev

But this is the response I get when try to install them from the terminal:

$ sudo apt install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libreadline-dev' instead of 'libreadline6-dev'
build-essential is already the newest version (12.4ubuntu1).
libgdbm5 is already the newest version (1.14.1-6).
zlib1g-dev is already the newest version (1:1.2.11.dfsg-0ubuntu2).
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:
 libncurses5-dev : Depends: libtinfo5 (= 6.1-1ubuntu1) but 6.1-1ubuntu1.18.04 is to be installed
                   Depends: libncurses5 (= 6.1-1ubuntu1) but 6.1-1ubuntu1.18.04 is to be installed
                   Depends: libtinfo-dev (= 6.1-1ubuntu1) but it is not going to be installed
 libreadline-dev : Depends: libtinfo-dev but it is not going to be installed
 libssl-dev : Depends: libssl1.1 (= 1.1.0g-2ubuntu4) but 1.1.0g-2ubuntu4.1 is to be installed
E: Unable to correct problems, you have held broken packages.

Seems like I have some broken packages installed, but i'm not really sure. How could I solve this issue?

3
4

As @guiverc pointed out, I was missing some sources.

I went to "Software & Updates", under the tab "Updates", and checked "Important security udates" and "Recommended updates". (No idea why they were not checked...)

After that, everything worked.

1
  • Yeah, though it's quit wired, this saved my problem! thank you!
    – Siwei
    Mar 3 at 0:05
1

I am facing same issue and I have enabled 'bionic-updates' 'bionic-security' lines in your sources list at /etc/apt/source.list. Then apt-get update and try to install those packages again.

1
  • An easy way to do this is remove (or move to temporary location) the file located at /etc/apt/sources.list and then use the command software-properties-gtk and enable all of the sources (including the tab for updates)
    – Onasafari
    Nov 5 '19 at 22:50
0

You should be able to install using the following commands to specify the specific versions you need first:

sudo apt update
sudo apt upgrade
sudo apt install --reinstall libncurses5-dev=6.1-1ubuntu1.18.04 libtinfo-dev=6.1-1ubuntu1.18.04 libssl-dev=1.1.0g-2ubuntu4.1 

Then, run your original install command with reinstall included and please post any errors:

sudo apt install --reinstall autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev
0

I once had the similar problem with GRASS packages. Here's how I solved this issue:

  1. Install aptitude, a package installer. sudo apt install aptitude
  2. sudo aptitude install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev
  3. Now aptitude should ask you wether you want to install packages with option a, option b, and so on. You might want to go through each possible choice by saying 'no' until you reach the end, re-run the command and make an "educated" choice.
0

There is another rather hard to figure out issue too. My issue was the system clock was behind the actual date by days. Once I fixed it, I was able to install libncurses5-dev

Check my terminal output

# apt-get install libncurses-dev
<snip>
The following packages have unmet dependencies:
 libncurses5-dev : Depends: libtinfo5 (= 6.1-1ubuntu1) but 6.1-1ubuntu1.18.04 is to be installed
                   Depends: libncurses5 (= 6.1-1ubuntu1) but 6.1-1ubuntu1.18.04 is to be installed
                   Depends: libtinfo-dev (= 6.1-1ubuntu1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
# apt-get update
<snip>
Reading package lists... Done
E: Release file for http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease is not valid yet (invalid for another 10d 22h 52min 0s). Updates for this repository will not be applied.
E: Release file for http://us.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease is not valid yet (invalid for another 10d 22h 53min 14s). Updates for this repository will not be applied.
E: Release file for http://us.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease is not valid yet (invalid for another 10d 22h 54min 51s). Updates for this repository will not be applied.
# date
Mon Aug  3 17:03:26 EDT 2020
# apt-get install ntp
# systemctl status ntp
# date
Fri Aug 14 16:26:10 EDT 2020
# apt-get install libncurses-dev
<snip>
The following NEW packages will be installed:
  libc-dev-bin libc6-dev libncurses5-dev libtinfo-dev linux-libc-dev manpages-dev
<snip>
Setting up libncurses5-dev:amd64 (6.1-1ubuntu1.18.04) ...
0

This is what worked for me:

Step 1: Open the terminal (Press Ctrl+Alt+T).

Step 2: Type: software-properties-gtk

Step 3: Do not look for a source file because at least in my case it wasn't in the location mentioned elsewhere in the answers

Step 4: The Software Update panel will show up.

Once there, just allow all sources to be able to update. I believe there were three options - tick them all!

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.