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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值