1.使用SSH或者在图形桌面下使用终端连接到你的NanoPiK2上
2.备份官方软件源

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

3.更换软件源
这里使用华为开源镜像站的镜像

sudo nano /etc/apt/sources.list

可以单独将http://ports.ubuntu.com/替换为https://mirrors.huaweicloud.com/ubuntu-ports/
也可以把全部内容用下面的内容替换

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

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

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

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

4.完成后使用Ctrl+X退出并输入Y+回车保存文件
5.更新软件源

sudo apt-get update

附一份官方源地址备份

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

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

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

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


一个好奇的人