eza-community / eza

A modern alternative to ls
https://eza.rocks
European Union Public License 1.2
11.95k stars 216 forks source link

bug: eza: error while loading shared libraries: libgit2.so.1.7: cannot open shared object file: No such file or directory #819

Open chhoumann opened 9 months ago

chhoumann commented 9 months ago

I just updated my WSL Ubuntu system (update, upgrade, cargo updates, brew updates, the works), and then found that I was unable to run eza. This is on v0.18.0 [+git].

I generally run either of the following commands, but not even plain eza worked:

alias ls="eza --icons --git"
alias l='eza -alg --color=always --group-directories-first --git'
alias ll='eza -aliSgh --color=always --group-directories-first --icons --header --long --git'
alias lt='eza -@alT --color=always --git'
alias llt="eza --oneline --tree --icons --git-ignore"
alias lr='eza -alg --sort=modified --color=always --group-directories-first --git'

However, every time I tried to run eza, I'd get this error:

eza: error while loading shared libraries: libgit2.so.1.7: cannot open shared object file: No such file or directory

My solution

I tried updating my Ubuntu from 22 to 24.04, but that didn't work. I also reinstalled a few times, checked for clashing dependencies between packages, etc., but nothing seemed to work.

Then I found this old PR: https://github.com/eza-community/eza/pull/192 & this comment on an issue on cargo-update: https://github.com/nabijaczleweli/cargo-update/issues/243#issuecomment-1915330969

After running:

cargo install eza --force --features vendored-libgit2

the problem was solved.

So there's no problem for me anymore, but I wanted to ensure people who googled this issue would find a solution. Hope to save you 30 minutes :)

I'm not sure if there's an issue with the latest build or something, given the earlier PR that included vendored-libgit2? There must be something I don't know, or haven't set up properly. If it's just a mistake on my part, feel free to close the issue - the problem is solved, then.

Thanks!

0x61nas commented 6 months ago

i have the same problem here after switching my nixos configs without restart

cafkafk commented 6 months ago

i have the same problem here after switching my nixos configs without restart

What's the output of uname -a and nix-info -h?

0x61nas commented 6 months ago

$ uname -a

Linux Mayuri 6.8.7 #1-NixOS SMP PREEMPT_DYNAMIC Wed Apr 17 09:23:43 UTC 2024 x86_64 GNU/Linux

$ nix-info

system: "x86_64-linux", multi-user?: yes, version: nix-env (Nix) 2.18.1, channels(root): "nixos-23.11", nixpkgs: /home/anas/.nix-defexpr/channels/nixpkgs
cafkafk commented 6 months ago

$ uname -a

Linux Mayuri 6.8.7 #1-NixOS SMP PREEMPT_DYNAMIC Wed Apr 17 09:23:43 UTC 2024 x86_64 GNU/Linux

$ nix-info

system: "x86_64-linux", multi-user?: yes, version: nix-env (Nix) 2.18.1, channels(root): "nixos-23.11", nixpkgs: /home/anas/.nix-defexpr/channels/nixpkgs

I can't seem to reproduce this. Did you install from nixpkgs?

0x61nas commented 6 months ago

Did you install from nixpkgs?

yup, as a system package

I can't seem to reproduce this.

I manage my configuration as a flake, and i do have eza listed in my system packages and my user packages in the home manager config, could this be the cause of the problem?

cafkafk commented 6 months ago

I manage my configuration as a flake, and i do have eza listed in my system packages and my user packages in the home manager config, could this be the cause of the problem?

I'm not sure, but you could try removing the user package and see if that changes something.

Also just to be sure, can you post the command you're running and the error output?

0x61nas commented 5 months ago

I'm not sure, but you could try removing the user package and see if that changes something.

I did, and that seems to fix the switching issue. But the error appears again when i tried nix develop and fail

the exact error message:

eza: error while loading shared libraries: libgit2.so.1.7: cannot open shared object file: No such file or directory

image

cafkafk commented 5 months ago

Seems like your store is in a pretty cursed state, specially the no such file or directory errors seem worrying. Have you tried this on another machine?