zoukankan      html  css  js  c++  java
  • The solution for apt-get update Err 404

    最近在ubuntu 12.10上执行sudo apt-get update 命令后出现了如下错误:

        Ign http://extras.ubuntu.com natty/main TranslationIndex  
        Err http://extras.ubuntu.com natty/main Sources  
          404  Not Found  
        Err http://extras.ubuntu.com natty/main i386 Packages  
          404  Not Found  
        Ign http://extras.ubuntu.com natty/main Translation-en_US  
        Err http://security.ubuntu.com natty-security/universe Sources  
          404  Not Found [IP: 91.189.92.200 80]  
        Err http://security.ubuntu.com natty-security/multiverse Sources  
          404  Not Found [IP: 91.189.92.200 80]  
        Ign http://extras.ubuntu.com natty/main Translation-en  
        Err http://security.ubuntu.com natty-security/universe i386 Packages  
          404  Not Found [IP: 91.189.92.200 80]  
        Err http://security.ubuntu.com natty-security/multiverse i386 Packages  
          404  Not Found [IP: 91.189.92.200 80]  
        Err http://security.ubuntu.com natty-security/main Sources  
          404  Not Found [IP: 91.189.92.200 80]  
        Err http://security.ubuntu.com natty-security/restricted Sources  
          404  Not Found [IP: 91.189.92.200 80]  
        Err http://security.ubuntu.com natty-security/main i386 Packages  
          404  Not Found [IP: 91.189.92.200 80]  
        Err http://security.ubuntu.com natty-security/restricted i386 Packages  
          404  Not Found [IP: 91.189.92.200 80]  
        Ign http://security.ubuntu.com natty-security/main Translation-en_US  
        Ign http://security.ubuntu.com natty-security/main Translation-en  
        Ign http://security.ubuntu.com natty-security/multiverse Translation-en_US  
        Ign http://security.ubuntu.com natty-security/multiverse Translation-en  
        Ign http://security.ubuntu.com natty-security/restricted Translation-en_US  
        Ign http://security.ubuntu.com natty-security/restricted Translation-en  
        Ign http://security.ubuntu.com natty-security/universe Translation-en_US  
        Ign http://security.ubuntu.com natty-security/universe Translation-en  
        W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/natty/main/source/Sources  404  Not Found  
          
        W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/natty/restricted/source/Sources  404  Not Found  
          
        W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/natty/universe/source/Sources  404  Not Found  
          
        W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/natty/multiverse/source/Sources  404  Not Found  
          
        W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/natty/main/binary-i386/Packages  404  Not Found  
          
        W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/natty/restricted/binary-i386/Packages  404  Not Found  
          
        W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/natty/universe/binary-i386/Packages  404  Not Found  
          
        W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/natty/multiverse/binary-i386/Packages  404  Not Found  
          
        W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/natty-updates/main/source/Sources  404  Not Found  
          
        W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/natty-updates/restricted/source/Sources  404  Not Found  
          
        W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/natty-updates/universe/source/Sources  404  Not Found  
          
        W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/natty-updates/multiverse/source/Sources  404  Not Found  
          
        W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/natty-updates/main/binary-i386/Packages  404  Not Found  
          
        W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/natty-updates/restricted/binary-i386/Packages  404  Not Found  
          
        W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/natty-updates/universe/binary-i386/Packages  404  Not Found  
          
        W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/natty-updates/multiverse/binary-i386/Packages  404  Not Found  
          
        W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/natty-security/universe/source/Sources  404  Not Found [IP: 91.189.92.200 80]  
          
        W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/natty-security/multiverse/source/Sources  404  Not Found [IP: 91.189.92.200 80]  
          
        W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/natty-security/universe/binary-i386/Packages  404  Not Found [IP: 91.189.92.200 80]  
          
        W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/natty-security/multiverse/binary-i386/Packages  404  Not Found [IP: 91.189.92.200 80]  
          
        W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/natty-security/main/source/Sources  404  Not Found [IP: 91.189.92.200 80]  
          
        W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/natty-security/restricted/source/Sources  404  Not Found [IP: 91.189.92.200 80]  
          
        W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/natty-security/main/binary-i386/Packages  404  Not Found [IP: 91.189.92.200 80]  
          
        W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/natty-security/restricted/binary-i386/Packages  404  Not Found [IP: 91.189.92.200 80]  
          
        W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/natty/main/source/Sources  404  Not Found  
          
        W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/natty/main/binary-i386/Packages  404  Not Found  
          
        E: Some index files failed to download. They have been ignored, or old ones used instead.  
        chaihuasong@chaihuasong:~$ sudo apt-get install git  
        Reading package lists... Done  
        Building dependency tree         
        Reading state information... Done  
        E: Unable to locate package git  

    发现很多源找不到,需要重新寻找更新源,最后把/etc/apt/sources.list文件中的内容直接替换成:

    # deb cdrom:[Ubuntu 15.04 _Vivid Vervet_ - Release i386 (20150422)]/ vivid main restricted
    
    # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
    # newer versions of the distribution.
    deb http://us.archive.ubuntu.com/ubuntu/ vivid main restricted
    deb-src http://us.archive.ubuntu.com/ubuntu/ vivid main restricted
    
    ## Major bug fix updates produced after the final release of the
    ## distribution.
    
    ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    ## team. Also, please note that software in universe WILL NOT receive any
    ## review or updates from the Ubuntu security team.
    deb http://us.archive.ubuntu.com/ubuntu/ vivid universe
    deb-src http://us.archive.ubuntu.com/ubuntu/ vivid universe
    
    ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
    ## team, and may not be under a free licence. Please satisfy yourself as to 
    ## your rights to use the software. Also, please note that software in 
    ## multiverse WILL NOT receive any review or updates from the Ubuntu
    ## security team.
    deb http://us.archive.ubuntu.com/ubuntu/ vivid multiverse
    deb-src http://us.archive.ubuntu.com/ubuntu/ vivid multiverse
    
    ## N.B. software from this repository may not have been tested as
    ## extensively as that contained in the main release, although it includes
    ## newer versions of some applications which may provide useful features.
    ## Also, please note that software in backports WILL NOT receive any review
    ## or updates from the Ubuntu security team.
    deb http://us.archive.ubuntu.com/ubuntu/ vivid-backports main restricted universe multiverse
    deb-src http://us.archive.ubuntu.com/ubuntu/ vivid-backports main restricted universe multiverse
    
    deb http://security.ubuntu.com/ubuntu vivid-security main restricted
    deb-src http://security.ubuntu.com/ubuntu vivid-security main restricted
    deb http://security.ubuntu.com/ubuntu vivid-security universe
    deb-src http://security.ubuntu.com/ubuntu vivid-security universe
    deb http://security.ubuntu.com/ubuntu vivid-security multiverse
    deb-src http://security.ubuntu.com/ubuntu vivid-security multiverse
    
    ## Uncomment the following two lines to add software from Canonical's
    ## 'partner' repository.
    ## This software is not part of Ubuntu, but is offered by Canonical and the
    ## respective vendors as a service to Ubuntu users.
    # deb http://archive.canonical.com/ubuntu vivid partner
    # deb-src http://archive.canonical.com/ubuntu vivid partner
  • 相关阅读:
    javascript入门笔记8-window对象
    javascript入门笔记7-计时器
    一篇RxJava友好的文章(二)
    Android 最新学习资料收集
    一篇RxJava友好的文章(一)
    瓣呀,一个基于豆瓣api仿网易云音乐的开源项目
    UStore-自定义JDF文件格式输出
    UStore-添加自定义工作流(JDF)到产品
    XMPie部署与创建过程
    XMPie Tracking 操作
  • 原文地址:https://www.cnblogs.com/pinxiong/p/4912689.html
Copyright © 2011-2022 走看看