zoukankan      html  css  js  c++  java
  • ubuntu 16.04下更换源和pip源【转】

    本文转载自:https://blog.csdn.net/weixin_41500849/article/details/80246221

      写在前面的话

        本文主要内容是更换系统源为清华大学源,更换python的pip源为清华大学源。 使用的linux发行版为ubuntu 16.04 64位,文本编辑器为gedit,

     

    一、更换系统源

        系统源用于ubuntu中的软件更新下载。登陆用户为root(获得最高权限) 修改步骤如下:

     1,备份系统源

     

    cp /etc/apt/sources-list  /etc/apt/sources-list.bak

    2,打开sources-list

       gedit sources-list

    3,修改源

    1.  
      deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted
    2.  
      deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted
    3.  
      deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe
    4.  
      deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe
    5.  
      deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse
    6.  
      deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse
    7.  
      deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
    8.  
      deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted
    9.  
      deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe
    10.  
      deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse

    4,更新下源的缓存

    apt-get update

    5,更新软件

    apt-get upgrade

    二、更改pip 源

    首先需要在用户目录下创建.pip文件夹,并创建pip.conf文件,

    1,进入用户目录(这时使用普通用户登陆)

    cd ~

    2,创建pip.conf文件

    touch pip.conf

    3,打开文件

    gedit pip.conf

    4,复制下列内容至pip.conf

    1.  
      [global]
    2.  
      trusted-host = pypi.mirrors.ustc.edu.cn
    3.  
      index-url = https://pypi.mirrors.ustc.edu.cn/simple


  • 相关阅读:
    MySQL length函数
    MySQL between ... and ...
    MySQL Group By使用
    MySQL 聚合函数/分组函数
    MySQL where与like
    MySQL order by与distinct
    城市网络
    滑动窗口
    合并回文子串(NC13230)
    NC50439
  • 原文地址:https://www.cnblogs.com/zzb-Dream-90Time/p/9669003.html
Copyright © 2011-2022 走看看