当前位置:   article > 正文

ubuntu apt-get和python-pip国内源_apt-get python源

apt-get python源

1.apt-get

1、复制原文件备份

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

2、编辑源列表文件

sudo vim /etc/apt/sources.list
  • 1

3、将原来的列表删除,添加如下内容

deb http://mirrors.aliyun.com/ubuntu/ vivid main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid-backports main restricted universe multiverse
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

4、更新本地索引列表运行

sudo apt-get update #更新本地索引列表
#sudo apt-get upgrade # 可选/根据更新的索引升级已安装的所有软件包
  • 1
  • 2

2.pip源

在主目录下创建.pip文件夹,然后在该目录下创建pip.conf文件

mkdir ~/.pip
vim ~/.pip/pip.conf
  • 1
  • 2

pip.conf文件编写如下内容:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple 
  • 1
  • 2
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/71213
推荐阅读
相关标签
  

闽ICP备14008679号