问题描述
在用 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
命令的过程可能需要包的一些信息:
- 包的源,即URL;
- 包的大小等一些参数,因为
the size of the package files
如果不提前知道会出错
注:其实本问题解决的很简单,如果apt-get update
命令不能解决问题,通过查阅资料发现还有其它的解决办法,这里有三点思路:
- 重新配置
/etc/apt/sources.list
文件中的源 - 配置代理服务器,可能是源被墙了
下一篇想有空在详细分析一下apt-get update发生了什么,以及测试配置源的效果