树莓派使用记录 修改国内软件源《二》

使用 阿里云源 替换 ubuntu官方源

需要注意一点是 树莓派使用ARM处理器,库和普通ubuntu库不一样

普通使用     http://mirrors.aliyun.com/ubuntu/

ARM版使用 http://mirrors.aliyun.com/ubuntu-ports/

 

1,备份 sources.list 文件

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

 

2,使用 vim 编辑 sources.list 文件

sudo vim /etc/apt/sources.list

 

3,查看系统版本

lsb_release -a

 

4,根据系统版本,找到对应的源配置

https://developer.aliyun.com/mirror/ubuntu

把所有 ubuntu 替换为 ubuntu-ports

下面是替换好的 ubuntu 20.04(focal)  配置

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

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

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

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

deb http://mirrors.aliyun.com/ubuntu-ports/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu-ports/ focal-backports main restricted universe multiverse

 

如果配置的不是ARM版会报错

binary-arm64/Packages 404

上一篇:go交叉编译


下一篇:让 go build 生成的可执行文件对 Mac、linux、Windows 平台一致