前言
听说aptitude比apt-get能更好的解决包依赖的问题,就一个apt-get install aptitude
安装上了,中间报了个警告也没管,安装完毕后发现apt-get没了,,,aptitude update
也报错,这便又踏上了填坑之旅。
警告
W: Unable to read /etc/apt/preferences.d/ - DirectoryExists (2: No such file or directory)
这时新建此文件夹即可mkdir /etc/apt/preferences.d
错误
E: The method driver /usr/lib/apt/methods/http could not be found.
- 首先将/etc/apt/source.list中所有的http换成https, vim的命令是
:.,$s/http:/https:/
。 - 然后下载apt-transport-https安装包,一般IntelCPU的电脑就用amd64版本
wget http://ftp.nl.debian.org/debian/pool/main/a/apt/apt-transport-https_1.4.9_amd64.deb
dpkg -i apt-transport-https_1.4.9_amd64.deb
- 此时可以安装软件了
aptitude install binwalk
apt源
在aptitude update
时,发现有些网址不能以https的方式请求,又修正了一下,这时我的apt源(/etc/apt/sources.list)
deb https://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源
deb https://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# 源码
deb-src https://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# Canonical 合作伙伴和附加
deb http://archive.canonical.com/ubuntu/ xenial partner
deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable
deb http://extras.ubuntu.com/ubuntu/ xenial main