一、修改ubuntu系统源

我的ubuntu系统是在清华的开源网站上下的,所以我还以为他应该就帮我弄好源了,可是没想到下载的还是非常慢,看到下载的时候网址前还有个us,就知道不是国内源了。所以这里我们来换系统源。(ps:我上次用的阿里云服务器好像倒是直接就是阿里的源了,速度还可以。)

国内有很多Ubuntu的镜像源,包括阿里的、网易的,还有很多教育网的源,比如:清华源、中科大源。 
我们这里以清华源为例讲解如何修改Ubuntu 18.04里面默认的源。

1、输入命令修改sources.list文件,当然需要超级权限,所以要加sudo;

sudo gedit /etc/apt/sources.list

(可选)备份原文件:

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

2、在文件最前面添加以下条目(操作前请做好相应备份):

这里需要特别注意ubuntu的版本,我的是18.04,所以是bionic,如果是其他版本,可以在清华源的网站上找到其对应的原文件,放入即可。

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

3、修改完成后,保存文件,警告什么的都不理,然后运行下面的命令。

sudo apt-get update
sudo apt-get upgrade

另附阿里源:

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

二、修改python的pip的源

  1. 根目录创建.pip文件:mkdir ~/.pip
  2. 创建文件pip.conf:vim .pip/pip.conf
  3. 点击“i”键,进入编辑模式,复制信息:
    [global]
    index-url = https://pypi.tuna.tsinghua.edu.cn/simple
    trusted-host = pypi.tuna.tsinghua.edu.cn

    这个更换的是清华的源,清华的源5分钟同步官网一次,建议使用。另附上其他源:
    清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
    阿里云 http://mirrors.aliyun.com/pypi/simple/
    中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
    豆瓣(douban) http://pypi.douban.com/simple/
    中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

  4. 点击:“ESC”切换到命令行模式,输入“:wq”保存离开。
												

ubuntu18.04里更新系统源和pip源的更多相关文章

  1. 更新Conda源和pip源

    更新conda源 各系统都可以通过修改用户目录下的 .condarc 文件: channels: - defaults show_channel_urls: true default_channels ...

  2. ubuntu 更换系统源和pip源

    1 . 备份 cd /etc/apt sudo cp sources-list sources-list.bak 2 . 编辑 这里用了阿里云的源 sudo vi sources-list 将文件内容 ...

  3. ubuntu 16.04下更换源和pip源【转】

    本文转载自:https://blog.csdn.net/weixin_41500849/article/details/80246221 写在前面的话 本文主要内容是更换系统源为清华大学源,更换pyt ...

  4. ubuntu18.04 apt-get换国内源 阿里源 163源 清华源 中科大源

    服务器上安装了最新的Ubuntu Server 18.04,代号为bionic.使用apt-get命令安装软件时,有时候速度比较慢,有时候会失败.因此考虑用国内的镜像源更换下apt-get的默认源. ...

  5. win7系统下安装Ubuntu18.04组成双系统

    最近在闲鱼上花了350大洋淘到了一台tinkpad sl510,这大概是一台发布于2009年的一台电脑了吧,处理器是酷睿二t440,2Gddr3的显卡,让我有点意外的是这台电脑的硬盘是7200转的32 ...

  6. 【Ubuntu】Ubuntu18.04通过重装系统成功安装显卡驱动

    0. 前言 前面用了一天的时间来解决Ubuntu安装显卡驱动出现的用户输入密码登录后出现的紫屏.循环登录的问题,过程可阅读“[Ubuntu]Ubuntu系统启动过程中,输入用户名与密码后登录一直卡在紫 ...

  7. Centos5, 6, 以及Ubuntu18.04下更改系统时间和时区

    http://www.namhuy.net/2435/how-to-change-date-time-timezone-on-centos-6.html 查看日期(使用 -R 参数会以数字显示时区) ...

  8. win10下更新anaconda和pip源

    第一步:更新anaconda源. anaconda的官方源太慢,推荐清华源:https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/ 软件下载也可以在这个 ...

  9. Win10+Ubuntu18.04安装双系统

    一:相关资料 (一)Win10+Ubuntu18.04 亲测UEFI启动模式双硬盘+双系统成功安装经验(文章) (二)如何安装Linux与windows双系统?(视频) 推荐先看视频,之后按照文章进行 ...

随机推荐

  1. 爬虫之UserAgent

    UserAgent简介 UserAgent中文名为用户代理,是Http协议中的一部分,属于头域的组成部分,UserAgent也简称UA.它是一个特殊字符串头,是一种向访问网站提供你所使用的浏览器类型及 ...

  2. des/3des

    一.python 1. des3 python平台的DES3 + base64 加密解密, 有两个常用的库pycrypto和pyDes 1)pycrypto des3.py #coding=utf-8 ...

  3. Hadoop2.7.3+spark2.1.0+hbase0.98分布式集群部署

    运行环境配置(10.79.115.111-114) 1.关闭防火墙与selinux 关闭防火墙: CentOS 7.x默认使用的是firewall作为防火墙. systemctl stop firew ...

  4. Oracle数据库查找持有锁的SQL语句,而不是请求锁的SQL语句(原创)

    Oracle数据库查找持有锁的SQL语句,而不是请求锁的SQL语句 查找活动的事务以及活动事务关联的会话信息 select s.sid 会话ID, s.serial# 会话序列号, s.usernam ...

  5. 工作笔记-javascript-网络层封装

    /** * @Author Mona * @Date 2016-12-08 * @description 网络层封装 */ /** * 封装基本请求方式 */ window.BaseRequest = ...

  6. HDU 5963 朋友(树+博弈)

    #include<vector> #include<cstdio> #include<cstring> #include<algorithm> #def ...

  7. [转]VMware-Transport(VMDB) error -44:Message.The VMware Authorization Service is not running解决方案

    转自:http://blog.sina.com.cn/s/blog_70c9c4b40101i01v.html 1.VMware Workstation中新建的虚拟机在开机的时候出现这种错误:Tran ...

  8. 对JVM的理解

    操作系统内核是至高无尚的内功心法,只有掌握了内功,学习其他的武功才会轻而易举. 现在我们来谈谈java.JVM其实是操作系统中运行的进程,JVM有操作系统进程的所有共性,但是它却不是一个普通的进程,它 ...

  9. head中的title显示在body中

    今天遇到一个问题,就是title中的内容会显示在body中 <head> <title>324234</title> </head> 网上搜了一下是说编 ...

  10. centos7防火墙的简单配置介绍

    centos7版本 1.查看已开放的端口(默认不开放任何端口) firewall-cmd --list-ports 2.开启80端口 firewall-cmd --zone=public(作用域) - ...