The error occurs when installing the package 'libeccodes-dev'

Asked by Xinxu Zhao on 2018-11-07

I want to install the package 'libeccodes-dev' in the system.
But after the application of 'sudo apt-get install libeccodes-dev', it shows one error 'Uable to locate package libeccodes-dev'.

I tried several methods to fix it but still failed, including 'sudo apt update', checking '/etc/apt/sources.list' etc..

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu eccodes Edit question
Assignee:
No assignee Edit question
Solved by:
Xinxu Zhao
Solved:
2018-11-08
Last query:
2018-11-08
Last reply:
2018-11-07
Xinxu Zhao (xinxuzhao) said : #1

The root cause of this problem is that I want to run 'Makefile' for a conversion tool called 'era2arl'.
But it shows the error that

/usr/bin/ld: cannot find -leccodes_f90
/usr/bin/ld: cannot find -leccodes
collect2: error: ld returned 1 exit status
make: *** [era52arl] Error 1

I think this error is caused by the uninstallation of eccodes lib development files.

Manfred Hampl (m-hampl) said : #2

For diagnostic purposes please provide the output of the commands

uname -a
lsb_release -crid
sudo apt-get update
apt-cache policy libeccodes-dev libeccodes0

Xinxu Zhao (xinxuzhao) said : #3

Hi Manfred,

>uname -a
Linux TUEIESM-SRV2 4.4.0-124-generic #148~14.04.1-Ubuntu SMP Thu May 3 07:26:53 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

> lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty

>sudo apt-get update

Fetched 2970 kB in 5s (513 kB/s)
Reading package lists... Done
W: Duplicate sources.list entry http://de.archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_trusty-updates_universe_binary-amd64_Packages)
W: Duplicate sources.list entry http://de.archive.ubuntu.com/ubuntu/ trusty-updates/universe i386 Packages (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_trusty-updates_universe_binary-i386_Packages)
W: You may want to run apt-get update to correct these problems

I re-run the apt-get update. The warnings still exist.

>apt-cache policy libeccodes-dev libeccodes0
apt-cache policy libeccodes-dev libeccodes0
N: Unable to locate package libeccodes-dev
N: Unable to locate package libeccodes0

Thx!

Xinxu

Manfred Hampl (m-hampl) said : #4

You are running Ubuntu trusty (14.04).
On the page https://launchpad.net/ubuntu/+source/eccodes you can see that the eccodes libraries are available only for Ubuntu bionic (18.04) and newer.

You either have to backport eccodes to Ubuntu trusty (if that is possible at all), or upgrade to a newer release of Ubuntu.

Remark: Support for Ubuntu trusty (14.04) will end in half a year's time, so you have to consider a release upgrade in any case.

Xinxu Zhao (xinxuzhao) said : #5

Thx, Manfred. I have updated the version and now I can run it well! The problem is solved.

Xinxu Zhao (xinxuzhao) said : #6

The error is caused by the old version of Ubuntu trusty.