刷机
盒子就从U盘启动
系统默认的用户名和密码是root 1234
固件烧写到内置存储emmc
执行指令:
armbian-install
文章来源地址https://www.toymoban.com/news/detail-816511.html
根据盒子不同,输入参数不同如:305
输入关机指令poweroff或者直接拔电源。
换源
备份源
cp /etc/apt/sources.list /etc/apt/sources.list.backage
打开源文件文本
nano /etc/apt/sources.list
jammy 源
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-proposed main
restricted universe multiverse
* https://mirrors.aliyun.com/ubuntu-ports/
* http://mirrors.aliyun.com/ubuntu-ports/
* http://mirrors.ustc.edu.cn/ubuntu-ports/
* https://mirrors.tuna.tsinghua.edu.cn
国内源选择一个
163镜像站
deb http://mirrors.163.com/debian/ buster main non-free contrib
deb http://mirrors.163.com/debian/ buster-updates main non-free contrib
deb http://mirrors.163.com/debian/ buster-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib
deb-src http://mirrors.163.com/debian/ buster main non-free contrib
deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib
华为云镜像站
deb https://mirrors.huaweicloud.com/debian/ buster main contrib non-free
deb https://mirrors.huaweicloud.com/debian/ buster-updates main contrib non-free
deb https://mirrors.huaweicloud.com/debian/ buster-backports main contrib non-free
deb https://mirrors.huaweicloud.com/debian-security/ buster/updates main contrib non-free
deb-src https://mirrors.huaweicloud.com/debian/ buster main contrib non-free
deb-src https://mirrors.huaweicloud.com/debian/ buster-updates main contrib non-free
deb-src https://mirrors.huaweicloud.com/debian/ buster-backports main contrib non-free
腾讯云镜像站
deb http://mirrors.cloud.tencent.com/debian/ buster main non-free contrib
deb http://mirrors.cloud.tencent.com/debian-security buster/updates main
deb http://mirrors.cloud.tencent.com/debian/ buster-updates main non-free contrib
deb http://mirrors.cloud.tencent.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.cloud.tencent.com/debian-security buster/updates main
deb-src http://mirrors.cloud.tencent.com/debian/ buster main non-free contrib
deb-src http://mirrors.cloud.tencent.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.cloud.tencent.com/debian/ buster-backports main non-free contrib
中科大镜像站
deb https://mirrors.ustc.edu.cn/debian/ buster main contrib non-free
deb https://mirrors.ustc.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirrors.ustc.edu.cn/debian/ buster-backports main contrib non-free
deb https://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian/ buster main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian/ buster-updates main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian/ buster-backports main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free
阿里云镜像站
deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
清华大学镜像站
deb 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 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/ buster main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free
兰州大学镜像站
deb http://mirror.lzu.edu.cn/debian stable main contrib non-free
deb http://mirror.lzu.edu.cn/debian stable-updates main contrib non-free
deb http://mirror.lzu.edu.cn/debian/ buster-backports main contrib non-free
deb http://mirror.lzu.edu.cn/debian-security/ buster/updates main contrib non-free
deb-src http://mirror.lzu.edu.cn/debian stable main contrib non-free
deb-src http://mirror.lzu.edu.cn/debian stable-updates main contrib non-free
deb-src http://mirror.lzu.edu.cn/debian/ buster-backports main contrib non-free
deb-src http://mirror.lzu.edu.cn/debian-security/ buster/updates main contrib non-free
上海交大镜像站
deb https://mirror.sjtu.edu.cn/debian/ buster main contrib non-free
deb https://mirror.sjtu.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirror.sjtu.edu.cn/debian/ buster-backports main contrib non-free
deb https://mirror.sjtu.edu.cn/debian-security/ buster/updates main contrib non-free
deb-src https://mirror.sjtu.edu.cn/debian/ buster-updates main contrib non-free
deb-src https://mirror.sjtu.edu.cn/debian/ buster-backports main contrib non-free
deb-src https://mirror.sjtu.edu.cn/debian/ buster main contrib non-free
deb-src https://mirror.sjtu.edu.cn/debian-security/ buster/updates main contrib non-free
恢复官方源时只需执行(前提是你备份了,或者直接百度armbian官方源进行替换就行了)
rm /etc/apt/sources.list&&mv /etc/apt/sources.list.backage /etc/apt/sources.list
更新软件包列表,然后升级所有已安装的软件包。
apt-get update && apt-get upgrade
armbian-software安装桌面
Casaos
安装
curl -fsSL https://get.casaos.io | sudo bash
armbian基本的操作命令
Armbian基本的操作命令有:
armbian-config:调出窗口配置。
passwd:修改密码。
apt install:安装软件。
apt list --installed:列出安装的所有包。
apt list --installed | grep docker:列出安装的和docker相关的包。
apt-get remove docker-ce:删除已安装的软件包(保留配置文件)。
apt-get purge:删除已安装的软件包(不保留配置文件)。
umount:卸载文件卷。
mkfs.vfat:格式化文件卷。
reboot:重启系统。
lsblk:用于列出所有可用块设备的信息,例如磁盘、分区和挂载点
uptime:系统运行了多长时间
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-12
源码编译安装postgresql12
【postgreSQL】源码安装postgresql-14.0 - 巫安生 - 博客园 (cnblogs.com)
#下载地址和选定的源码包 https://www.postgresql.org/download/
创建postgres的系统用户和用户组
useradd -r postgres |
解压软件到指定的目录下
tar -zxvf postgresql-14.0.tar.gz -C /data |
配置数据库安装目录 cd /data/postgresql-14.0/
编译出错,换兰州大学的镜像源,安装依赖
./configure --prefix=/data/postgreSQL
不行就换
./configure --without-readline --prefix=/data/postgreSQL
构建
make
安装文件
make install
创建数据目录
mkdir -p /data/postgreSQL/pgsqlData |
|
chown postgres:postgres /data/postgreSQL/pgsqlData |
su postgres
# 初始化数据库
/data/postgreSQL/bin/initdb -D /data/postgreSQL/pgsqlData
cd /data/postgreSQL/pgsqlData
# 启动实例
/data/postgreSQL/bin/pg_ctl -D /data/postgreSQL/pgsqlData -l logfile start
armbian如何把/data/postgreSQL/bin加入到环境变量中
/etc/profile
export PATH=$PATH:/data/postgreSQL/bin
配置postgreSQL开机启动服务
vi /usr/lib/systemd/system/postgresql.service
[Unit]
Description=postgreSQL Server
[Service]
User=postgres
Group=postgres
Type=forking
TimeoutSec=0
PermissionsStartOnly=true
ExecStart=/data/postgreSQL/bin/pg_ctl -D /data/postgreSQL/pgsqlData start
LimitNOFILE = 65535
Restart=on-failure
RestartSec=3
RestartPreventExitStatus=1
PrivateTmp=false
[Install]
WantedBy=multi-user.target
加载配置和启动
systemctl daemon-reload |
|
systemctl start postgresql |
|
systemctl enable postgresql |
armbian安装SMB做文件共享
N1刷armbian安装SMB做文件共享_armbian samba-CSDN博客
安装SMB
apt install samba
配置SMB
配置文件/etc/samba/smb.conf
,直接覆盖原内容,实现匿名直接连接。
[global]
## fruit settings
min protocol = SMB2
ea support = yes
## vfs objects = fruit streams_xattr
fruit:metadata = stream
fruit:model = Macmini
fruit:veto_appledouble = no
fruit:posix_rename = yes
fruit:zero_file_id = yes
fruit:wipe_intentionally_left_blank_rfork = yes
fruit:delete_empty_adfiles = yes
map to guest = bad user
include=/etc/samba/smb.casa.conf
配置文件/etc/samba/smb.casa.conf
[bak]
comment = CasaOS share bak
public = Yes
path = /home/public
browseable = Yes
read only = No
guest ok = Yes
create mask = 0777
directory mask = 0777
force user = root
[bak]
comment = CasaOS share bak
public = Yes
path = /home/public
browseable = Yes
read only = No
guest ok = Yes
create mask = 0777
directory mask = 0777
force user = root
[bak]
comment = CasaOS share bak
public = Yes
path = /home/public
browseable = Yes
read only = No
guest ok = Yes
create mask = 0777
directory mask = 0777
force user = root
mkdir /home/public
修改目录权限
chmod -R 777 /home/public
开机启动SMB
systemctl enable samba
重启SMBsystemctl restart samba
查看SD卡
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk1 179:0 0 29.1G 0 disk
├─mmcblk1p1 179:1 0 255M 0 part /boot
└─mmcblk1p2 179:2 0 28.9G 0 part /
mmcblk1boot0 179:32 0 4M 1 disk
mmcblk1boot1 179:64 0 4M 1 disk
mmcblk0 179:96 0 7.4G 0 disk
└─mmcblk0p1 179:97 0 7.4G 0 part
zram0 254:0 0 1.9G 0 disk [SWAP]
zram1 254:1 0 50M 0 disk /var/log
挂载到刚才的共享目录/home/public
mount /dev/mmcblk0p1 /home/public
命令blkid
查看UUID并记下
blkid /dev/mmcblk0p1
/dev/mmcblk0p1: UUID="D7E8-5547" BLOCK_SIZE="512" TYPE="exfat" PARTUUID="5452574f-01"
开机挂载,nano /etc/fstab
,加上以下内容
UUID=D7E8-5547 /home/public exfat defaults 0 0
启动挂载(好像不用这步也可以)mount -a
文章来源:https://www.toymoban.com/news/detail-816511.html
到了这里,关于armbian的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!