Pacman and NetworkManager are not working

After a recent update, pacman and NetworkManager are not working. I get the same error message for both.

sudo pacman -Syu
pacman: symbol lookup error: /usr/lib/libcurl.so.4: undefined symbol: libssh2_session_callback_set2
/usr/bin/NetworkManager --no daemon
/usr/bin/NetworkManager: symbol lookup error: /usr/lib/libcurl.so.4: undefined symbol: libssh2_session_callback_set2

Same problem with pamac and yay. (But wifi-menu is working, so I have internet access.)

Further details about NetworkManager:

sudo systemctl start NetworkManager
Job for NetworkManager.service failed because the control process exited with error code.
See "systemctl status NetworkManager.service" and "journalctl -xeu NetworkManager.service" for details.
systemctl status NetworkManager.service
Ă— NetworkManager.service - Network Manager
     Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Mon 2025-03-03 15:06:05 GMT; 1min 7s ago
 Invocation: 133426c68f18408f827cd07529aa5093
       Docs: man:NetworkManager(8)
    Process: 6521 ExecStart=/usr/bin/NetworkManager --no-daemon (code=exited, status=127)
   Main PID: 6521 (code=exited, status=127)

Mar 03 15:06:05 inspiron systemd[1]: NetworkManager.service: Scheduled restart job, restart counter is at 5.
Mar 03 15:06:05 inspiron systemd[1]: NetworkManager.service: Start request repeated too quickly.
Mar 03 15:06:05 inspiron systemd[1]: NetworkManager.service: Failed with result 'exit-code'.
Mar 03 15:06:05 inspiron systemd[1]: Failed to start Network Manager.

What should I do? Any advice gratefully accepted.

Hi @PaulE, and welcome!

Please provide the output of:

pamac search --installed libcurl

Just the same error, I’m afraid:

pamac search --installed libcurl
pamac: symbol lookup error: /usr/lib/libcurl.so.4: undefined symbol: libssh2_session_callback_set2

Or did I misunderstand you?

Not at all!

Please return the output of:

sudo ldd -r /usr/lib/libssh2.so.1.0.1

Thanks for pursuing this. Here’s the output:

    linux-vdso.so.1 (0x00007fff77fec000)
	libz.so.1 => /usr/lib/libz.so.1 (0x00007f1ef22af000)
	libssl.so.3 => /usr/lib/libssl.so.3 (0x00007f1ef21d3000)
	libcrypto.so.3 => /usr/lib/libcrypto.so.3 (0x00007f1ef1c00000)
	libc.so.6 => /usr/lib/libc.so.6 (0x00007f1ef1a0f000)
	/usr/lib64/ld-linux-x86-64.so.2 (0x00007f1ef2349000)

In case it’s relevant, here are the libssh* files I have in /usr/lib:

ls -l libssh*
lrwxrwxrwx 1 root root     16 Jun  9  2023 libssh2.so -> libssh2.so.1.0.1
lrwxrwxrwx 1 root root     16 Jun  9  2023 libssh2.so.1 -> libssh2.so.1.0.1
-rwxr-xr-x 1 root root 293288 Jun  9  2023 libssh2.so.1.0.1
lrwxrwxrwx 1 root root     11 Aug 30  2024 libssh.so -> libssh.so.4
lrwxrwxrwx 1 root root     16 Aug 30  2024 libssh.so.4 -> libssh.so.4.10.1
-rwxr-xr-x 1 root root 486808 Aug 30  2024 libssh.so.4.10.1

I read somewhere that renaming some of these files might be useful, but I tried renaming both the libssh and the libssh2 files and neither option helped.

1 Like

OK, I officially don’t know what to do.

But what I’d do now, seeing as I don’t see another option:

  1. Boot into a live environment and enter a chroot environment from there.
  2. This is the part I don’t know if it will work:
    From the chroot reinstall libssh:
    pacman -S libcurl-compat --overwrite='/usr/lib/*'
    
  3. If no errors, exit chroot:
    exit
    
  4. Reboot; and
  5. Hope for the best.

Or that’s what I’d do anyway.

If this doesn’t work, I’m sorry to say…

:man_shrugging:

I’m stumped…

Thank you. I’ll try that if nothing else works.

Before I do, I wonder what you think about the following. I don’t seem to be able to post links in this forum, but there is a stackoverflow post that describes a problem that seems similar to mine (though how similar it is I don’t know). The solution that was approved there is the following:

[TESTED SOLUTION]

I got the same problem and fixed it as the previous answer but i will explain it more:

1.Download the libssh2 from here: [link suppressed]

BE SURE TO CHANGE aarch64 IN THE ABOVE URL TO YOUR CPU ARCH

2.unzip the zip you got from it and go to lib directory where you extracted the zip and move the libssh2.so.1.0.1 to /usr/lib with root permissions

3.Test it and it will work!

Do you think something like this might work? I tried downloading libssh2 in a zip and in a tar and decompressing them, but I could not find libssh2.so.1.0.1 in the decompressed versions.

I honestly have NO idea.

But you can always look here because, and I quote:

pacman-staticAUR is a statically compiled version of pacman, so it will be able to run even when the libraries on the system are not working. This can also come in handy when a partial upgrade was performed and pacman can not run anymore.

Thanks a lot for your help, Mirdarthos. I’ll think about this some more and if nothing else occurs to me I’ll try your live environment solution.

1 Like

Fixed it! A variant of the solution in the old StackOverflow post worked in the end.

In case anyone else has a similar problem, I’ll describe what I did as closely as I can.

I went to a Manjaro repository and downloaded a tar file for libssh2: libssh2-1.11.1-1-x86_64.pkg.tar.zst.

In the directory I saved the tar file to, I created a new directory to extract it to:

mkdir libssh2

I extracted the tar file into the new directory:

tar -xvf libssh2-1.11.1-1-x86_64.pkg.tar.zst -C libssh2

I changed directory to a directory called /usr/lib/ within the new directory:

cd libssh2/usr/lib

There there was a file libssh2.so.1.0.1:

ls
pkgconfig  libssh2.so  libssh2.so.1  libssh2.so.1.0.1

I copied libssh2.so.1.0.1 to my main (system-wide) /usr/lib directory (having previously changed the name of the version already there):

sudo cp libssh2.so.1.0.1 /usr/lib

I rebooted and all was well.

3 Likes

That is what I would have done as well - but the procedure, while it is pretty simple, would have been hard to explain to someone not as well versed with the terminal and the structure of the packages as you seem to be. :+1:

… now: why was that same library that you had installed not working
while the “new” one is,
is anyone’s guess …

2 Likes

:point_up: What @Nachlese said. :point_up:

1 Like

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