ubuntu更換安裝源和pip映象源
一、pip源配置
清華pip源地址:https://pypi.tuna.tsinghua.edu.cn/simple
豆瓣pip源地址:https://pypi.doubanio.com/simple/
1. 臨時使用
這裡以清華的映象源為例,若要使用其他的源,改變地址就可以了。
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
- 1
2. 設為預設
修改配置檔案:~/.config/pip/pip.conf (Linux), (沒有就建立一個), 將 index-url改成至tuna,例如
在.config資料夾中建立pip/pip.conf
#建立pip資料夾
sudo mkdir pip
cd pip
#建立pip.cong檔案
touch pip.conf
#編輯pip.conf檔案
sudo vim pip.conf
在pip.conf檔案中新增清華大學的pypi映象,要是想用其他的映象,替換成相應的地址即可。
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
二、ubuntu源配置
1. 配置原始檔位置
備份並替換/etc/apt/sources.list的源內容,將原檔案做一個備份。
命令:cp /etc/apt/sources.list /etc/apt/sources.list.bak
2. 更改原始檔內容
在終端輸入命令:
sudo vim /etc/apt/sources.list
將檔案內容替換成想要更換的源
清華的源
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
修改完後還需要更新使其生效
sudo apt-get update
相關文章
- Ubuntu apt-get和pip源更換Ubuntuapt-get
- 【PY】更換 pip 源到國內映象
- [PY] 更換 pip 源到國內映象
- Ubuntu apt-get和pip國內源更換Ubuntuapt-get
- Yarn 的安裝與更換國內映象源Yarn
- Mac-Homebrew 安裝/解除安裝/更換國內映象源Mac
- pip/pip3更換國內源
- pip更換資料來源
- anaconda pip 安裝速度慢,更換阿里雲源阿里
- pip 換成國內阿里映象源阿里
- Jetson Nano 更換映象源NaN
- pip 清華源安裝
- pip安裝源配置
- Ubuntu切換為阿里映象源Ubuntu阿里
- Ubuntu軟體更新更換源Ubuntu
- 修改pip源到國內的映象源
- 更換Ubuntu源為國內源的操作記錄Ubuntu
- pip安裝如何新增清華源
- Ubuntu20安裝nodejs和npm並切換阿里源UbuntuNodeJSNPM阿里
- 使用中科大映象源一鍵給 ubuntu 安裝 dockerUbuntuDocker
- CentOS7 切換阿里映象源並安裝 dockerCentOS阿里Docker
- ubuntu換源Ubuntu
- Mac下更換Homebrew映象源的實現方法Mac
- Python 包管理 pip 安裝使用清華源Python
- Windows下pip換成清華源Windows
- pip安裝python庫時使用國內映象資源加速下載過程Python
- Linux環境更換阿里源(CentOS+Ubuntu)Linux阿里CentOSUbuntu
- ubuntu切換源Ubuntu
- Ubuntu APT 換源UbuntuAPT
- centos換源+安裝postgresqlCentOSSQL
- Ubuntu如何配置軟體映象源?Ubuntu
- 【二】pip換源以及PyCharm的功能PyCharm
- Homebrew 換源安裝與使用
- Rocky Linux搗鼓記錄(二):更換國內映象源Linux
- Ubuntu 配置 pip.conf 新增國內源Ubuntu
- 使用taobao的npm映象源,同時安裝nrm映象工具NPM
- Ubuntu18.04更換國內源(阿里,網易,中科大,清華等源)Ubuntu阿里
- Docker中ubuntu映象配置apt阿里源DockerUbuntuAPT阿里