• Ubuntu中无法update的解决办法


    我输入 sudo apt-get update 出现错误:

    /etc/apt$ sudo apt-get update
    Err http://security.ubuntu.com precise-security InRelease
    
    Err http://security.ubuntu.com precise-security Release.gpg
      Temporary failure resolving 'security.ubuntu.com'
    Err http://cn.archive.ubuntu.com precise InRelease
    
    Err http://cn.archive.ubuntu.com precise-updates InRelease
    
    Err http://cn.archive.ubuntu.com precise-backports InRelease
    
    Err http://cn.archive.ubuntu.com precise Release.gpg
      Temporary failure resolving 'cn.archive.ubuntu.com'
    Err http://cn.archive.ubuntu.com precise-updates Release.gpg
      Temporary failure resolving 'cn.archive.ubuntu.com'
    Err http://cn.archive.ubuntu.com precise-backports Release.gpg
      Temporary failure resolving 'cn.archive.ubuntu.com'
    Reading package lists... Done
    W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise/InRelease  
    
    W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise-updates/InRelease  
    
    W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise-backports/InRelease  
    
    W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/InRelease  
    
    W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/Release.gpg  Temporary failure resolving 'security.ubuntu.com'
    
    W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise/Release.gpg  Temporary failure resolving 'cn.archive.ubuntu.com'
    
    W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise-updates/Release.gpg  Temporary failure resolving 'cn.archive.ubuntu.com'
    
    W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise-backports/Release.gpg  Temporary failure resolving 'cn.archive.ubuntu.com'
    
    W: Some index files failed to download. They have been ignored, or old ones used instead.
    xinju@xinjuOffice:/etc/apt$ cd ../network

    (错误当时没有记录下来上网找到了同样错误的提示!)

    ——-下面我们就一起讨论下这个情况!

    所有停止维护的版本都可以使用old源。所以在元列表中把原来的地址改为带有old源的就可以了。

    首先,备份系统中的源列表,打开终端,输入
    sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup

    这里写图片描述

    4.输入
    sudo gedit /etc/apt/sources.list
    打开源列表文件,ctrl+A,然后delete,删除全部内容
    然后把下面的地址复制到该文件中:

    deb http://old-releases.ubuntu.com/ubuntu utopic main restricted universe multiverse
    deb http://old-releases.ubuntu.com/ubuntu utopic-security main restricted universe multiverse
    deb http://old-releases.ubuntu.com/ubuntu utopic-updates main restricted universe multiverse
    deb http://old-releases.ubuntu.com/ubuntu utopic-proposed main restricted universe multiverse
    deb http://old-releases.ubuntu.com/ubuntu utopic-backports main restricted universe multiverse
    deb-src http://old-releases.ubuntu.com/ubuntu utopic main restricted universe multiverse
    deb-src http://old-releases.ubuntu.com/ubuntu utopic-security main restricted universe multiverse
    deb-src http://old-releases.ubuntu.com/ubuntu utopic-updates main restricted universe multiverse
    deb-src http://old-releases.ubuntu.com/ubuntu utopic-proposed main restricted universe multiverse
    deb-src http://old-releases.ubuntu.com/ubuntu utopic-backports main restricted universe multiverse

    这里写图片描述

    5.需要注意的是上面地址中的 utopic是ubuntu系统版本的名称,我的ubuntu系统是14.10,对应的版本名称是utopic。只要把这里的utopic换车你自己系统版本的名称即可,如果不知道版本名称的话,可以运行以下命令获得
    lsb_release -a
    其中,Codename就是了。

    这里写图片描述

    6.保存好源列表文件后,进入到终端,一定要再输入以下命令
    sudo apt-get update
    来进行更新,会看到没有失败的提示了,转而出现“命中,获取中”等字眼。
    这里写图片描述

    这里写图片描述

    本文为转载,出处为图片 上的网址。

  • 相关阅读:
    python基础教程(第二版)---1.11字符串
    python基础教程(第二版)---1.91(我只记录了cmath模块相关)
    python基础教程(第二版)---1.7获取用户输入(讲的是input函数)
    python基础教程(第二版)---1.6语句
    openGL 进行图像处理
    uchar4
    709 与 601 公式上的区别
    J420P 黑白红青蓝黄对应的YUV 值
    混音的方法
    CPU周期, 时钟周期, 机器周期, 指令周期 总线周期
  • 原文地址:https://www.cnblogs.com/jyxbk/p/8352210.html
Copyright © 2020-2023  润新知