apache-mod_log_gelf icon indicating copy to clipboard operation
apache-mod_log_gelf copied to clipboard

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

Open aaronmweiss opened this issue 5 years ago • 2 comments

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.

aaronmweiss avatar Jan 25 '20 18:01 aaronmweiss

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. :)

cabusar avatar Nov 15 '20 00:11 cabusar

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

Sid3way avatar Dec 26 '21 13:12 Sid3way