欢迎关注:天际使徒的个人博客

  • 问题描述:出现Failed to fetch http://…..
  • 问题原因:一般是由于直接使用国外的源无法连接的原因导致的
  • 解决方案:直接替换成国内的源即可

                (1)执行备份命令:sudo cp /etc/apt/sources.list /etc/apt/sources.list.old

                (2)打开文件:sudo vim /etc/apt/sources.list

                (3)换源:复制源覆盖文件原来的内容(根据自己的网去尝试,选择最快的一个)

1. 各种ubuntu版本(查看版本命令:cat /etc/issue)的清华源:清华源文件
2. 阿里云源(试用14.04/16.04/18.04)

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐