本文转载自:http://www.jianshu.com/p/0de2b5717ce8

1 $ sudo  apt-get update

报了一堆错误:

Err http://cn.archive.ubuntu.com trusty InRelease

Err http://cn.archive.ubuntu.com trusty-updates InRelease

Err http://cn.archive.ubuntu.com trusty-backports InRelease

Err http://cn.archive.ubuntu.com trusty Release.gpg     

W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/trusty/InRelease

解决方案: 修改DNS

sudo vi  /etc/resolvconf/resolv.conf.d/base

在里面插入:

nameserver 8.8.8.8
nameserver 8.8.4.4

修改好保存!wq,
然后执行

$ sudo resolvconf -u

再看 /etc/resolv.conf,最下面就多了2行:

$ cat /etc/resolv.conf

 显示

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by   resolvconf(8)

# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

nameserver 8.8.8.8

nameserver 8.8.4.4

此时执行

$ sudo  apt-get update

可以运行,然后就可以使用sudo apt-get install **指令了。

最新文章

  1. python基础-软件目录结构规范
  2. angularjs 2.0 快速案例(1)
  3. hibernate笔记--缓存机制之 二级缓存(sessionFactory)和查询缓存
  4. ZeroMQ接口函数之 :zmq_close - 关闭ZMQ socket
  5. 递推DP URAL 1009 K-based Numbers
  6. c# 语法5.0 新特性 转自网络
  7. Java—static、this、super用法总结
  8. IOS动态修改按钮响应时间
  9. Google HTML/CSS/JS代码风格指南
  10. 不可或缺的企业OA面临问题,以及解决建议 软件定制开发 森普演示平台
  11. Coins (poj 1742 && hdu 2844 DP)
  12. js 实现自动换行
  13. D3D Learning_01_CreateWindow
  14. TC SRM683 Div1 250
  15. binary
  16. C++布隆过滤器
  17. Java_jsp.jstl.Function函数标签库.记录
  18. Android memory dump
  19. SElinux测试及排错
  20. Python3 pow() 函数

热门文章

  1. 危急,不要任意让站点记住password自己主动登陆!
  2. zabbix学习系列之触发器
  3. CentOS-7 在windows server 2012下的虚拟机安装教程
  4. Intellij IDEA 的使用
  5. Shell脚本之:数组
  6. jquery方法
  7. 用Putty连接Linux
  8. 获取input光标的x和y轴
  9. POJ 2456 Aggressive cows (二分 基础)
  10. jdbc 链接池