E:有几个软件包无法下载,要不运行 apt-get update 或者加上 –fix-missing 的选项再试试?

有几个软件包无法下载,要不运行 apt-get update 或者加上 –fix-missing 的选项再试试?

我采用以下方法解决:
首先:

sudo apt-get update

还是不行,换源 先备份一个源文件

sudo cp /etc/apt/sources.list  /etc/apt/sources-bak.list 

然后

sudo gedit /etc/apt/sources.list

将内容全部替换

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse

然后保存
我的是ubuntu 16.04,其他版本ubuntu请参考网址换源https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/

sudo apt-get update

就可以sudo apt-get install xxx了

你可能感兴趣的:(ubuntu,bash,linux)