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

写在前面的话

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

一、更换系统源

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

1,备份系统源

  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,更新下源的缓存

  1. apt-get update

5,更新软件

  1. apt-get upgrade

二、更改pip 源

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

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

  1. cd ~

2,创建pip.conf文件

  1. touch pip.conf

3,打开文件

  1. 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

ubuntu 16.04下更换源和pip源【转】的更多相关文章

  1. ubuntu 16.04下使用 python pip的安装问题。

    ubuntu 16.04使用 pip安装软件时,不知道为什么不能使用sudo pip install XXX 需要使用的是:python -m pip install XXX才可以.

  2. ubuntu 16.04 下更换boost版本

    如果是新机器,没装过boost,那么直接一条命令 sudo apt-get install libboost-all-dev 头文件一般安装在 /usr/include 下面有一个目录boost,里面 ...

  3. Ubuntu 16.04 下简单安装使用golang之备忘

      刚开始学习Go语言,这里记录下我在Ubuntu 16.04下安装使用golang的过程,方便以后查询.   一.安装   1.添加源   如果使用默认的源安装golang的话,版本太低,只到1.6 ...

  4. Ubuntu 16.04下EasyOpenJTAG+OpenOCD的安装和使用【转】

    本文转载自:http://www.linuxdiyf.com/linux/24086.html Ubuntu 16.04下EasyOpenJTAG+OpenOCD的安装和使用 发布时间:2016-09 ...

  5. Ubuntu 16.04下编译安装Apache2.4和PHP7结合

    Ubuntu 16.04下编译安装Apache2.4和PHP7结合,并安装PDOmysql扩展. 1.编译安装apache2.4.20 1 第一步: ./configure --prefix=/usr ...

  6. Ubuntu 16.04 下使用Xampp

    Ubuntu 16.04 下使用Xampp 什么是Xampp? XAMPP(Apache+MySQL+PHP+PERL) 是一个功能强大的建站集成软件包.这个软件包原来的名字是 LAMPP,但是为了避 ...

  7. Ubuntu 16.04下使用Eclipse:创建工程时卡死的解决方法

    问题如下: Ubuntu 16.04下使用Eclipse创建工程时出现卡顿和卡死,新建一个MapReduce项目卡了一下午,鼠标变成了圆圈进度条转了一下午,还关不掉. 当我直接去关闭新建项目的窗口时, ...

  8. Ubuntu 16.04下安装MacBuntu 16.04 TP 变身Mac OS X主题风格

    Ubuntu 16.04下安装MacBuntu 16.04 TP 变身Mac OS X主题风格 sudo add-apt-repository ppa:noobslab/macbuntu sudo a ...

  9. Ubuntu 16.04下的LAMP环境配置

    在学习开发过程中,每当遇到新的问题时,通常都能在网上搜到解决的方法,但是网上的方法千千万,有些是已经过时了的,有些是跟自己开发环境不同的,总是不能第一时间能找到答案. 而当时遇到的问题可能在今后的开发 ...

随机推荐

  1. linux 允许mysql用户远程访问

    搭建服务器..怎么导入数据库?  直接来个用户吧 数据库名字(已存在): table 创建mysql新用户,并指定数据库,允许远程访问 mysql用户: test mysql用户密码: test666 ...

  2. shell脚本抓取网页信息

    利用shell脚本分析网站数据 # define url time=$(date +%F) mtime=$(date +%T) file=/abc/shell/abc/abc_$time.log ht ...

  3. Think PHP递归重新排序无限极子分类数组(递归无限极分类)

    Think PHP递归重新排序无限极子分类数组 // 递归重新排序无限极子分类数组 function recursive($array,$pid=0,$level=0){ $arr = array() ...

  4. 报警告session_regenerate_id(): Failed to create(read) session ID: files (path: N;/path)

    php.ini文件中的session.save_path = "N;/path"注释掉(前面加分号)

  5. mysql数据库多源复制方案

    概述 由于目前生产环境的mysql数据库分布在两台服务器,若从单一主从来看,配置很简单,但是需要将两台服务器的数据库同步到一台从库上面,需要进行更多配置和注意事项.多源复制有两种方案,Binlog+P ...

  6. EF和PetaPoco实现快速开发

    PetaPoco是一款适用于.NET应用程序的轻型对象关系映射器(ORM, Object Relational Mapper).与那些功能完备的ORM(如NHibernate或Entity Frame ...

  7. Kafka Consumer接口

    对于kafka的consumer接口,提供两种版本,   high-level 一种high-level版本,比较简单不用关心offset, 会自动的读zookeeper中该Consumer grou ...

  8. Python开发【模块】:time、datatime

    时间模块 时间相关的操作,时间有三种表示方式: 时间戳               1970年1月1日之后的秒,即:time.time() 格式化的字符串    2014-11-11 11:11,   ...

  9. 如何修改git分支名名称

    1. 修改本地git分支名称指令 git branch -m oldBranchName newBranchName 2. 修改远程仓库(github)上的分支名称 git本地分支名已修改,只需推送到 ...

  10. C++ Design Pattern: What is a Design Pattern?

    Q: What is a Design Pattern? A: Design Patterns represent solutions to problems what arise when deve ...