Ubuntu18.04使用aptitude采坑小记

前言

听说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

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

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
©️2022 CSDN 皮肤主题:书香水墨 设计师:CSDN官方博客 返回首页
评论 11

打赏作者

HuaSir_X

你的鼓励将是我创作的最大动力

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值