A. Edit/etc/apt/source.list
Command: sudo nano/etc/apt/source.list
or sudo vim/etc/apt/source.list
or sudo gedit/etc/apt/source.list
Which command to use depends on which one you have installed and what you are familiar with
I use the nano command here to see Raspbian comes with the following source:
Then delete them all or comment them all out, continue ...
B. Adding a Xinyuan
Deb < source address > wheezy main contrib non-free
DEB-SRC < source address > wheezy main contrib non-free
Give me a chestnut:
The source address is Tsinghua Mirror: http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/
Deb Http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/wheezy main contrib Non-free
DEB-SRC Http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/wheezy Main contrib Non-free
Give the official image link: http://www.raspbian.org/RaspbianMirrors
Our Chinese Mirror:
C. Successful source change
The old routine, the first thing you have to do
sudo apt update
And then
sudo apt upgrade
Reference: https://www.ncnynl.com/archives/201607/255.html