Ubuntu apt-get 和 pip 更换源

2023-05-16

Ubuntu系统自带的源都是国外的网址,国内用户在使用的时候网速比较慢。一个软件的下载是十分痛苦的,这里讲解一下如何将国外源更换为国内源,让你的网速Biu.Biu.Biu。

更换apt-get数据源

1.备份原先的源

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

将以前的源备份一下,以防以后可以用的。

2.更换源

sudo gedit /etc/apt/sources.list

使用gedit打开文档,将下边的阿里源复制进去,然后点击保存关闭。

阿里源

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse 

deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse 

deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse 

deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse 

deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse 

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse 

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse 

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse 

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe

3.更新源与软件

更新源

sudo apt-get update

更新软件

sudo apt-get upgrade

4.其他常用源

西电源(只有校内网网线使用,但是不限制流量,还是十分靠谱的)

deb http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial main restricted universe multiverse#deb-srchttp://linux.xidian.edu.cn/mirrors/ubuntu/ xenial main restricted universe multiversedeb http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-security main restricted universe multiverse#deb-srchttp://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-security main restricted universe multiversedeb http://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-updates main restricted universe multiverse#deb-srchttp://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-updates main restricted universe multiverse#debhttp://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-backports main restricted universe multiverse#deb-srchttp://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-backports main restricted universe multiverse#debhttp://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-proposed main restricted universe multiverse#deb-srchttp://linux.xidian.edu.cn/mirrors/ubuntu/ xenial-proposed main restricted universe multiverse

清华源

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

网易源

deb http://mirrors.163.com/ubuntu/ wily main restricted universe multiversedeb http://mirrors.163.com/ubuntu/ wily-security main restricted universe multiversedeb http://mirrors.163.com/ubuntu/ wily-updates main restricted universe multiversedeb http://mirrors.163.com/ubuntu/ wily-proposed main restricted universe multiversedeb http://mirrors.163.com/ubuntu/ wily-backports main restricted universe multiversedeb-srchttp://mirrors.163.com/ubuntu/ wily main restricted universe multiversedeb-srchttp://mirrors.163.com/ubuntu/ wily-security main restricted universe multiversedeb-srchttp://mirrors.163.com/ubuntu/ wily-updates main restricted universe multiversedeb-srchttp://mirrors.163.com/ubuntu/ wily-proposed main restricted universe multiversedeb-srch    ttp://mirrors.163.com/ubuntu/ wily-backports main restricted universe multiverse

  参考网址:https://blog.csdn.net/qq_35451572/article/details/79516563

更换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

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

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/



作者:TechManZhang
链接:https://www.jianshu.com/p/a217d8774ad5
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Ubuntu apt-get 和 pip 更换源 的相关文章

随机推荐

  • java中JFrame中函数removeAll的用法

    解答链接 用baidu搜了半天搜不出来 xff0c 用google一下就出来了 下面用自己的代码来解释下removeAll xff08 xff09 的用法 注意一定要在getContentPane xff08 xff09 中用removeA
  • ROS中的package.xml详解

    span class token prolog lt xml version 61 34 1 0 34 gt span span class token tag span class token tag span class token p
  • (一)了解Freertos

    关于Freertos FreeRTOS非常适合使用微控制器或小型微处理器的深度嵌入式实时应用程序 这种类型的应用程序通常包含硬实时需求和软实时需求 软实时需求 是那些规定了一个时间截止日期的需求 但是违反这个截止日期并不会使系统崩溃 例如
  • 如何关闭iOS系统自动更新提示?

    原文链接 xff1a https www zhihu com question 37297197 打开iPhone或者iPad的Safari浏览器 xff0c 复制以下网址并从自带浏览器打开 https oldcat me web NOOT
  • 大数据高级开发工程师——大数据相关工具之三 Maxwell

    文章目录 大数据相关工具Maxwell数据实时同步工具Maxwell 简介Maxwell工作原理MySQL Binlog 介绍1 Binlog简介2 Binlog的日志格式 Mysql 实时数据同步方案对比开启MySQL的BinlogMax
  • TF-IDF算法详解及sklearn代码实现

    目录 1 基本介绍 xff08 1 xff09 TF xff08 词频 Term Frequency xff09 xff08 2 xff09 IDF xff08 逆向文件频率 Inverse Document Frequency xff09
  • UEFI下Windows启动引导的顺序(附带linux双系统)

    这里均以64位系统 xff08 windows和linux均是 xff09 xff0c gpt分区 xff0c UEFI引导作为例子 xff0c 现在基本上不会不支持吧 windows下UEFI引导文件的载入顺序 主板启动windows的一
  • 在ROS环境下用yolov3-tiny训练自己的数据集

    由于整个过程新建 修改 设置的文件和参数较多 所以我先放张整个流程分析图在这 xff0c 方便大家结合下列步骤去更好理解 0 提前准备 xff1a 下载darknet xff08 yolov3 xff09 并编译 span class to
  • ROS下使用usb_cam驱动读取摄像头数据

    因为darknet ros会直接订阅指定的图像话题名 xff0c 然后对图像进行检测 xff0c 绘制检测框 xff0c 并发布相应的检测话题 xff0c 因此首先需要找一个能够发布图像话题的ROS包 xff0c 这里经推荐使用ROS官方提
  • python 各种加密

    背景 加密学习 对称加密 对称密钥加密 xff0c 又叫私钥加密 即信息发送的方和接受方用一个密钥去加密和揭秘数据 最大的优势是 加解密速度快 xff0c 适合对大量数据进行加密 xff0c 对称加密的缺点是密钥的管理和分配 xff0c 换
  • 参加中国移动开发者大会有感

    作为我校CSDN俱乐部的主席 xff0c 我很荣幸受到CSDN的邀请参加中国移动开发者大会 xff0c 下面写点自己的感悟 xff1a 移动互联网应用大时代已经到来 xff0c 所有的IT应用都将移动化 xff0c 所有的信息服务都将移动化
  • IntelD435摄像头将深度图与摄像头进行像素对齐(并抽帧保存)

    coding 61 utf 8 import pyrealsense2 as rs import numpy as np import cv2 import os 创建一个管道 pipeline 61 rs pipeline Create
  • python3 可视化COCO格式json文件目标检测矩形框

    import os import json import argparse from PIL import Image ImageDraw ImageFont FONT SIZE 61 13 2 IMAGE FONT 61 ImageFon
  • 对比图像清晰度(模糊度)之灰度方差算法 python代码实现

    灰度方差算法 图像最清晰 xff0c 图像中的高频分量也最多 xff0c 该算法以图像所有像素的灰度平均值为参考 xff0c 对每个像素点的灰度值求差后求平方和 xff0c 然后用像素总数标准化 xff0c 它表征了图像灰度变化的平均程度
  • pytorch使用 ROIalign 代码实例

    batch size 61 x shape 0 all roi align feats 61 for i in range batch size hmap1 s 61 out hmap 1 i hmap1 s 61 hmap1 s unsq
  • python resize dicom(dcm)代码

    from glob import glob import os import pydicom import numpy as np import cv2 dcm list 61 sorted os listdir 39 xxxx 39 fo
  • 基于opencv和ffmpeg的图片转换成视频的两种方法实现,可生成H264格式

    opencv转换图片为视频 xff08 生成视频格式为MJPG xff09 encoding UTF 8 import glob as gb import cv2 图片文件夹地址 img path 61 gb glob 34 G temp
  • VGG16提取图片特征

    import os import numpy as np import torch import torch nn import torchvision models as models from torch autograd import
  • 防火墙之数据包过滤iptables

    内容简介 防火墙的概述 1 iptables简介 2 iptables基础 3 iptables语法 4 iptables实例 案例详解 xff08 一 xff09 防火墙的简介 防火墙是指设置在不同网络或网络安全域之间的一系列部件的组合
  • Ubuntu apt-get 和 pip 更换源

    Ubuntu系统自带的源都是国外的网址 xff0c 国内用户在使用的时候网速比较慢 一个软件的下载是十分痛苦的 xff0c 这里讲解一下如何将国外源更换为国内源 xff0c 让你的网速Biu Biu Biu 更换apt get数据源 1 备