• ubuntu20.4 执行sudo apt-get update出现错误 libnettle.so.6 动态链接库错误


     一、错误描述

    sudo apt-get update 报错提示  libnettle.so.6 动态链接库错误

    1. $ sudo apt update
    2. /usr/lib/apt/methods/https: error while loading shared libraries: libnettle.so.6: cannot open shared object file: No such file or directory
    3. /usr/lib/apt/methods/https: error while loading shared libraries: libnettle.so.6: cannot open shared object file: No such file or directory
    4. /usr/lib/apt/methods/https: error while loading shared libraries: libnettle.so.6: cannot open shared object file: No such file or directory
    5. /usr/lib/apt/methods/https: error while loading shared libraries: libnettle.so.6: cannot open shared object file: No such file or directory
    6. Failed to start apt-news.service: Unit apt-news.service not found.
    7. Failed to start esm-cache.service: Unit esm-cache.service not found.
    8. 正在读取软件包列表... 完成
    9. E: Method https has died unexpectedly!
    10. E: 子进程 https 返回了一个错误号 (127)
    11. E: 获取软件包的渠道 /usr/lib/apt/methods/https 所需的驱动程序没有正常启动
    12. E: Method https has died unexpectedly!
    13. E: 子进程 https 返回了一个错误号 (127)
    14. E: 获取软件包的渠道 /usr/lib/apt/methods/https 所需的驱动程序没有正常启动
    15. E: Method https has died unexpectedly!
    16. E: 子进程 https 返回了一个错误号 (127)
    17. E: 获取软件包的渠道 /usr/lib/apt/methods/https 所需的驱动程序没有正常启动
    18. E: Method https has died unexpectedly!
    19. E: 子进程 https 返回了一个错误号 (127)
    20. E: 获取软件包的渠道 /usr/lib/apt/methods/https 所需的驱动程序没有正常启动
    21. E: 无法下载 https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic/InRelease
    22. E: 无法下载 https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic-updates/InRelease
    23. E: 无法下载 https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic-backports/InRelease
    24. E: 无法下载 https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic-security/InRelease
    25. E: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。

     二、错误原因及解决办法

    错误原因:

    • 导致原因应该是在安装gnutls的时候报错:Libnettle 3.1 was not found,所以安装 了nettle,之后出现的。
    • 问题应该是在安装 nettle 的时候,安装到了/usr/lib64/lib目录下了。update 默认会到系统目录下/usr/lib下寻找依赖关系,软件按系统依赖查找的原因造成。

    解决方法:

    • 查看 nettle 的路径: find /usr -name 'libnettle*' 
    1. $ find /usr -name 'libnettle*'
    2. /usr/lib/x86_64-linux-gnu/libnettle.so.7.0
    3. /usr/lib/x86_64-linux-gnu/libnettle.so.7
    4. /usr/lib64/libnettle.a
    5. /usr/lib64/libnettle.so.6.0
    6. /usr/lib64/libnettle.so.6.4
    7. /usr/lib64/libnettle.so
    8. /usr/lib64/libnettle.so.6
    9. /usr/share/doc/libnettle7
    • 给 /usr/lib64/libnettle.so.6 建立一个的链接到 /usr/lib/libnettle.so.6
    $ sudo ln -s /usr/lib64/libnettle.so.6 /usr/lib/libnettle.so.6
    •  查看 nettle 的路径: find /usr -name 'libnettle*' ,多了 /usr/lib/libnettle.so.6
    1. $ find /usr -name 'libnettle*'
    2. /usr/lib/x86_64-linux-gnu/libnettle.so.7.0
    3. /usr/lib/x86_64-linux-gnu/libnettle.so.7
    4. /usr/lib/libnettle.so.6
    5. /usr/lib64/libnettle.a
    6. /usr/lib64/libnettle.so.6.0
    7. /usr/lib64/libnettle.so.6.4
    8. /usr/lib64/libnettle.so
    9. /usr/lib64/libnettle.so.6
    10. /usr/share/doc/libnettle7
    •  试下 sudo apt-get update 现在报错的提示 libhogweed.so.4 动态链接库错误
    1. $ sudo apt update
    2. /usr/lib/apt/methods/https: error while loading shared libraries: libhogweed.so.4: cannot open shared object file: No such file or directory
    3. /usr/lib/apt/methods/https: error while loading shared libraries: libhogweed.so.4: cannot open shared object file: No such file or directory
    4. /usr/lib/apt/methods/https: error while loading shared libraries: libhogweed.so.4: cannot open shared object file: No such file or directory
    5. /usr/lib/apt/methods/https: error while loading shared libraries: libhogweed.so.4: cannot open shared object file: No such file or directory
    6. Failed to start apt-news.service: Unit apt-news.service not found.
    7. Failed to start esm-cache.service: Unit esm-cache.service not found.
    8. 正在读取软件包列表... 完成
    9. E: Method https has died unexpectedly!
    10. E: 子进程 https 返回了一个错误号 (127)
    11. E: 获取软件包的渠道 /usr/lib/apt/methods/https 所需的驱动程序没有正常启动
    12. E: Method https has died unexpectedly!
    13. E: 子进程 https 返回了一个错误号 (127)
    14. E: 获取软件包的渠道 /usr/lib/apt/methods/https 所需的驱动程序没有正常启动
    15. E: Method https has died unexpectedly!
    16. E: 子进程 https 返回了一个错误号 (127)
    17. E: 获取软件包的渠道 /usr/lib/apt/methods/https 所需的驱动程序没有正常启动
    18. E: Method https has died unexpectedly!
    19. E: 子进程 https 返回了一个错误号 (127)
    20. E: 获取软件包的渠道 /usr/lib/apt/methods/https 所需的驱动程序没有正常启动
    21. E: 无法下载 https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic/InRelease
    22. E: 无法下载 https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic-updates/InRelease
    23. E: 无法下载 https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic-backports/InRelease
    24. E: 无法下载 https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic-security/InRelease
    25. E: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。
    •  给 /usr/lib64/libhogweed.so.4 建立一个的链接到 /usr/lib/libhogweed.so.4
    $ sudo ln -s /usr/lib64/libhogweed.so.4 /usr/lib/libhogweed.so.4
    •  $ sudo apt update
      1. ~$ sudo apt update
      2. 获取:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease [242 kB]
      3. 获取:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease [88.7 kB]
      4. ---------------------
      5. 已下载 30.0 MB,耗时 8秒 (3,593 kB/s)
      6. 正在读取软件包列表... 完成
      7. 正在分析软件包的依赖关系树
      8. 正在读取状态信息... 完成
      9. 13 个软件包可以升级。请执行 ‘apt list --upgradable’ 来查看它们。

  • 相关阅读:
    云服务器与内网穿透有什么区别?哪个好用?
    网络安全—综合渗透测试-CVE-2019-15107-Webmin远程代码执行
    项目通用Makefile的编写(包含Makefile.build文件分析)
    如何批量查询搜狗收录?提升搜狗收录8个方法介绍
    Redis 6.0 新功能
    2023-09-20力扣每日一题-水题
    什么是SRRC认证?SRRC认证是什么?
    Python信号之分享
    Saruman‘s Army
    数据库设计:防止MySQL字段名与关键字相撞,保护数据完整性!
  • 原文地址:https://blog.csdn.net/wwqingyue/article/details/133959314