I deleted a file following a tutorial and now pacman is broken

I was trying to fix a problem and I inserted the following command,

 rm /usr/lib/libssh2.so.1

And now when I rum any pacman command from the terminal I get the following error,

pacman: error while loading shared libraries: libssh2.so.1: cannot open shared object file: No such file or directory

And when I try to open the package manager I get:

Process org.manjaro.pamac.manager exited with status 127 

Also, dolphin and other apps refuse to start.

Please help me as I can’t start dolphin to backup my files and I think if I close the laptop the system won’t start.

You can use the statically linked package pacman-static to reinstall the offending package.libssh2.

2 Likes

This solved the problem for me, Thank you so much!

1 Like

What tutorial did you follow to accomplish what exactly?

What problem?

No, it didn’t. However, it helped you recover from whatever you did that apparently you shouldn’t have done.

I was trying to use cuda with tensorflow using optirun and I got this error

ImportError: /usr/lib/libcurl.so.4: undefined symbol: nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation

while trying to solve this error I pasted the rm command from a solution on stackoverflow.

XY Problem detected: You initially asked about your attempted solution rather than your actual problem. This normally leads to enormous amounts of wasted time and energy, both on the part of people asking for help, and on the part of those providing help.

In this case, @mithrial saved your bacon (so to speak) to recover from an issue that should have never occured to begin with.

3 Likes

Noted, thank you for taking the time to instruct me how to make proper posts here. I will post my initial problem in a sperate post. however here I wanted someone to save me from the mistake I made, as I am new to linux.

1 Like

No worries, research and asking questions along the way is fine.

3 Likes

In the future… don’t just delete system files. It is very rarely a good idea. Actually the only case i can imagine to delete a file that is not a config on the root manually is to remove lock files after an interrupted update. I know absolutely no situation in which one can manually delete libraries and that ends good. For a conflict there is a reason and one resolves the reason and not the symptom.

3 Likes

Rule #1: Never ever manually delete anything under /usr. :wink:

6 Likes

Rule #2 - don’t destroy ■■■■… and use your noggin.

So to follow this tutorial, when it says
rm /usr/lib/libssh2.so.1
I do doas mv /usr/lib/libssh2.so.1 /usr/lib/libssh2.so.1.OLD

Then later on, you’ve got your history, and it’s easy to just rename it back.

3 Likes

Okay, Thank you!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.