树莓派源开启root登录以及更换国内源

机型:树莓派4B

系统:Raspberry Pi OS (32 bit) beta

树莓派的默认账户密码:

默认用户名:pi 密码:raspberry。第一次启动时,系统会提示更改。

启动root账户的方法:

可以用默认账户pi的sudo执行

如果需要开启root账号,可以用pi用户登录后,在命令行执行:

sudo passwd root

根据密码设置提示输入两次密码,然后在执行:

sudo passwd --unlock root

这样可解锁root账户。

更换源:

备份源文件soruces.list和raspi.list

修改源文件:

修改sources.list文件:

root@raspberrypi:/etc/apt# vim sources.list
#deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi

# 注释掉以前的源,添加以下两行:
deb http://mirrors.tuna.tsinghua.edu.cn/raspberry-pi-os/raspbian/ buster main non-free contrib rpi
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspberry-pi-os/raspbian/ buster main non-free contrib rpi

修改raspi.list文件:

root@raspberrypi:/etc/apt# vim sources.list.d/raspi.list
#deb http://archive.raspberrypi.org/debian/ buster main
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/debian/ buster main

# 注释掉之前的,添加以下一行:
deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui

同步更新源,软件包:

执行以下命令:

sudo apt-get update

sudo apt-get upgrade

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值