Error opening darktable

Getting the following error
darktable: error while loading shared libraries: libx265.so.179: cannot open shared object file: No such file or directory

I have libx265.so.199 installed. I have no idea how this happened but DT was working last time I used before running software updater today.
my system - Ubuntu 22.04

As a quick and dirty fix I’d try to locate libx265.so.199 and make a symlink to it (or it’s source as it’s may be a symlink itself), in the same folder, named libx265.so.179

It may work but surely there is a better solution :smiley:

As a general problem solving and less quickfix solution, check where you gat your darktable from and :
if it’s from base ubuntu repository, you could warn the package maintainer.
if it’s from a PPA check that this PPA is aimed at your version of Ubuntu and if it is warn the PPA maintainer.

The root of the problem probably being that Ubuntu 22.04 updated libx265 but the DT binary provided by the package you used to install it are compiled against the older version of libx265.
I did not know that DT needed that as it’s more video oriented library !

1 Like

It is a dependency of libheif which is used by dt to read ā€œmodernā€ HEIC (HEVC aka H.265 encoded) images (it is indeed a codec designed for video primarily).

2 Likes

For debugging, can you post the output of

which darktable

ldd `which darktable` | grep libx265

from the terminal?

raj@:~ which darktable /usr/bin/darktable raj@:~ ldd which darktable | grep libx265
libx265.so.179 => not found
also many other things which were working like heif-enc from libheif, image viewer which was showing .heic files is not showing
But
ldd $(which ffmpeg) | grep libx265
libx265.so.199 => /lib/x86_64-linux-gnu/libx265.so.199 (0x00007fa2dd44a000)

The version libx265.so.179 is only available in ubuntu 20.04 while I am on 22.04 for many months and everything was working till yeasterday.

I which version you have installed. Please post the equivalent of

$ dpkg -l darktable | grep dark
ii  darktable      4.2.1-4      amd64        virtual lighttable and darkroom for photographers

$ apt policy darktable
darktable:
  Installed: 4.2.1-4
  Candidate: 4.2.1-4
  Version table:
 *** 4.2.1-4 500
        500 http://hu.archive.ubuntu.com/ubuntu lunar/universe amd64 Packages
        100 /var/lib/dpkg/status

(My install has plain vanilla darktable included with Ubuntu, yours might come from the darktable repo, let’s find out).

dpkg -l darktable | grep dark
ii darktable 4.3.0~git1231.8d70e284-1+9458.1 amd64 virtual lighttable and darkroom for photographers

darktable:
Installed: 4.3.0~git1231.8d70e284-1+9458.1
Candidate: 4.3.0~git1231.8d70e284-1+9458.1
Version table:
*** 4.3.0~git1231.8d70e284-1+9458.1 500
500 /repositories/graphics:/darktable:/master/xUbuntu_22.04 - openSUSE Download Packages
100 /var/lib/dpkg/status
4.2.1-1.1+59.1 500
500 /repositories/graphics:/darktable/xUbuntu_22.04 - openSUSE Download Packages
3.8.1-2 500
500 https://ubuntu-repos.bom.anuragbhatia.com jammy/universe amd64 Packages
500 Index of /ubuntu/ jammy/universe amd64 Package

You have installed the OBS packages. I am not sure who the current maintainer is, but

$ dpkg-query --show -f '${Maintainer}' darktable

will tell you. You should report a bug.

I don’t think that it is a bug as many other software which I mentioned earlier has stopped working and all are referring to libx265.so.179.
is there a way where by all packages/Apps using this earlier version now use the new version?

Sounds like it could be a bug in the libheif package actually (or wrong/outdated package), not necessarily darktable.

Perhaps if an upgrade was interrupted. Try

sudo dpkg --configure --pending
sudo apt -f install

Today I did apt-get update and upgrade and then autoremove . The apt history.log shows

Start-Date: 2023-03-28 12:04:57
Commandline: aptdaemon role=ā€˜role-commit-packages’ sender=ā€˜:1.308’
Upgrade: google-chrome-stable:amd64 (111.0.5563.110-1, 111.0.5563.146-1)
End-Date: 2023-03-28 12:05:03

Start-Date: 2023-03-28 12:11:50
Commandline: apt autoremove
Requested-By: raj (1000)
Remove: libvpx6:amd64 (1.8.2-1build1), libx264-155:amd64 (2:0.155.2917+git0a84d98-2), libx265-179:amd64 (3.2.1-1build1), libwebp6:amd64 (0.6.1-2ubuntu0.20.04.1), python3-dbus.mainloop.pyqt5:amd64 (5.15.6+dfsg-1ubuntu3)
End-Date: 2023-03-28 12:11:51

when I tried to reinstall the above packages all are giving error like
Package ā€˜libvpx6’ has no installation candidate.

@Tamas_Papp I tried it and nothing is installed
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
0 to upgrade, 0 to newly install, 0 to remove and 4 not to upgrade.

I would try installing them manually, eg

sudo apt install libx265-dev libx265-199

That said, I grabbed the OBS deb package, and it seems that it is not listed as a dependency:

$ dpkg -I darktable_4.3.0\~git1231.8d70e284-1+9458.1_amd64.deb | grep 265 
[empty]

so I still think it may be a bug.

See again my comments above - it is not a dependency of darktable, it is a dependency of libheif.

1 Like

But in libheif1 has the dependency.

In any case, if a binary links to a library, it should have it as a direct dependency. Relying on indirect deps is not sufficient.

No. There is no code whatsover in darktable that uses libx265. Overlinking is to be avoided.

I guess one could use something like lddtree to figure out what exactly tries to link to this old libx265, as ldd alone does not give you the hierarchy. Or try to understand the output of ldd -v.

1 Like

Thanks for the correction, indeed it is not a direct dependency. lddtree (which I did not know about, thanks!) is in pax-utils, it suggests that this is a dependency of libheif.

Since darktable depends on the latter, it is a mystery to me why the relevant library is not installed.

It would seem there might be something specific to OP’s system that prevents the correct package of libheif to be upgraded.

That’s a possibility. @Rajkhand, can you post the output of

dpkg -l libheif1

?

By luck now DT and other apps are working.

Solution
I was searching for libx265 and I saw that libx265.so.179 was present in Firefox Snap package, I simply copied this file to /usr/lib/x86_64-linux-gnu/ and everything (except cannot view heic files in Image viewer or shotwell) started working.
Edit: Image viewer works after reinstalling

sudo apt-get --reinstall install heif-gdk-pixbuf

I know that this is not a solution as first of all, Ubuntu should not have removed this file in --autoremove and secondly why all these programs didn’t work because of this when a newer version file was present at this location. Is the reference hard coded?

@Tamas_Papp
dpkg -l libheif1
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
++±==============-==============-============-================================>
ii libheif1:amd64 1.12.0-2build1 amd64 ISO/IEC 23008-12:2017 HEIF file >
lines 1-6/6 (END)