Raspberry Pi source change tutorial

foreword

That’s right, the blogger owns a Raspberry Pi. When he first started, he didn’t know what changing the source was, so he went to Baidu’s tutorial on changing the source. However, the version mismatch also made the blogger suffer a lot. The purpose of this article is also to make the Raspberry Pi Xiaobai who has just entered the pit avoid detours (if you are a boss, you can ignore this article)

Prepare

  1. a Raspberry Pi
  2. An official operating system (both 32-bit and 64-bit available)
  3. hardworking hands

start

1. Select source

First of all, this tutorial is for you to change to Tsinghuayuan, and the help website of Tsinghuayuan is first posted here Tsinghuayuan

Of course, there are many domestic sources to choose from, such as Aliyuan and so on. You can refer to this tutorial and online tutorials to replace the corresponding sources. I won’t introduce them here.

pi-qinghua-introduce

As you can see, replacement is supported here

  • stretch
  • buster
  • bullseye

The source of these three versions

If the bottom layer of the system is the version corresponding to Deebin9, it is the stretch version, and the corresponding versions of other version systems can be calculated in turn

The blogger uses the official 64-bit operating system, corresponding to Deebin11, bullseye version

Friends who don't know their system version can use this command:cat /etc/os-release

pi-debian-version

2. Start changing the source

Enter the following command

sudo nano /etc/apt/sources.list

The blogger here uses the nano editor, if you have not downloaded it, you can use this command to download it sudo apt-get install nanoOf course , if you have other editors, replace nano like vim like thissudo vim /etc/apt/sources.list

Enter the command and you will see the following screen

pi-yuan-list

Ashamed to say, the blogger is too lazy to delete, so the source list has a lot of useless sources, friends, don’t learn from me

If you are changing the source for the first time, you should only see the three sources commented by the blogger, please add #a sign comment them out

After changing, remember to ctrl+ Oand then enter to write, then ctrl+ Xto exit

1. For Debian9 (stretch)

You will use the following sources

1.32-bit operating system use this

deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main non-free contrib rpi
# deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main non-free contrib rpi

The source of the comment can be used or not used, if you want to use it, please delete #the sign

2. 64-bit operating system uses this

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security stretch/updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security stretch/updates main contrib non-free

After the writing is complete, a file needs to be modified

Enter the following command

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

Comment out the original content

add the following

deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ stretch main

If 32-bit operating system users need to enable multi-arch to use arm64 software sources, they need to be added /etc/apt/sources.listto

deb [arch=arm64] http://mirrors.tuna.tsinghua.edu.cn/raspbian/multiarch/ stretch main

That is to say, add the above source to the operation of the first step

1. For Debian10(buster)

You will use the following sources

1.32-bit operating system use this

deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib rpi
# deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib rpi

The source of the comment can be used or not used, if you want to use it, please delete #the sign

2. 64-bit operating system uses this

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free

After the writing is complete, a file needs to be modified

Enter the following command

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

Comment out the original content

add the following

deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main

If 32-bit operating system users need to enable multi-arch to use arm64 software sources, they need to be added /etc/apt/sources.listto

deb [arch=arm64] http://mirrors.tuna.tsinghua.edu.cn/raspbian/multiarch/ buster main

That is to say, add the above source to the operation of the first step

1. For Debian11 (bullseye)

You will use the following sources

1.32-bit operating system use this

deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ bullseye main non-free contrib rpi
# deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ bullseye main non-free contrib rpi

The source of the comment can be used or not used, if you want to use it, please delete #the sign

2. 64-bit operating system uses this

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free

After the writing is complete, a file needs to be modified

Enter the following command

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

Comment out the original content

add the following

deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ bullseye main

If 32-bit operating system users need to enable multi-arch to use arm64 software sources, they need to be added /etc/apt/sources.listto

deb [arch=arm64] http://mirrors.tuna.tsinghua.edu.cn/raspbian/multiarch/ bullseye main

That is to say, add the above source to the operation of the first step

3. Update source

Remember to update the source after changing the source

Enter this commandsudo apt update

As shown in the figure, the update is successful

pi-yuan-update

If there is a package that can be updated, you can also enter it sudo apt upgradeto update

end

Congratulations, so far you have completed the replacement of the source and mastered the method of changing the source. I hope that all of you can become super giants in the future

Flowers at the end aaa="o((>ω< ))o"

Guess you like

Origin blog.csdn.net/m0_66648798/article/details/126567478