linux下安装为知笔记&apt-get update出现问题

在Ubuntu系统下可以通过官方PPA仓库安装:

$ sudo add-apt-repository ppa:wiznote-team 
$ sudo apt-get update 
$ sudo apt-get install wiznote

则在application中search可以看到已经安装好了WizNote

  在Ubuntu操作系统中,使用apt-get命令安装所需的开发软件非常方便,但也有不少时候由于链接不上软件源而不能正常安装,于是很多人都会想到使用sudo apt-get update命令来更新软件源,而恰恰这时屋漏偏逢连夜雨,更新命令也不能正常工作,出现大量“Failed to fetch”的错误。   下面是部分错误情况截取。

[plain] view plain copy
 
  1. W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-updates/main/binary-i386/Packages  Something wicked happened resolving 'archive.ubuntu.com:http' (-5 - No address associated with hostname)  
  2.   
  3. W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-updates/restricted/binary-i386/Packages  Something wicked happened resolving 'archive.ubuntu.com:http' (-5 - No address associated with hostname)  
  4.   
  5. W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-updates/universe/binary-i386/Packages  Something wicked happened resolving 'archive.ubuntu.com:http' (-5 - No address associated with hostname)  
  6.   
  7. W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-updates/multiverse/binary-i386/Packages  Something wicked happened resolving 'archive.ubuntu.com:http' (-5 - No address associated with hostname)  
  8.   
  9. W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-updates/main/i18n/Translation-en_US  Something wicked happened resolving 'archive.ubuntu.com:http' (-5 - No address associated with hostname)  

     其实,解决这个问题十分简单,只要设置妥当DNS服务器即可,如电信网络的设置如下所示。 一般主机已经有一个nameserver 127.0.0.1  分别尝试再加下面两个nameserver中的一个即可。

[plain] view plain copy
 
  1. $ sudo vi /etc/resolv.conf  
  2.    

    

    再次执行sudo apt-get update命令,结果一切正常。

若出现/var目录下下某个文件访问受限报错,则先将权限受限的文件用chmod命令修改权限。 再次执行sudo apt-get update命令即可。

[plain] view plain copy
 
    1. Hit http://archive.ubuntu.com precise-proposed/restricted TranslationIndex  
    2. Hit http://archive.ubuntu.com precise-proposed/universe TranslationIndex  
    3. Hit http://archive.ubuntu.com precise/main Translation-en  
    4. Hit http://archive.ubuntu.com precise/multiverse Translation-en  
    5. Hit http://archive.ubuntu.com precise/restricted Translation-en  
    6. Hit http://archive.ubuntu.com precise/universe Translation-en  
    7. Hit http://archive.ubuntu.com precise-updates/main Translation-en  
    8. Hit http://archive.ubuntu.com precise-updates/multiverse Translation-en  
    9. Hit http://archive.ubuntu.com precise-updates/restricted Translation-en  
    10. Hit http://archive.ubuntu.com precise-updates/universe Translation-en  
    11. Hit http://archive.ubuntu.com precise-security/main Translation-en  
    12. Hit http://archive.ubuntu.com precise-security/multiverse Translation-en  
    13. Hit http://archive.ubuntu.com precise-security/restricted Translation-en  
    14. Hit http://archive.ubuntu.com precise-security/universe Translation-en  
    15. Hit http://archive.ubuntu.com precise-backports/main Translation-en                                                           
    16. Hit http://archive.ubuntu.com precise-backports/multiverse Translation-en                                                     
    17. Hit http://archive.ubuntu.com precise-backports/restricted Translation-en                                                     
    18. Hit http://archive.ubuntu.com precise-backports/universe Translation-en                                                       
    19. Hit http://archive.ubuntu.com precise-proposed/main Translation-en                                                            
    20. Hit http://archive.ubuntu.com precise-proposed/multiverse Translation-en                                                      
    21. Hit http://archive.ubuntu.com precise-proposed/restricted Translation-en                                                      
    22. Hit http://archive.ubuntu.com precise-proposed/universe Translation-en                                                        
    23. Fetched 107 kB in 6s (16.6 kB/s)                                                                                              
    24. Reading package lists... Done  
原文地址:https://www.cnblogs.com/zenghongjun/p/7146025.html