Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E: Package 'libjson-c2' has no installation candidate #14

Open
aaronmweiss opened this issue Jan 25, 2020 · 2 comments
Open

E: Package 'libjson-c2' has no installation candidate #14

aaronmweiss opened this issue Jan 25, 2020 · 2 comments

Comments

@aaronmweiss
Copy link

Attempting to install this apace-mod_log_gelf on one of the Ubuntu Server 18.04.03 VMs I'm running to send Apache information to another VM that contains the Graylog installation.

When installing the Ubuntu commands, I get hung up on this one:

aaron@maria_dev_lamp:~$ sudo apt-get install libjson-c2 zlib1g
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libjson-c2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libjson-c2' has no installation candidate

I do see that there is a libjson-c3:

aaron@maria_dev_lamp:~$ sudo apt-get install -y libjson-c3
Reading package lists... Done
Building dependency tree
Reading state information... Done
libjson-c3 is already the newest version (0.12.1-1.3).
libjson-c3 set to manually installed.
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libapache2-mod-gelf : Depends: libjson-c2 but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

So essentially, I'm a little stuck. Any help would be appreciated.

@cabusar
Copy link

cabusar commented Nov 15, 2020

Hi,

Same problem here.

Workaround & dirty fix assuming libjson-c3 will work with this mod :

First, extract.

mkdir /tmp/deb-fix
cd /tmp/deb-fix
wget https://github.com/graylog-labs/apache-mod_log_gelf/releases/download/0.2.0/libapache2-mod-gelf_0.2.0-1_amd64.debian.deb
dpkg-deb -R libapache2-mod-gelf_0.2.0-1_amd64.debian.deb .
cd DEBIAN/
nano control

Then modifie the requirements :
(replace libjson-c2 by libjson-c3)

Package: libapache2-mod-gelf
Version: 0.2.0-1
License: Apache v2.0
Vendor: graylog
Architecture: amd64
Maintainer: Graylog, Inc. <[email protected]>
Installed-Size: 81
Depends: apache2, libjson-c3, zlib1g
Section: net
Priority: extra
Homepage: https://www.graylog.org/
Description: Apache2 GELF log module

Finaly recompress the deb package and install :

dpkg-deb -b . libapache2-mod-gelf_0.2.0-1_amd64.debian.fixed.deb
dpkg -i libapache2-mod-gelf_0.2.0-1_amd64.debian.fixed.deb

And last dirty fix (dépend of your arch) :

ln -s /lib/x86_64-linux-gnu/libjson-c.so.3 /lib/x86_64-linux-gnu/libjson-c.so.2

Work like a charm. :)

@Sid3way
Copy link

Sid3way commented Dec 26, 2021

For anyone stumbling upon this while using ubuntu 21.XX, just know that it works with libjson-c5 instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants