zoukankan      html  css  js  c++  java
  • ubuntu 更新软件源

    ubuntu 更新软件源

    修改文件sources.list 位于/etc/apt/sources.list,并备份原文件为sources.list.bak

    deb http://mirrors.163.com/ubuntu/ precise main restricted
    deb-src http://mirrors.163.com/ubuntu/ precise main restricted
    deb http://mirrors.163.com/ubuntu/ precise-updates main restricted
    deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted
    deb http://mirrors.163.com/ubuntu/ precise universe
    deb-src http://mirrors.163.com/ubuntu/ precise universe
    deb http://mirrors.163.com/ubuntu/ precise-updates universe
    deb-src http://mirrors.163.com/ubuntu/ precise-updates universe
    deb http://mirrors.163.com/ubuntu/ precise multiverse
    deb-src http://mirrors.163.com/ubuntu/ precise multiverse
    deb http://mirrors.163.com/ubuntu/ precise-updates multiverse
    deb-src http://mirrors.163.com/ubuntu/ precise-updates multiverse
    deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
    deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ precise-security main restricted
    deb-src http://mirrors.163.com/ubuntu/ precise-security main restricted
    deb http://mirrors.163.com/ubuntu/ precise-security universe
    deb-src http://mirrors.163.com/ubuntu/ precise-security universe
    deb http://mirrors.163.com/ubuntu/ precise-security multiverse
    deb-src http://mirrors.163.com/ubuntu/ precise-security multiverse
    deb http://extras.ubuntu.com/ubuntu precise main
    deb-src http://extras.ubuntu.com/ubuntu precise main
    # sohu(非教育网推荐)
    deb http://mirrors.sohu.com/ubuntu/ precise main restricted
    deb-src http://mirrors.sohu.com/ubuntu/ precise main restricted
    deb http://mirrors.sohu.com/ubuntu/ precise-updates main restricted
    deb-src http://mirrors.sohu.com/ubuntu/ precise-updates main restricted
    deb http://mirrors.sohu.com/ubuntu/ precise universe
    deb-src http://mirrors.sohu.com/ubuntu/ precise universe
    deb http://mirrors.sohu.com/ubuntu/ precise-updates universe
    deb-src http://mirrors.sohu.com/ubuntu/ precise-updates universe
    deb http://mirrors.sohu.com/ubuntu/ precise multiverse
    deb-src http://mirrors.sohu.com/ubuntu/ precise multiverse
    deb http://mirrors.sohu.com/ubuntu/ precise-updates multiverse
    deb-src http://mirrors.sohu.com/ubuntu/ precise-updates multiverse
    deb http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse
    deb-src http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse
    deb http://mirrors.sohu.com/ubuntu/ precise-security main restricted
    deb-src http://mirrors.sohu.com/ubuntu/ precise-security main restricted
    deb http://mirrors.sohu.com/ubuntu/ precise-security universe
    deb-src http://mirrors.sohu.com/ubuntu/ precise-security universe
    deb http://mirrors.sohu.com/ubuntu/ precise-security multiverse
    deb-src http://mirrors.sohu.com/ubuntu/ precise-security multiverse
    deb http://extras.ubuntu.com/ubuntu precise main
    deb-src http://extras.ubuntu.com/ubuntu precise main
    

    更新

    sudo apt-get update
    sudo apt-get upgrade
    

    这里是打算安装32位兼容库

    apt-get install ia32-libs
    

    这个服务器的DNS竟然没有

    sudo vi /etc/resolvconf/resolv.conf.d/base(这个文件默认是空的)

    nameserver 8.8.8.8
    nameserver 8.8.4.4
    

    保存,然后执行

    sudo resolvconf -u
    

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

    # 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一个域名,当时就可以解析了,无需重启。

  • 相关阅读:
    insert into output使用
    内插字符串$与复合格式设置{}
    网站连接数据库连接不上原因是ip地址与端口号格式不对
    IIS中的MIME类型设置
    select distinct
    复制表备份表的问题
    一些碎知识
    题解【洛谷P3574】[POI2014]FAR-FarmCraft
    题解【洛谷P6029】[JSOI2010]旅行
    题解【BZOJ4472】[JSOI2015]salesman
  • 原文地址:https://www.cnblogs.com/fly-fish/p/4801092.html
Copyright © 2011-2022 走看看