首页 > 其他分享 >树莓派笔记

树莓派笔记

时间:2023-02-21 13:23:02浏览次数:47  
标签:树莓 cn mirrors 笔记 bullseye edu deb main

树莓派镜像

64位系统的树莓派得用Debian源

换源说明

清华源镜像站

首先通过 uname -m 确定你使用的系统的架构。

uname -m

需根据你的 Raspbian 选择对应的 Debian 版本:

Debian 9 (stretch) Debian 10 (buster) Debian 11 (bullseye)

建议使用清华源,阿里云的源无法安装docker等应用,本文 以Debian 11 (bullseye) 为例进行换源操作

编辑sources.list 文件

sudo nano /etc/apt/sources.list
  • armv7l
# armv7l 用户:编辑 `/etc/apt/sources.list` 文件,删除原文件所有内容,用以下内容取代
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

# armv7l 用户如果需要开启 multi-arch 使用 arm64 软件源,需要在 `/etc/apt/sources.list` 中加上
deb [arch=arm64] http://mirrors.tuna.tsinghua.edu.cn/raspbian/multiarch/ bullseye main
  • aarch64
# aarch64 用户:编辑 `/etc/apt/sources.list` 文件,用以下内容取代:
# 默认注释了源码镜像以提高 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

编辑raspi.list 文件

# 对于两个架构,编辑 `/etc/apt/sources.list.d/raspi.list` 文件,删除原文件所有内容,用以下内容取代:
deb https://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ bullseye main

更新软件源列表

注意:网址末尾的raspbian重复两次是必须的。因为 Raspbian 的仓库中除了APT软件源还包含其他代码。APT软件源不在仓库的根目录,而在raspbian/子目录下。

编辑镜像站后,请使用sudo apt-get update命令,更新软件源列表,同时检查您的编辑是否正确。

sudo apt-get update

sudo模式

切换账户

在使用Linux服务器或者虚拟机的时候,可能用到超级用户的权限,

利用su root,输入密码就可以获得超级用户权限,

su root

退出使用exit就可以回到普通用户了

exit

忘记密码

如果忘记密码,可通过以下命令直接修改密码

#修改 root 密码
sudo passwd root 

#修改默认的用户名为pi的密码,按照提示重复输入两次新密码即可
sudo passwd pi

网络代理

  • 编辑/etc/profile文件
sudo nano /etc/environment
  • 在最后增加两行,后面的IP和端口依据实际情况修改
export http_proxy="http://192.168.31.247:7890"
export https_proxy="http://192.168.31.247:7890"
export no_proxy="localhost, 127.0.0.1"
  • 接下来输入以下命令
sudo visudo
  • 将下面的行添加到文件中,这样sudo将使用您刚刚创建的环境变量:
Defaults env_keep+="http_proxy https_proxy no_proxy"
  • 之后重启就可以了
sudo reboot

标签:树莓,cn,mirrors,笔记,bullseye,edu,deb,main
From: https://www.cnblogs.com/dapenson/p/17140613.html

相关文章

  • 系统性能调优学习笔记04
    使用cgroup管理资源限制1、管理资源限制1.1使用ulimit限制系统资源限制系统资源早期使用的方法是ulimit命令,设置的限制是系统范围的,并在登录和会话启动时由PAM模块进行验证......
  • 2.21爬虫的一些笔记
    imporyurllib.requestresponse=urllib.request,urlopen('http://www.baidu.com')#请求站点获得一个httpResponse对象print(response.reqd().decode('utf-8'))#返回网......
  • JWT学习笔记
    JWT学习笔记JWT介绍jwt官网:https://jwt.io/百度:JWT(JSONWEBToken)的声明一般被用来在身份提供者和服务提供者间传递被认证的用户身份信息,以便于从资源服务器获取资源,也......
  • openpyxl 笔记
     Python-Codebase/simpread-python处理excel完整版-简书.mdatmaster·dantefung/Python-Codebase(github.com) hexo_blog_config/Python操作Excel.mdatma......
  • 读Java实战(第二版)笔记16_组合式异步编程
    1. 同步API1.1. 阻塞式调用1.2. 调用了某个方法,调用方在被调用方执行的过程中会等待,被调用方执行结束返回,调用方取得被调用方的返回值并继续运行2. 异步API2.1. ......
  • jdbc学习笔记
    JDBC尚硅谷https://www.bilibili.com/video/BV1sK411B71e?share_source=copy_web概述JDBC是连接Java和数据库的必要纽带MyBatis、HIBERNATE等都是封装了JDBC的应......
  • jenkins学习笔记之五:Maven、Ant、Gradl、Node构建工具集成
    一、jienkins集成Maven1.安装Maven下载地址:https://maven.apache.org/download.cgiwget--no-check-certificatehttps://dlcdn.apache.org/maven/maven-3/3.9.0/bin......
  • rust学习笔记
    目录rust学习笔记基础类型FundamentalTypes定宽数字类型rust学习笔记这学期选了一门rust课,今年上半年呢,由PKU精英团队打造的rust内核zroj就要正式上线了,请大家多多支持......
  • [转]《基于图像点特征的多视图三维重建》——相关概念汇总笔记
    1.   基于图像的图像3D重建传统上首先使用Structure-from-Motion恢复场景的稀疏表示和输入图像的相机姿势。然后,此输出用作Multi-ViewStereo(多视图立体)的输入,以恢......
  • 构造题学习笔记
    抽屉原理在构造题中,若我们遇到了\(n/k\)这样的操作次数的时候,可以考虑将所有数划分为\(k\)个集合。这样,最小的那个集合的大小就一定小于等于\(n/k\)了。CF1198C给......