Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1471496
  • 博文数量: 246
  • 博客积分: 3353
  • 博客等级: 中校
  • 技术积分: 3295
  • 用 户 组: 普通用户
  • 注册时间: 2011-11-09 17:56
个人简介

精通测试技术,linux,shell,性能测试

文章分类

全部博文(246)

文章存档

2024年(3)

2023年(7)

2022年(7)

2021年(4)

2020年(1)

2019年(2)

2017年(2)

2016年(3)

2015年(11)

2014年(20)

2013年(10)

2012年(176)

分类: LINUX

2014-05-22 13:44:47

当运行apt-get update后出现如下错误时:
E: Some index files failed to download, they have been ignored, or old ones used instead.
可以将目录下/var/lib/apt/lists/partial/所有的文件清掉,再次运行apt-get update即可!自带源在大陆不好。

出现以下错误:


点击(此处)折叠或打开

  1. root@ubs1110x64v3:~# apt-get update
  2. Ign http://us.archive.ubuntu.com oneiric InRelease
  3. Ign http://us.archive.ubuntu.com oneiric-updates InRelease
  4. Ign http://security.ubuntu.com oneiric-security InRelease
  5. Ign http://security.ubuntu.com oneiric-security Release.gpg
  6. Ign http://security.ubuntu.com oneiric-security Release
  7. Ign http://security.ubuntu.com oneiric-security/main Sources/DiffIndex
  8. Ign http://us.archive.ubuntu.com oneiric-backports InRelease
  9. Ign http://security.ubuntu.com oneiric-security/restricted Sources/DiffIndex
  10. Ign http://us.archive.ubuntu.com oneiric Release.gpg
  11. Ign http://security.ubuntu.com oneiric-security/universe Sources/DiffIndex
  12. Ign http://us.archive.ubuntu.com oneiric-updates Release.gpg
  13. Ign http://us.archive.ubuntu.com oneiric-backports Release.gpg
  14. Ign http://us.archive.ubuntu.com oneiric Release
  15. Ign http://us.archive.ubuntu.com oneiric-updates Release
  16. Ign http://us.archive.ubuntu.com oneiric-backports Release
  17. Ign http://us.archive.ubuntu.com oneiric/main Sources/DiffIndex
  18. Ign http://us.archive.ubuntu.com oneiric/restricted Sources/DiffIndex
  19. Ign http://us.archive.ubuntu.com oneiric/universe Sources/DiffIndex
  20. Ign http://us.archive.ubuntu.com oneiric/multiverse Sources/DiffIndex
  21. Ign http://us.archive.ubuntu.com oneiric/main amd64 Packages/DiffIndex
  22. Ign http://us.archive.ubuntu.com oneiric/restricted amd64 Packages/DiffIndex
  23. Ign http://security.ubuntu.com oneiric-security/multiverse Sources/DiffIndex
  24. Ign http://us.archive.ubuntu.com oneiric/universe amd64 Packages/DiffIndex
  25. Ign http://us.archive.ubuntu.com oneiric/multiverse amd64 Packages/DiffIndex
  26. Ign http://security.ubuntu.com oneiric-security/main amd64 Packages/DiffIndex
  27. Ign http://us.archive.ubuntu.com oneiric/main i386 Packages/DiffIndex
  28. Ign http://security.ubuntu.com oneiric-security/restricted amd64 Packages/DiffIndex
  29. Ign http://us.archive.ubuntu.com oneiric/restricted i386 Packages/DiffIndex
  30. Ign http://us.archive.ubuntu.com oneiric/universe i386 Packages/DiffIndex
  31. Ign http://security.ubuntu.com oneiric-security/universe amd64 Packages/DiffIndex
  32. Ign http://us.archive.ubuntu.com oneiric/multiverse i386 Packages/DiffIndex
  33. Ign http://security.ubuntu.com oneiric-security/multiverse amd64 Packages/DiffIndex
  34. Ign http://us.archive.ubuntu.com oneiric/main TranslationIndex
  35. Ign http://us.archive.ubuntu.com oneiric/multiverse TranslationIndex
  36. Ign http://us.archive.ubuntu.com oneiric/restricted TranslationIndex
  37. Ign http://us.archive.ubuntu.com oneiric/universe TranslationIndex
  38. Ign http://us.archive.ubuntu.com oneiric-updates/restricted Sources/DiffIndex
  39. Ign http://security.ubuntu.com oneiric-security/main i386 Packages/DiffIndex
  40. Ign http://us.archive.ubuntu.com oneiric-updates/multiverse Sources/DiffIndex
  41. Ign http://us.archive.ubuntu.com oneiric-updates/restricted amd64 Packages/DiffIndex
  42. Ign http://us.archive.ubuntu.com oneiric-updates/multiverse amd64 Packages/DiffIndex
  43. Ign http://us.archive.ubuntu.com oneiric-updates/restricted i386 Packages/DiffIndex
  44. root@ubs1110x64v3:~# rm -rf /var/lib/apt/lists/partial/*
  45. root@ubs1110x64v3:~# apt-get update
  46. Ign http://cn.archive.ubuntu.com lucid InRelease
  47. Ign http://cn.archive.ubuntu.com lucid-updates InRelease
  48. Get:1 http://cn.archive.ubuntu.com lucid Release.gpg [189 B]
  49. Get:2 http://cn.archive.ubuntu.com lucid-updates Release.gpg [198 B]
  50. Get:3 http://cn.archive.ubuntu.com lucid Release [57.2 kB]
  51. Get:4 http://cn.archive.ubuntu.com lucid-updates Release [58.3 kB]
  52. Get:5 http://cn.archive.ubuntu.com lucid/main Sources [659 kB]
  53. Get:6 http://cn.archive.ubuntu.com lucid/restricted Sources [3,775 B]
  54. Get:7 http://cn.archive.ubuntu.com lucid/universe Sources [3,165 kB]
  55. Get:8 http://cn.archive.ubuntu.com lucid/multiverse Sources [119 kB]
  56. Ign http://security.ubuntu.com lucid-security InRelease
  57. Get:9 http://security.ubuntu.com lucid-security Release.gpg [198 B]
  58. Get:10 http://security.ubuntu.com lucid-security Release [57.3 kB]
  59. Get:11 http://cn.archive.ubuntu.com lucid/main amd64 Packages [1,383 kB]
  60. Get:12 http://security.ubuntu.com lucid-security/main Sources [242 kB]
  61. Get:13 http://cn.archive.ubuntu.com lucid/restricted amd64 Packages [6,193 B]
  62. Get:14 http://cn.archive.ubuntu.com lucid/universe amd64 Packages [5,430 kB]
  63. Get:15 http://security.ubuntu.com lucid-security/restricted Sources [1,267 B]
  64. Get:16 http://security.ubuntu.com lucid-security/universe Sources [46.7 kB]
  65. Get:17 http://security.ubuntu.com lucid-security/multiverse Sources [2,347 B]
  66. Get:18 http://security.ubuntu.com lucid-security/main amd64 Packages [554 kB]
  67. Get:19 http://cn.archive.ubuntu.com lucid/multiverse amd64 Packages [176 kB]
  68. Get:20 http://cn.archive.ubuntu.com lucid/main i386 Packages [1,386 kB]
  69. Get:21 http://cn.archive.ubuntu.com lucid/restricted i386 Packages [6,208 B]
  70. Get:22 http://cn.archive.ubuntu.com lucid/universe i386 Packages [5,448 kB]
  71. Get:23 http://cn.archive.ubuntu.com lucid/multiverse i386 Packages [180 kB]


点击(此处)折叠或打开

  1. root@ubs1110x64v3:~# rm -rf /var/lib/apt/lists/partial/*
  2. root@ubs1110x64v3:~# apt-get update
  3. Ign http://cn.archive.ubuntu.com lucid InRelease
  4. Ign http://cn.archive.ubuntu.com lucid-updates InRelease
  5. Get:1 http://cn.archive.ubuntu.com lucid Release.gpg [189 B]
  6. Get:2 http://cn.archive.ubuntu.com lucid-updates Release.gpg [198 B]
  7. Get:3 http://cn.archive.ubuntu.com lucid Release [57.2 kB]
  8. Get:4 http://cn.archive.ubuntu.com lucid-updates Release [58.3 kB]

修改dns:
1,重启生效:

sudo vi /etc/resolvconf/resolv.conf.d/base(这个文件默认是空的)
 
在里面插入:
 nameserver 8.8.8.8
 nameserver 8.8.4.4
 
如果有多个DNS就一行一个
 
修改好保存,然后执行
 
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
 
可以看到我们的设置已经加上了,然后再ping一个域名,当时就可以解析了,无需重启。
 

2,重启失效:
 
配置文件地址 /etc/resolv.conf
 
使用编辑器打开
 
改为如下内容:
 search localdomain
 nameserver 202.96.128.86 希望修改成的DNS
 nameserver 202.96.128.166 备用DNS
 
重启网络:sudo /etc/init.d/networking restart。即可 

阅读(9426) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

注册看下2016-05-01 00:42:00

这个大陆源不好怎么解决?我是不是可以理解整个问题是这么解释的。
1 、  rm -rf /var/lib/apt/lists/partial/* 就可以解决 apt-get update问题?
那么后面的修改DNS是为了什么
另外为什么两种修改DNS的方法中namesevser一个是 nameserver 8.8.8.8  nameserver 8.8.4.4   另外一个是  nameserver 202.96.128.86 希望修改成的DNS
 nameserver 202.96.128.16

注册看下2016-04-30 23:59:44

1,重启生效:
2,重启失效:
---------------
这表示是2种方法吗