Ubuntu 18.04:libcrypto.so.1.0.0:无法打开共享对象文件:没有此文件或目录

Ubuntu 18.04:libcrypto.so.1.0.0:无法打开共享对象文件:没有此文件或目录

这是输出

sudo apt-get -f install

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer 
required:
linux-modules-4.15.0-33-generic linux-modules-4.15.0-34-generic
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
linux-image-4.15.0-33-generic linux-image-4.15.0-34-generic
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
7 not fully installed or removed.
After this operation, 16.6 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 237395 files and directories currently 
installed.)
Removing linux-image-4.15.0-33-generic (4.15.0-33.36) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.0-33-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
/etc/grub.d/bin/grubcfg_proxy: error while loading shared libraries: 
libcrypto.so.1.0.0: cannot open shared object file: No such file or 
directory
Found Windows Boot Manager on 
/dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 
127
dpkg: error processing package linux-image-4.15.0-33-generic (-- 
remove):
installed linux-image-4.15.0-33-generic package post-removal script 
subprocess returned error exit status 1
Removing linux-image-4.15.0-34-generic (4.15.0-34.37) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.0-34-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
/etc/grub.d/bin/grubcfg_proxy: error while loading shared libraries: 
libcrypto.so.1.0.0: cannot open shared object file: No such file or 
directory
Found Windows Boot Manager on 
/dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code     
127
dpkg: error processing package linux-image-4.15.0-34-generic (-- 
remove):
installed linux-image-4.15.0-34-generic package post-removal script 
subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-4.15.0-33-generic
linux-image-4.15.0-34-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

https://i.stack.imgur.com/WaZPo.png

编辑:输出

sudo locate libcrypto.so.1.0.0

/snap/core/5897/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
/snap/core/6130/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
/snap/core/6350/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
/snap/core18/594/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
/snap/core18/677/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
/snap/gnome-3-26-1604/70/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
/snap/gnome-3-26-1604/74/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
/snap/kde-frameworks-5-core18/26/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0


apt list libssl1*

Listing... Done
libssl1.0-dev/bionic-updates,bionic-security 1.0.2n-1ubuntu5.2 amd64
libssl1.0.0/bionic-updates,bionic-security,now 1.0.2n-1ubuntu5.2 amd64 [installed]
libssl1.1/bionic-updates,bionic-security,now 1.1.0g-2ubuntu4.3 amd64 [installed]

答案1

使用 Ubuntu Software Updater 从 18.04 更新到 19.04 后,我遇到了与 OP 相同的错误。

当更新即将完成并且正在删除旧的未使用的 Linux 内核时,OP 的错误发生在由更新程序驱动的 grub 配置步骤期间。

在寻找补救措施时,我找到了 OP 的帖子并尝试了相同的步骤。当我即兴发挥并找到一个干净的解决方法时,我将其发布在这里:

lnx:~$ sudo apt-get install -f
[sudo] password for john: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  breeze-cursor-theme fonts-hack fonts-hack-ttf oxygen-icon-theme
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  linux-image-4.15.0-58-generic linux-image-4.15.0-60-generic
0 to upgrade, 0 to newly install, 2 to remove and 1 not to upgrade.
2 not fully installed or removed.
After this operation, 16.7 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 205548 files and directories currently installed.)
Removing linux-image-4.15.0-58-generic (4.15.0-58.64) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.0-58-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.0.0-32-generic
Found initrd image: /boot/initrd.img-5.0.0-32-generic
Found linux image: /boot/vmlinuz-4.15.0-66-generic
Found initrd image: /boot/initrd.img-4.15.0-66-generic
/etc/grub.d/bin/grubcfg_proxy: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-4.15.0-58-generic (--remove):
 installed linux-image-4.15.0-58-generic package post-removal script subprocess returned error exit status 1
Removing linux-image-4.15.0-60-generic (4.15.0-60.67) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.0-60-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
/etc/grub.d/bin/grubcfg_proxy: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory
Found linux image: /boot/vmlinuz-5.0.0-32-generic
Found initrd image: /boot/initrd.img-5.0.0-32-generic
Found linux image: /boot/vmlinuz-4.15.0-66-generic
Found initrd image: /boot/initrd.img-4.15.0-66-generic
/etc/grub.d/bin/grubcfg_proxy: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-4.15.0-60-generic (--remove):
 installed linux-image-4.15.0-60-generic package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
 linux-image-4.15.0-58-generic
 linux-image-4.15.0-60-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
W: Operation was interrupted before it could finish

因此,libcrypto.so.1.0.0未在预期位置找到grubcfg_proxy。按照 OP 的一位回复者的建议:

lnx:~$ sudo locate libcrypto.so.1.0.0
/snap/core/7713/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
/snap/core/7917/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
/snap/core18/1192/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
/snap/core18/1223/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
/snap/gnome-3-26-1604/92/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
/snap/gnome-3-26-1604/97/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0

我接着说道:

lnx:~$ for l in $(sudo locate libcrypto.so.1.0.0); do md5sum $l; done
829091982233166cdaa55b41fb353609  /snap/core/7713/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
829091982233166cdaa55b41fb353609  /snap/core/7917/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
18403538a12facf8aced1dcfcccef1ba  /snap/core18/1192/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
18403538a12facf8aced1dcfcccef1ba  /snap/core18/1223/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
829091982233166cdaa55b41fb353609  /snap/gnome-3-26-1604/92/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
829091982233166cdaa55b41fb353609  /snap/gnome-3-26-1604/97/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
md5sum: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0: No such file or directory

啊哈!肯定是需要找的/usr/lib/x86_64-linux-gnu/地方了。grubcfg_proxylibcrypto.so.1.0.0

其他哪些文件可以复制到或cp -p预期位置?md5 签名告诉我哪些文件是相同的字节内容。是否有相同的实际文件?lnln -s

lnx:~$ for l in $(sudo locate libcrypto.so.1.0.0); do ls -il $l; done
2134 -rw-r--r-- 1 root root 2365952 Feb 27  2019 /snap/core/7713/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
2134 -rw-r--r-- 1 root root 2365952 Feb 27  2019 /snap/core/7917/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
5689 -rw-r--r-- 1 root root 2357760 Feb 27  2019 /snap/core18/1192/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
5690 -rw-r--r-- 1 root root 2357760 Feb 27  2019 /snap/core18/1223/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
165 -rw-r--r-- 1 root root 2365952 Feb 27  2019 /snap/gnome-3-26-1604/92/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
165 -rw-r--r-- 1 root root 2365952 Feb 27  2019 /snap/gnome-3-26-1604/97/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
ls: cannot access '/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0': No such file or directory

第 1 列中的 inode 编号显示哪些实例libcrypto.so.1.0.0,而第 3 列中的硬链接计数 1 显示符号链接参与提供多条路径。

我决定只需将cp -p其中一个文件移到正确的位置即可解决问题。我该选择两种不同的 md5 签名/按字节不同的内容选项中的哪一种?

经过谷歌搜索后,我发现它/snap/core/...基于 ubuntu 16.04,并且/snap/core18/...基于 ubuntu 18.04。

我倾向于/snap/core18/.../libcrypto.so.1.0.0

经过一番检查后发现/snap/core18/.../libcrypto.so.1.1/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1在字节上是相同的,所以我决定保留/usr/lib/x86_64-linux-gnu/libcrypto.so.1.*所有 ubuntu 18.04。

我将文件复制到适当位置并sudo apt-get install -f再次运行。瞧!grubcfg_proxy很高兴,旧内核已被删除。

lnx:~$ sudo cp -p /snap/core18/1223/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
lnx:~$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  breeze-cursor-theme fonts-hack fonts-hack-ttf oxygen-icon-theme
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  linux-image-4.15.0-58-generic linux-image-4.15.0-60-generic
0 to upgrade, 0 to newly install, 2 to remove and 1 not to upgrade.
2 not fully installed or removed.
After this operation, 16.7 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 205548 files and directories currently installed.)
Removing linux-image-4.15.0-58-generic (4.15.0-58.64) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.0-58-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.0.0-32-generic
Found initrd image: /boot/initrd.img-5.0.0-32-generic
Found linux image: /boot/vmlinuz-4.15.0-66-generic
Found initrd image: /boot/initrd.img-4.15.0-66-generic
Found linux image: /boot/vmlinuz-5.0.0-32-generic
Found initrd image: /boot/initrd.img-5.0.0-32-generic
Found linux image: /boot/vmlinuz-4.15.0-66-generic
Found initrd image: /boot/initrd.img-4.15.0-66-generic
Found Windows 10 on /dev/sda1
Found Windows 10 on /dev/sda1
Found linux image: /boot/vmlinuz-5.0.0-32-generic
Found initrd image: /boot/initrd.img-5.0.0-32-generic
Found linux image: /boot/vmlinuz-4.15.0-66-generic
Found initrd image: /boot/initrd.img-4.15.0-66-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 10 on /dev/sda1
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
Removing linux-image-4.15.0-60-generic (4.15.0-60.67) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.0-60-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.0.0-32-generic
Found initrd image: /boot/initrd.img-5.0.0-32-generic
Found linux image: /boot/vmlinuz-4.15.0-66-generic
Found initrd image: /boot/initrd.img-4.15.0-66-generic
Found linux image: /boot/vmlinuz-5.0.0-32-generic
Found initrd image: /boot/initrd.img-5.0.0-32-generic
Found linux image: /boot/vmlinuz-4.15.0-66-generic
Found initrd image: /boot/initrd.img-4.15.0-66-generic
Found Windows 10 on /dev/sda1
Found Windows 10 on /dev/sda1
Found linux image: /boot/vmlinuz-5.0.0-32-generic
Found initrd image: /boot/initrd.img-5.0.0-32-generic
Found linux image: /boot/vmlinuz-4.15.0-66-generic
Found initrd image: /boot/initrd.img-4.15.0-66-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 10 on /dev/sda1
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done

/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0我现在可以从 ubuntu 19.04 更新到 19.10,磁盘上只有 18.04 的“crufty”,也许可以帮助解决未来的包管理问题。首先,为了保险起见:

john@jameskb-lnx:~$ sudo apt-get install -f
[sudo] password for john: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  breeze-cursor-theme fonts-hack fonts-hack-ttf oxygen-icon-theme
Use 'sudo apt autoremove' to remove them.

看起来我可以再清理一下了;)

答案2

首先找到你的图书馆在哪里:

sudo locate libcrypto.so.1.0.0

然后将其复制到 /usr/lib/ 文件夹中:

sudo cp /snap/gnome-3-26-1604/82/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /usr/lib/

答案3

请检查您的系统上安装了哪个版本的 libssl,在我的 Ubuntu 19.04 上,安装的是 libssl1.1,而不是所需的 libssl1.0。所以我必须安装 libssl1.0 附带的软件。最好的部分是 ubuntu 附带 snap 来安装 Termius 等软件。然后按照“Rodrigo”的回答解决问题。

找到安装的路径:

sudo locate libcrypto.so.1.0.0

然后将发现的路径添加到路径变量中:

export PATH=<discovered path>:$PATH

或者将库添加到预包含路径:

sudo ln -s <discovered path> /usr/lib/

相关内容