nabijaczleweli / cargo-update

A cargo subcommand for checking and applying updates to installed executables
MIT License
1.22k stars 42 forks source link

Cannot run on Ubuntu 22.04 due to SSL error #182

Closed Walther closed 2 years ago

Walther commented 2 years ago

On Ubuntu 22.04, cargo-update no longer works due to an SSL error.

OS:

cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"

Dependencies:

sudo apt install libgit2-dev libssh-dev libssl-dev pkg-config
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libssh-dev is already the newest version (0.9.6-2build1).
pkg-config is already the newest version (0.29.2-1ubuntu3).
libgit2-dev is already the newest version (1.1.0+dfsg.1-4.1build1).
libssl-dev is already the newest version (3.0.2-0ubuntu1.6).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Application:

cargo install cargo-update
    Updating crates.io index
    Ignored package `cargo-update v8.1.4` is already installed, use --force to override

Attempt to use:

cargo install-update
/home/walther/.cargo/bin/cargo-install-update: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

This is on a server I updated from 21.10 (and previously from 21.04), on which cargo-update still worked. I use cargo-update frequently as part of using topgrade.

Happy to help with further troubleshooting, if you need any more information!

nabijaczleweli commented 2 years ago

Assuming libssl-dev matches the libsslX (it should, there's a hard dep) – you removed libssl.so.1.1 as part of the upgrade, so you need to rebuild (or apt-mark hold the libssl1.1 package I guess, but it's too late for that) against the system library: cargo install cargo-update -f (and some/most other programs you built that aren't part of the distribution and will similarly fail dynamic linking – cf. ldd(1) output on ~/.cargo/bin/cargo-install-update).

Walther commented 2 years ago

Ah of course! Thank you so much.

A simple cargo install cargo-update -f fixed this. Closing the issue & not deleting, maybe it helps someone else searching with the same error message.

Antonio-Bennett commented 1 year ago

@nabijaczleweli I am now getting this error. I tried reinstalling libssl and then reinstalling cargo update but that didn't do anything for me. Any ideas?

nabijaczleweli commented 1 year ago

readelf -d on the cargo-install-update binary, dpkg -S libssl.so, post

Antonio-Bennett commented 1 year ago

@nabijaczleweli

❯ readelf -d .cargo/bin/cargo-install-update

Dynamic section at offset 0x3f4710 contains 34 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libcurl.so.4]
 0x0000000000000001 (NEEDED)             Shared library: [libssl.so.1.1]
 0x0000000000000001 (NEEDED)             Shared library: [libcrypto.so.1.1]
 0x0000000000000001 (NEEDED)             Shared library: [libz.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [ld-linux-x86-64.so.2]
 0x000000000000000c (INIT)               0x47000
 0x000000000000000d (FINI)               0x2b8a04
 0x0000000000000019 (INIT_ARRAY)         0x3c7130
 0x000000000000001b (INIT_ARRAYSZ)       24 (bytes)
 0x000000000000001a (FINI_ARRAY)         0x3c7148
 0x000000000000001c (FINI_ARRAYSZ)       8 (bytes)
 0x000000006ffffef5 (GNU_HASH)           0x3d8
 0x0000000000000005 (STRTAB)             0x2b00
 0x0000000000000006 (SYMTAB)             0x5f8
 0x000000000000000a (STRSZ)              5597 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000015 (DEBUG)              0x0
 0x0000000000000003 (PLTGOT)             0x3f4970
 0x0000000000000002 (PLTRELSZ)           6072 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0x456d0
 0x0000000000000007 (RELA)               0x45b8
 0x0000000000000008 (RELASZ)             266520 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x0000000000000018 (BIND_NOW)
 0x000000006ffffffb (FLAGS_1)            Flags: NOW PIE
 0x000000006ffffffe (VERNEED)            0x43f8
 0x000000006fffffff (VERNEEDNUM)         5
 0x000000006ffffff0 (VERSYM)             0x40de
 0x000000006ffffff9 (RELACOUNT)          10962
 0x0000000000000000 (NULL)               0x0
❯ dpkg -s libssl.o
dpkg-query: package 'libssl.o' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files.

I similarly ran an update previously so I assume it removed libssl1.1 and now has version 3. However when I run cargo install cargo-update -f I now can't update because of dynamic linking I believe. The libssldev library uses openssl3 I can install if I use the vendored openssl

nabijaczleweli commented 1 year ago

And what about dpkg -S libssl.so? If your libssl-dev is for libssl3 then it should link to libssl3; if it doesn't, then open an issue at https://github.com/sfackler/rust-openssl. If you don't care, then cargo install-update-config -f vendored-openssl cargo-update and cargo-update will be built with vendored-openssl by default.