1

When I recently upgraded to Ubuntu 23.04 from 22.10, I was unable to start Emacs (I am using Doom Emacs). In the terminal I get this message:

emacs: error while loading shared libraries: libtiff.so.5: cannot open shared object file: No such file or directory

Note that under 22.10, I had built and installed Emacs 28.2. I have tried simply installing Emacs 28.2 which now is packaged for Ubuntu 23.04 but that does not work. I also tried creating a symlink between libtiff.so.5 and libtiff.so.6 as suggested by someone (can't find the link now), but again that did not change anything.

Do I need to rebuild and reinstall Emacs under 23.04, or should I completely remove my existing Emacs and Doom and reinstall using apt-get? Or is there something else I should be doing?

I am very much a newbe playing with things I don't really understand, so your help would be appreciated.

David
  • 13

2 Answers2

7

I think Ubuntu 23.04 ships with libtiff.so.6; double-check that this is correct by looking in /usr/lib/x86_64-linux-gnu.

If the particular APIs that Emacs uses in libtiff haven't changed then you can fool Emacs by creating a symlink named libtiff.so.5 to libtiff.so.6.

In /usr/lib/x86_64-linux-gnu run something like sudo ln -s libtiff.so.6 libtiff.so.5.

  • 1
    I would definitely upvote this but apparently I don't have the reputation to do so. It looks like 23.04 ships with libtiff.so.6.0.0 and included symlinks point from libtiff.so and libtiff.so.6 to libtiff.so.6.0.0. Thanks again. – David May 10 '23 at 15:47
  • Sorry, I meant to accept the answer. You can do that as you asked the question. – Anthony Kelly May 11 '23 at 07:53
  • This post, and the similar response other copied below, solved my error with building R package documentation with pkgdown build_site(). https://askubuntu.com/questions/44132/how-do-i-install-libtiff-so-3 – Hayward Oblad Sep 29 '23 at 18:39
0

Note: This solution does not apply to Doom Emacs and should probably be under a much more general question, but this is what solved my emacs upgrade error which complained about libtiff.so.5:

Wow! I performed an upgrade against emacs-gtk and met this error. Applying the accepted solution, proved that this error was only the tip of the ice-burgh. So I did this:

  1. Remove emacs via apt-get purge emacs*
  2. Remove any executable that appears in emacs code completion.
  3. Download, compile, and install emacs from source.

It is unusual that I download any emacs Debian package, but I performed a hurried install last time around when I installed emacs-gtk.

Long ago, I created a routine to compile emacs because it enables emacs automated help to display corresponding source code even if C.

zDir=$(dirname -- "${BASH_SOURCE[0]}")
zSource="$zDir/emacs"
if [[ -d "$zSource" ]]; then
    cd "$zSource"
    git pull --rebase # should I use --rebase?
else
    cd "$zDir" || exit 1
    git clone https://salsa.debian.org/rlb/deb-emacs.git "$zSource"
    cd "$zSource" || exit 1
fi

emacs is deeply connected to x

sudo apt-get -y build-dep emacs-gtk

./autogen.sh # create configure+x according to configure.ac ./configure # create Makefile according to Makefile.in

existing files are not removed by git pull pull --rebase

make clean does not remove old .elc files which will case make to fail

find "$zSource" -name '*.elc' -exec sudo rm '{}' +

make sudo make install # did this instead of make-dist and it worked

cd -

Paul
  • 340