apt-get install命令出错解决

apt-get install命令出错解决

问题描述

在用 ubuntu 18.04 安装angr二进制分析框架时,按照Install Instructions的如下命令安装时

sudo apt-get install python3-dev libffi-dev build-essential virtualenvwrapper

安装失败,并提示如下错误信息

Do you want to continue? [Y/n] Y
Err:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython3.6 amd64 3.6.6-1~18.04
  404  Not Found [IP: 91.189.91.26 80]
Err:2 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3.6 amd64 3.6.6-1~18.04
  404  Not Found [IP: 91.189.91.26 80]
Err:3 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython3.6-stdlib amd64 3.6.6-1~18.04
  404  Not Found [IP: 91.189.91.26 80]
Err:4 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3.6-minimal amd64 3.6.6-1~18.04
  404  Not Found [IP: 91.189.91.26 80]
Err:5 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython3.6-minimal amd64 3.6.6-1~18.04
  404  Not Found [IP: 91.189.91.26 80]
Err:6 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython3.6-dev amd64 3.6.6-1~18.04
  404  Not Found [IP: 91.189.91.26 80]
Err:7 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython3-dev amd64 3.6.5-3ubuntu1
  404  Not Found [IP: 91.189.91.26 80]
Err:8 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3.6-dev amd64 3.6.6-1~18.04
  404  Not Found [IP: 91.189.91.26 80]
Err:9 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3-dev amd64 3.6.5-3ubuntu1
  404  Not Found [IP: 91.189.91.26 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python3.6/libpython3.6_3.6.6-1~18.04_amd64.deb  404  Not Found [IP: 91.189.91.26 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python3.6/python3.6_3.6.6-1~18.04_amd64.deb  404  Not Found [IP: 91.189.91.26 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python3.6/libpython3.6-stdlib_3.6.6-1~18.04_amd64.deb  404  Not Found [IP: 91.189.91.26 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python3.6/python3.6-minimal_3.6.6-1~18.04_amd64.deb  404  Not Found [IP: 91.189.91.26 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python3.6/libpython3.6-minimal_3.6.6-1~18.04_amd64.deb  404  Not Found [IP: 91.189.91.26 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python3.6/libpython3.6-dev_3.6.6-1~18.04_amd64.deb  404  Not Found [IP: 91.189.91.26 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python3-defaults/libpython3-dev_3.6.5-3ubuntu1_amd64.deb  404  Not Found [IP: 91.189.91.26 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python3.6/python3.6-dev_3.6.6-1~18.04_amd64.deb  404  Not Found [IP: 91.189.91.26 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python3-defaults/python3-dev_3.6.5-3ubuntu1_amd64.deb  404  Not Found [IP: 91.189.91.26 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

问题分析

根据报错信息

Unable to fetch some archives, maybe run apt-get update or try with --fix-missing

然后通过查阅资料,发现可能是源/etc/apt/sources.list存在一些问题。通过man apt-get命令,查看了一下update参数的含义,摘录如下:

update
    update is used to resynchronize the package index files from their
    sources. The indexes of available packages are fetched from the
    location(s) specified in /etc/apt/sources.list. For example, when
    using a Debian archive, this command retrieves and scans the
    Packages.gz files, so that information about new and updated
    packages is available. An update should always be performed before
    an upgrade or dist-upgrade. Please be aware that the overall
    progress meter will be incorrect as the size of the package files
    cannot be known in advance.

这段话的意思是说,如果在使用apt-get命令之前,如果不能获取相关包的信息

this command retrieves and scans the Packages.gz files, information about new and updated packages is available

那么就会出一堆错误overall progress meter will be incorrect

Please be aware that the overall progress meter will be incorrect as the size of the package files cannot be known in advance

解决办法

因为是新安装的系统,其中Package信息(如包大小)全未更新。在安装数据包时,所有Package安装失败,完全符合overall progress meter will be incorrect的情况。所以,一条命令解决问题

sudo apt-get update

然后再用apt-get install命令安装,就没问题了。

apt-get update命令的作用是重同步包的索引文件,根据出错的提示信息和update参数的解释,猜测apt-get install命令的过程可能需要包的一些信息:

  1. 包的源,即URL;
  2. 包的大小等一些参数,因为the size of the package files如果不提前知道会出错

注:其实本问题解决的很简单,如果apt-get update命令不能解决问题,通过查阅资料发现还有其它的解决办法,这里有三点思路:

  1. 重新配置/etc/apt/sources.list文件中的源
  2. 配置代理服务器,可能是源被墙了

下一篇想有空在详细分析一下apt-get update发生了什么,以及测试配置源的效果

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
### 回答1: apt-get 是一种用于在 Linux 系统中进行软件包管理的工具。"apt-get install" 命令用于安装软件包。 "-qq" 选项是一种附加选项,用于指示 apt-get 命令在运行时尽可能不输出信息。这意味着它不会显示安装过程中的详细信息,只会在出错时输出错误信息。 通常,当你使用 "-qq" 选项时,你希望 apt-get 命令运行时尽可能静默,只在出现问题时显示错误信息。这可能用于自动化过程,或者在执行批处理操作时,你希望在出现问题时立即收到通知。 例如,你可能会使用以下命令安装软件包: ``` apt-get install -qq package_name ``` 这将安装 "package_name" 软件包,但不会在屏幕上输出任何信息。如果出现问题,则会输出错误信息。 ### 回答2: -qq 是 apt-get install 命令的一个选项,它表示“非常安静”。 使用 -qq 选项时,系统在安装软件包的过程中不会输出额外的信息。这对于用户来说是很有用的,特别是在需要批量安装软件包时。相比于默认模式,使用 -qq 选项可以大大减少输出信息的数量,从而更清晰地显示安装进度和结果。 总结而言,-qq 选项可以使 apt-get install 命令安装软件包时更加安静,减少冗余的输出信息,提高操作效率。 ### 回答3: 在Ubuntu系统中,"apt-get install"是一个命令,用于安装软件包。"-qq"是该命令的一个选项,表示使用“非常静默”模式进行安装。 -qq选项的作用是在安装软件包的过程中,隐藏掉大部分的输出信息。这样做可以避免在终端显示过多的不必要的信息,使安装过程更加简洁清晰。 一般情况下,当我们使用apt-get install命令安装软件包时,终端会显示安装进度、依赖关系以及其他相关信息。但是在实际操作中,有时我们可能更关注安装的结果而不是过程中的详情。这时,我们可以使用-qq选项来减少输出的信息量,只显示最重要的提示和警告。 总之,"-qq"选项用于apt-get install命令,是一种使安装过程更加简化和隐蔽的方法,适用于不需要关注安装细节的场景。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值