Home  >  Article  >  Operation and Maintenance  >  How to use Raspberry Pi 3B to change software sources

How to use Raspberry Pi 3B to change software sources

坏嘻嘻
坏嘻嘻Original
2018-09-15 17:28:162400browse

The content of this article is about how to use Raspberry Pi 3B to change the software source. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you

Raspberry Pi 3B software source change

  1. Replacement script

    Please copy the following script directly to the terminal for execution! !

sudo -secho -e "deb 
http://mirrors.ustc.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi \n deb-src 
http://mirrors.ustc.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi" > /etc/apt/sources.listecho -e "deb
http://mirrors.ustc.edu.cn/archive.raspberrypi.org/ stretch main ui" > /etc/apt/sources.list.d/raspi.listexitsudo 
     apt update && sudo apt -y upgrade

↓↓↓ This script adapts to 2017-06-21-raspbian-jessie (based on Debian8)

sudo -secho -e "deb 
http://mirrors.ustc.edu.cn/raspbian/raspbian/ jessie main non-free contrib \n deb-src 
http://mirrors.ustc.edu.cn/raspbian/raspbian/ jessie main non-free contrib" > /etc/apt/sources.listecho -e "deb 
http://mirrors.ustc.edu.cn/archive.raspberrypi.org/ jessie main" > /etc/apt/sources.list.d/raspi.listexitsudo 
     apt-get update && sudo apt-get -y upgrade

For non-this version, please open it yourself (/etc/apt/sources.list and /etc/apt/sources.list.d/raspi.list) and replace the URL

2. Other sources (Not tested!)

Sun Yat-sen University Raspbian http://mirror.sysu.edu.cn/raspbian/raspbian/

Tsinghua University Raspbian http://mirrors. tuna.tsinghua.edu.cn/raspbian/raspbian/

Huazhong University of Science and Technology Raspbian http://mirrors.hustunique.com/raspbian/raspbian/ Arch

Linux ARM http://mirrors .hustunique.com/archlinuxarm/

Dalian Neusoft Institute of Information Source (Northern users) Raspbian
http://mirrors.neusoft.edu.cn/raspbian/raspbian/

Chongqing University Source (Midwest users) Raspbian http://mirrors.cqu.edu.cn/Raspbian/raspbian/


Other parts:


1.Chinese Support and Chinese input method

sudo apt-get install -y ttf-wqy-zenheisudo apt-get install -y scim-pinyin

2. Install vim

sudo apt-get install -y vim

If the following error occurs:

The following packages have unmet dependencies:
vim : Depends: vim-common (= 2:7.4.488-7 deb8u3) but 2:8.0.0197-4 is to be installed
E: Unable to correct problems, you have held broken packages.

Uninstall vim-common first and then install vim

sudo apt-get remove vim-commonsudo apt-get install -y vim

3. Watchdog (to prevent the Raspberry Pi from crashing Monitoring)

When using the Raspberry Pi to do some applications that require long-term waiting, such as download machines, cloud storage, home theater and other applications, one of the problems we often encounter is that the Raspberry Pi The Pi will freeze due to overheating, requiring us to restart the Raspberry Pi and then start the application on the Raspberry Pi again. This will bring a lot of trouble to our daily operations.
Watchdog (watchdog) can prevent the Raspberry Pi from crashing.

//树莓派自带看门狗模块,我们需要添加进去就好。
sudo modprobe bcm2708_wdog
echo -e "\nbcm2708_wdog" > sudo tee -a /etc/modules
// 安装看门狗软件
sudo apt-get install -y chkconfig watchdog
// 配置
sudo vim /etc/watchdog.conf
// 去掉
"watchdog-device=/dev/watchdog"
这一行的#注释
// 其它配置参考如下:# 用于设定CPU温度重启条件
temperature-device = /sys/class/thermal/thermal_zone0/temp
# 最大温度为100度,超过立即重启max-temperature = 100000
# 1分钟最多进程为24个,超过即重启max-load-15=12
# 5分钟最多进程为18个,超过即重启max-load-15=12
# 15分钟最多进程为12个,超过即重启max-load-15=12
// 完成配置后,启动看门狗sudo /etc/init.d/watchdog start
// 设置为开机自启chkconfig watchdog on

4.Screen(Let the Raspberry Pi never lose connection)

Using SSH (Serare Shell, Secure Shell Protocol) to remotely control the Raspberry Pi should be The most common way we operate Raspberry Pi, but when connecting with SSH, we often encounter the problem of sudden disconnection. Once the connection is disconnected, the original operation we performed will be interrupted. If we use it again, we will have to start all over again. I believe you must have been troubled by the computer standby interrupting the task of the Raspberry Pi.
Screen is a way to keep the Raspberry Pi connected forever. Under this method, even if the connection is disconnected, we can still perform the original operation when we reconnect without having to start over.

// 直接安装Screensudo apt-get install -y screen// 开启一个后台view(后台的终端,不会因为断开连接而终止)
screen -S 终端名// 然后就可以继续你的操作了

Commonly used commands

Command Parameter Function
Screen -S Terminal name Create a new background virtual terminal

-ls View the created background virtual terminal

-r terminal Name Enter the terminal

Shortcut key

Shortcut key Press Function
Ctrol a d Save a background virtual Terminal
Ctrol a w Display a list of all windows
Ctrol a Ctrol a Switch to the previously displayed window
Ctrol a c Create a new window running the shell
Ctrol a n Switch to the next window
Ctrol a p Switch to the previous window
Ctrol a 0..9 Switch window0..9
Ctrol a #a Send C-a to the current session
Ctrol a k Kill Drop the current window
Ctrol a [ Enter copy/rollback mode

The above is the detailed content of How to use Raspberry Pi 3B to change software sources. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn