5

After upgrade ubuntu 16 to 18, I got this error when executing tmux:

tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory

and here's result when I execute ldd $(which tmux):

linux-vdso.so.1 (0x00007ffd9878a000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f5588dfc000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f5588bd2000)
libevent-2.0.so.5 => not found
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f55889b7000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f55885c6000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5588fff000

I got tmux by following instructions on GitHub. It worked on Ubuntu 16.

$ apt-cache policy tmux

Installed: (none)
Candidate: 2.6-3
Version table:
    2.6-3 500
    500 http://id.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
    100 /var/lib/dpkg/status
  • 1
    Tmux under Bionic (18.04) requires a later version of libevent (2.1) than you mention (packages.ubuntu.com/bionic/tmux). Where did you get your tmux as it doesn't match the bionic version of tmux (your version does match the requirements for xenial's tmux packages.ubuntu.com/xenial/tmux) maybe check your apt-cache policy tmux – guiverc May 9 '18 at 2:25
  • I got tmux by follow instuction on github ( github.com/tmux/tmux ) It was works on ubuntu 16. here's result **apt-cache policy tmux ** Installed: (none) Candidate: 2.6-3 Version table: 2.6-3 500 500 http://id.archive.ubuntu.com/ubuntu bionic/main amd64 Packages 100 /var/lib/dpkg/status – Sastra Nababan May 9 '18 at 3:07
  • 2
    ie. you installed it yourself, you agreed to maintain it yourself (as apt packaging doesn't know about it & thus can't maintain-upgrade it) and you need to manage the upgrades yourself (as you didn't install the auto-maintained version). You'll need to recompile for your existing installation (you compiled (make; make install) it for 16.04 and not 18.04) or remove it, and install the Ubuntu one (which won't need these steps on future release-upgrades). – guiverc May 9 '18 at 3:22
6

As @guiverc commented - both tmux and libevent are well-packaged on Ubuntu Bionic Beaver 18.04 LTS (and other versions).

You should remove locally-installed tmux with one of the following methods:

  • Check version of locally-installed tmux:

    tmux -V # or from `man tmux`
    

    Then clone this version from its github repository, compile it again and run

    sudo make uninstall
    
  • Simply remove your self-installed tmux with

    sudo rm $(which tmux)
    

    Note: running sudo rm $(which tmux) looks safe because of the fact that even official package do not have shipped other binaries or libraries.

And install package from repository:

sudo apt-get install tmux
  • Self-compiled packages are better removed with sudo make uninstall, if available (not all source packages provide it). – fkraiem May 9 '18 at 9:56
  • I agree, but we do not have any guarantee that OP has not removed original source directory. Edited my answer. – N0rbert May 9 '18 at 9:59
  • 1
    The source directory can always be re-obtained. ;) – fkraiem May 9 '18 at 10:05
  • @fkraiem thank you for great idea. I edited the answer again. – N0rbert May 9 '18 at 10:08
2

Tmux under Bionic (18.04) requires a later version of libevent (2.1) than you mention (https://packages.ubuntu.com/bionic/tmux). I asked "where did you get your tmux as it doesn't match the bionic version of tmux" noting your version does match the requirements for xenial's tmux (https://packages.ubuntu.com/xenial/tmux) suggesting check your

apt-cache policy tmux

You then told me you installed it yourself, meaning you (possibly unwittingly or unknowingly) agreed to maintain it yourself as apt packaging doesn't know about it & thus can't maintain-upgrade it. Thus you need to manage the upgrades yourself (as you didn't install the auto-maintained version).

Your two main choices I see are :-

(1) you need to recompile for your existing installation (following the instructions in the documented you used the first time, eg. make; make install..) as your prior compile was done for Ubuntu 16.04 and not 18.04.

(2) remove it, and install the Ubuntu one using normal apt tools. This has the advantage of always having automatic security updates, plus will be updated in future release-upgrades (even if this is 20.04) See @N0rbert's answer & thread's comments for clues as to removal

[these notes were comments converted to an answer]

  • 2
    You’re welcome! For next time, you should mention me in a comment on the question as the notification does not work here where I haven’t commented/edited yet. You’re lucky I’ve come across the question again. :-) – Melebius May 9 '18 at 13:40
1

This solved my issue:

sudo apt install libevent-dev
  • pacman -S libevent works for me in arch linux. – ArcherGodson Sep 17 '19 at 11:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.