树莓派基础安装(树莓派3b+安装)
liuian 2025-05-03 15:15 47 浏览
一、设置ll
vim ~/.bashrcPROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
if [ -f "$HOME/.cargo/env" ]; then
. "$HOME/.cargo/env"
fisource ~/.bashrc二、更改端口
1. 编辑配置
vim /etc/ssh/sshd_config2. 设置参数
Port 8022
PermitRootLogin yes3. 重启服务
systemctl restart ssh4. 设置root密码
passwd root
passwd123三、修改数据源(清华大学)
网站
cp /etc/apt/sources.list /etc/apt/sources.list.bak
vim /etc/apt/sources.list# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
# deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmwareapt-get update && apt-get upgrade -y四、配置固定IP
nmcli -p connection show
nmcli con mod "Wired connection 1" ipv4.addresses 192.168.1.100/24 ipv4.method manual
nmcli con mod "Wired connection 1" ipv4.gateway 192.168.1.1
nmcli con mod "Wired connection 1" ipv4.dns "223.5.5.5,114.114.114.114,8.8.8.8"
nmcli con up "Wired connection 1"
hostname -I五、自动更新外网ip
安装软件
apt-get install python3-pip python3-venv1、阿里云
cd /usr/local/
mkdir aliyun_update_dns
cd aliyun_update_dns/python3 -m venv aliyun
source aliyun/bin/activate
pip install aliyun-python-sdk-core
pip install aliyun-python-sdk-alidns
pip install requests
python -c "import requests; print(requests.__version__)"
vim update_dns.pypython update_dns.py2、cloudflare
cd /usr/local/
mkdir cloudflare_update_dns
cd cloudflare_update_dns/python3 -m venv cloudflare
source cloudflare/bin/activate
pip install requests cloudflare
python cloudflare-ddns.py定时器
crontab -e # */5 * * * * /usr/local/aliyun_update_dns/myenv/bin/python /usr/local/aliyun_update_dns/update_dns.py >> /usr/local/aliyun_update_dns/update_dns.log 2>&1
*/5 * * * * /usr/local/cloudflare_update_dns/cloudflare/bin/python /usr/local/cloudflare_update_dns/cloudflare-ddns.py六、挂在硬盘
1. 临时挂载
apt install ntfs-3g samba samba-common-bin
mkdir /mnt/ntfs
mount -t ntfs-3g /dev/sda1 /mnt/ntfs2. 获取磁盘信息
blkid
vim /etc/fstabUUID=50CE4302CE42E038 /mnt/ntfs ntfs-3g defaults,nofail 0 03. 设置权限,重启服务
chmod -R 777 /mnt
systemctl restart samba七、安装apparmor
apt install apparmor apparmor-utils
vim /boot/firmware/cmdline.txt末尾添加
apparmor=1 security=apparmor systemd.unified_cgroup_hierarchy=false八、安装JAVA
cd /usr/local/
wget https://download.oracle.com/java/17/archive/jdk-17.0.12_linux-aarch64_bin.tar.gz
tar -zxvf jdk-17.0.12_linux-aarch64_bin.tar.gz
vim /etc/profileexport JAVA_HOME=/usr/local/jdk-17.0.12
export PATH=$JAVA_HOME/bin:$PATHsource /etc/profilejava -version九、安装ngixn
apt-get install nginxvim /etc/nginx/nginx.conf十、安装redis
1. 安装
apt-get install redis-server2. 修改密码
vim /etc/redis/redis.conf注释bind 127.0.0.1 -::1
requirepass passwd1233. 重启服务
systemctl restart redis
systemctl enable redis十一、安装postgresql
1. 安装
apt install postgresql postgresql-client2. 修改密码
sudo -u postgres psql
ALTER USER postgres PASSWORD 'passwd123';
\q3. 更改postgresql.conf权限
vim /etc/postgresql/15/main/postgresql.conflisten_addresses = '*'4. 更改pg_hba.conf权限
vim /etc/postgresql/15/main/pg_hba.confhost all all 0.0.0.0/0 md55. 重启服务
systemctl restart postgresqlapt-get remove --purge postgresql-15
apt-get autoremove
apt-get update
apt-get install postgresql-15十二、安装home-assistant
1. 停用ModemManager
systemctl stop ModemManager
systemctl disable ModemManager2. 安装依赖
apt install apparmor bluez cifs-utils curl dbus jq libglib2.0-bin lsb-release network-manager nfs-common systemd-journal-remote systemd-resolved udisks2 wget -y3. 安装docker
curl -fsSL https://get.docker.com | sh4. 修改docker源
vim /etc/docker/daemon.json{
"log-driver": "journald",
"storage-driver": "overlay2",
"ip6tables": true,
"experimental": true,
"log-opts": {
"tag": "{{.Name}}"
},
"registry-mirrors": [
"https://docker.1panel.live",
"https://hub.rat.dev/",
"https://docker.chenby.cn",
"https://docker.m.daocloud.io"
]
}5. 安装代理(必须重启)
wget https://github.com/home-assistant/os-agent/releases/download/1.6.0/os-agent_1.6.0_linux_aarch64.deb
dpkg -i os-agent_1.6.0_linux_aarch64.deb6. 安装homeassistant-supervised
wget -O homeassistant-supervised.deb https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb
apt install ./homeassistant-supervised.deb7. 安装HACS
wget -O - https://hacs.vip/get | bash -8. home assistant 网关配置
nmcli -p connection show
nmcli con mod "Supervisor eth0" ipv4.addresses 192.168.1.100/24 ipv4.method manual
nmcli con mod "Supervisor eth0" ipv4.gateway 192.168.1.1
nmcli con mod "Supervisor eth0" ipv4.dns "223.5.5.5,114.114.114.114,8.8.8.8"
nmcli con up "Supervisor eth0"十三、安装immich
1. 安装postgresql插件
pgvecto.rs插件,用于向量搜索,支持 AI 驱动的照片搜索功能
2. 安装依赖
apt-get install libjemalloc-dev3. 修改配置
vim /boot/firmware/config.txt
kernel=kernel8.img4. 下载依赖
wget https://github.com/tensorchord/pgvecto.rs/releases/download/v0.3.0/vectors-pg15_aarch64-unknown-linux-gnu_0.3.0.zip5. 解压安装
unzip vectors-pg15_aarch64-unknown-linux-gnu_0.3.0.zip -d vectors
cp vectors/vectors.so $(pg_config --pkglibdir)/
cp vectors/vectors--* $(pg_config --sharedir)/extension/
cp vectors/vectors.control $(pg_config --sharedir)/extension/6. 编辑配置文件
vim /etc/postgresql/15/main/postgresql.confshared_preload_libraries = 'vectors.so'
search_path = '"$user", public, vectors'7. 重启服务
systemctl restart postgresql8. 验证
DROP EXTENSION IF EXISTS vectors;
CREATE EXTENSION vectors;pg_trgm 插件,用于模糊文本搜索
apt install postgresql-contrib9. 验证,进入immich库
CREATE EXTENSION IF NOT EXISTS vectors;
CREATE EXTENSION IF NOT EXISTS pg_trgm;2、安装immich
cd /usr/local
mkdir immich-app
cd immich-app1. 获取 docker-compose.yml 文件
wget -O docker-compose.yml https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml2. 获取 .env 文件
wget -O .env https://github.com/immich-app/immich/releases/latest/download/example.env3. (可选)获取 hwaccel.transcoding.yml 文件
wget -O hwaccel.transcoding.yml https://github.com/immich-app/immich/releases/latest/download/hwaccel.transcoding.yml4. (可选)获取 hwaccel.ml.yml 文件
wget -O hwaccel.ml.yml https://github.com/immich-app/immich/releases/latest/download/hwaccel.ml.yml5. 启动
docker compose up -d6. 更新
docker compose pull && docker compose up -d十四、安装dify
cd /usr/local/
git clone https://github.com/langgenius/dify.git
cd dify/docker
cp .env.example .env启动
docker compose up -d十五、安装npm
# 下载并安装nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash
# 代替重新启动外壳
\. "$HOME/.nvm/nvm.sh"
# 下载并安装Node.js
nvm install 22
# 对Node.js版本进行验证
node -v # 应该打印 "v22.14.0".
nvm current # 应该打印 "v22.14.0".
# 验证npm版本
npm -v # 应该打印 "10.9.2".相关推荐
- cdr格式文件怎么打开(cdr格式用什么可以打开)
-
cdr是什么文件?cdr文件用什么打开?cdr文件是CorelDraw图像制作软件标准的输出格式,与photoshop(PS)图片设计软件类似都属于图片设计软件,需要打开cdr文件我们就需要先了解C...
- 微软win7系统下载(微软官网window7下载)
-
因为你是按照名称排列的,试着修改一下排序方式,方法是:在桌面空白处右键,排序方式,修改日期这是因为大部分电脑用的都是GHOST系统,该系统在安装后都会向注册表写入自己的“私人信息”,如:风林火山GH...
- xp10下载(Xp10下载破解版)
-
下载win10系统所需要的时间取决于很多因素。首先就是系统本身的大小,一般情况下,纯净版的系统在2.3个g左右,而有一些定制版的系统大小就不好说了,但是删减版的系统可以做到1.7个g左右,系统本身文件...
- 最强神级选择系统(无敌之最强神级选择系统)
-
8.自由高达《机动战士高达SEED》 7.V高达《机动战士高达V》 6.00高达《机动战士高达00》 5.独角兽高达《机动战士高达UC》 4.倒A高达《倒A高达》 3.V2高达《机动战士高...
- 惠普服务器售后电话客服热线
-
售后官网:https://support.hp.com/cn-zh/check-warranty该网站为惠普全新一站式服务支持平台,小惠将为您提供专业的技术解答和产品导购。同时提供全面的自助解决方案...
- win10改成win7界面(win10改为win7界面)
-
1、首先我们打开你的电脑,选择打开左下角的开始菜单。2、打开后就选择设置按钮。3、打开之后就是这个页面往下拉,你就会看见更新,就是红圈圈里面,打开它。4、打开之后就是这个页面。5、然后我们在左侧选择恢...
- win10系统怎么恢复系统还原(win10系统恢复怎么操作)
-
1、开机不断点击F8键,进入系统操作选单,选“最后一次正确配置”,重启电脑,看能否解决。2、开机不断点击F8键,进入系统操作选单,选“安全模式”,如能成功进入,依次单击“开始”→“所有程序”→“附件”...
- 怎么把电脑c盘格式化(怎么把c盘格式化吗)
-
1.在进行c盘格式化之前,必须备份重要的数据,以免数据丢失。2.在格式化c盘之前,确保所有的应用程序和系统文件都已经备份。否则,在进行格式化之后,将需要重新安装操作系统和所有的应用程序。3.如果...
- 中国移动赠送的wifi6路由器(192.168.10.1中国移动路由器)
-
移动tclwifi6路由器很好的。WiFi6路由器远强于WiFi5路由器,值得购买性价比不错。家庭生活中网速慢最主要的原因并非速率,而是穿墙效果。坐在离路由器很近的地方,手机网速一般不会有问题。...
- win官网网址(win官方网站)
-
具体方法如下:打开电脑,在浏览器地址栏输入window,就会进入win中文官网,然后再寻找自己需要的软件,升级包等就可以了。下面是windows官网网址:1http://www.microsoft.c...
- wifi网址登录入口(wifi网址登录入口有哪些)
-
wifi网页登录入口是网关地址192.168.1.1.1.首先检查路由器线路连接(参考前面手机设置路由器部分)2.将电脑Tnternet协议(TCP/IP)属性设置为“自动获取IP地址”和“自...
- 没有驱动程序怎么安装打印机
-
(1)启动电脑进入Windows操作系统,在桌面上单击开始-设置-打印机。(2)用鼠标右单击安装好的打印机图标,在弹出的右键菜单中选择属性,然后单击打印测试页按钮。(3)此时打印机会打出一页信息,从这...
- u盘怎么取消写保护状态(u盘如何解除写保护状态)
-
如果您的U盘被设置为写保护,您可以尝试以下方法来关闭写保护:1.检查U盘上的物理开关:一些U盘上可能有一个物理开关,用于启用或禁用写保护。请检查U盘的外壳,看看是否有这样的开关,并将其切换到未锁定的...
- 一周热门
- 最近发表
- 标签列表
-
- python判断字典是否为空 (50)
- crontab每周一执行 (48)
- aes和des区别 (43)
- bash脚本和shell脚本的区别 (35)
- canvas库 (33)
- dataframe筛选满足条件的行 (35)
- gitlab日志 (33)
- lua xpcall (36)
- blob转json (33)
- python判断是否在列表中 (34)
- python html转pdf (36)
- 安装指定版本npm (37)
- idea搜索jar包内容 (33)
- css鼠标悬停出现隐藏的文字 (34)
- linux nacos启动命令 (33)
- gitlab 日志 (36)
- adb pull (37)
- python判断元素在不在列表里 (34)
- python 字典删除元素 (34)
- vscode切换git分支 (35)
- python bytes转16进制 (35)
- grep前后几行 (34)
- hashmap转list (35)
- c++ 字符串查找 (35)
- mysql刷新权限 (34)
