ubuntu20.4 执行sudo apt

编程入门 行业动态 更新时间:2024-10-24 04:41:17

ubuntu20.4 执行<a href=https://www.elefans.com/category/jswz/34/1770227.html style=sudo apt"/>

ubuntu20.4 执行sudo apt

 一、错误描述

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

$ sudo apt update
/usr/lib/apt/methods/https: error while loading shared libraries: libnettle.so.6: cannot open shared object file: No such file or directory
/usr/lib/apt/methods/https: error while loading shared libraries: libnettle.so.6: cannot open shared object file: No such file or directory
/usr/lib/apt/methods/https: error while loading shared libraries: libnettle.so.6: cannot open shared object file: No such file or directory
/usr/lib/apt/methods/https: error while loading shared libraries: libnettle.so.6: cannot open shared object file: No such file or directory
Failed to start apt-news.service: Unit apt-news.service not found.
Failed to start esm-cache.service: Unit esm-cache.service not found.
正在读取软件包列表... 完成
E: Method https has died unexpectedly!
E: 子进程 https 返回了一个错误号 (127)
E: 获取软件包的渠道 /usr/lib/apt/methods/https 所需的驱动程序没有正常启动
E: Method https has died unexpectedly!
E: 子进程 https 返回了一个错误号 (127)
E: 获取软件包的渠道 /usr/lib/apt/methods/https 所需的驱动程序没有正常启动
E: Method https has died unexpectedly!
E: 子进程 https 返回了一个错误号 (127)
E: 获取软件包的渠道 /usr/lib/apt/methods/https 所需的驱动程序没有正常启动
E: Method https has died unexpectedly!
E: 子进程 https 返回了一个错误号 (127)
E: 获取软件包的渠道 /usr/lib/apt/methods/https 所需的驱动程序没有正常启动
E: 无法下载 
E: 无法下载 
E: 无法下载 
E: 无法下载 
E: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。

 二、错误原因及解决办法

错误原因:

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

解决方法:

  • 查看 nettle 的路径: find /usr -name 'libnettle*' 
$ find /usr -name 'libnettle*'
/usr/lib/x86_64-linux-gnu/libnettle.so.7.0
/usr/lib/x86_64-linux-gnu/libnettle.so.7
/usr/lib64/libnettle.a
/usr/lib64/libnettle.so.6.0
/usr/lib64/libnettle.so.6.4
/usr/lib64/libnettle.so
/usr/lib64/libnettle.so.6
/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
$ find /usr -name 'libnettle*'
/usr/lib/x86_64-linux-gnu/libnettle.so.7.0
/usr/lib/x86_64-linux-gnu/libnettle.so.7
/usr/lib/libnettle.so.6
/usr/lib64/libnettle.a
/usr/lib64/libnettle.so.6.0
/usr/lib64/libnettle.so.6.4
/usr/lib64/libnettle.so
/usr/lib64/libnettle.so.6
/usr/share/doc/libnettle7
  •  试下 sudo apt-get update 现在报错的提示 libhogweed.so.4 动态链接库错误
$ sudo apt update
/usr/lib/apt/methods/https: error while loading shared libraries: libhogweed.so.4: cannot open shared object file: No such file or directory
/usr/lib/apt/methods/https: error while loading shared libraries: libhogweed.so.4: cannot open shared object file: No such file or directory
/usr/lib/apt/methods/https: error while loading shared libraries: libhogweed.so.4: cannot open shared object file: No such file or directory
/usr/lib/apt/methods/https: error while loading shared libraries: libhogweed.so.4: cannot open shared object file: No such file or directory
Failed to start apt-news.service: Unit apt-news.service not found.
Failed to start esm-cache.service: Unit esm-cache.service not found.
正在读取软件包列表... 完成
E: Method https has died unexpectedly!
E: 子进程 https 返回了一个错误号 (127)
E: 获取软件包的渠道 /usr/lib/apt/methods/https 所需的驱动程序没有正常启动
E: Method https has died unexpectedly!
E: 子进程 https 返回了一个错误号 (127)
E: 获取软件包的渠道 /usr/lib/apt/methods/https 所需的驱动程序没有正常启动
E: Method https has died unexpectedly!
E: 子进程 https 返回了一个错误号 (127)
E: 获取软件包的渠道 /usr/lib/apt/methods/https 所需的驱动程序没有正常启动
E: Method https has died unexpectedly!
E: 子进程 https 返回了一个错误号 (127)
E: 获取软件包的渠道 /usr/lib/apt/methods/https 所需的驱动程序没有正常启动
E: 无法下载 
E: 无法下载 
E: 无法下载 
E: 无法下载 
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
    ~$ sudo apt update
    获取:1  bionic InRelease [242 kB]
    获取:2  bionic-updates InRelease [88.7 kB]---------------------已下载 30.0 MB,耗时 8秒 (3,593 kB/s)
    正在读取软件包列表... 完成
    正在分析软件包的依赖关系树
    正在读取状态信息... 完成
    有 13 个软件包可以升级。请执行 ‘apt list --upgradable’ 来查看它们。

更多推荐

ubuntu20.4 执行sudo apt

本文发布于:2023-12-06 03:43:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1666339.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:sudo   apt

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!