Raspbian 源替换

Pypi¶

更换 Python 的第三方仓库源

方法一:文件替换¶

树莓派 Raspbian、Hassbian、Mossbian: /etc/pip.conf

Linux: ~/.pip/pip.conf

Windows 10: %APPDATA%\pip\pip.ini

macOS:$HOME/Library/Application Support/pip/pip.conf

复制粘贴以下内容并保存:

 

[global]
trusted-host=mirrors.aliyun.com
index-url=https://mirrors.aliyun.com/pypi/simple/

方法二:使用插件¶

 

pip install pqi
pqi ls
pqi use aliyun

阿里云源当前同步的 homeassistant 版本查询地址:https://mirrors.aliyun.com/pypi/simple/homeassistant/


NPM¶

更换 Node.js 软件包仓库源,推荐使用淘宝镜像源。

 

npm config set registry https://registry.npm.taobao.org

Ubuntu & Debian (Raspbian&Hassbian)¶

更换 apt 及 apt-get 的仓库源

 

sudo nano /etc/apt/sources.list

删除已有内容,之后复制粘贴

 

deb http://mirrors.aliyun.com/raspbian/raspbian/ stretch main non-free contrib 

deb-src http://mirrors.aliyun.com/raspbian/raspbian/ stretch main non-free contrib

Ctrl + X,Y,Enter

 

sudo apt update
sudo apt-get update

更换树莓派基金会维护软件源(不推荐):

 

sudo nano /etc/apt/sources.list.d/raspi.list

将所有行行首 # 注释掉,而后复制粘贴

 

deb http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian/ stretch main ui

deb-src http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian/ stretch main ui

Ctrl + X,Y,Enter

 

sudo apt update
sudo apt-get update

你可能感兴趣的:(Raspbian 源替换)