Difference between revisions of "Template:OfficialDebianCore/zh"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
 
(updated by API)
Line 15: Line 15:
 
====更换软件源为国内镜像源====
 
====更换软件源为国内镜像源====
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.org
+
sudo cp /etc/apt/sources.list /etc/apt/sources.list.org
$ sudo sed -i -e 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
+
sudo sed -i -e 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
$ sudo apt update
+
sudo sed -i -e 's/security.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
 +
sudo apt update
 
</syntaxhighlight>
 
</syntaxhighlight>
 
===更改时区===
 
===更改时区===

Revision as of 06:22, 16 February 2023

1 Debian Core的使用

1.1 帐户与密码

普通用户:
    用户名: pi
    密码: pi

Root用户:
    默认没有设置root密码,可通过sudo passwd root命令配置root密码

1.2 查看IP地址

由于Debian Bullseye主机名默认为硬件型号, 所以可以使用ping命令来获得IP地址: ping {{{1}}}

1.3 通过ssh登录Debian

使用以下命令:ssh pi@{{{1}}}
默认密码为pi

1.4 更新软件包

1.4.1 更换软件源为国内镜像源

sudo cp /etc/apt/sources.list /etc/apt/sources.list.org
sudo sed -i -e 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
sudo sed -i -e 's/security.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
sudo apt update

1.5 更改时区

1.5.1 检查当前时区

timedatectl

1.5.2 列出所有时区

timedatectl list-timezones

1.5.3 设置时区 (比如上海)

sudo timedatectl set-timezone Asia/Shanghai

替换内核下面的两个文件,重新编译内核:
kernel/logo.bmp
kernel/logo_kernel.bmp
或者使用脚本来操作,如下所示:

  • 下载脚本
git clone https://github.com/friendlyarm/sd-fuse_rk3399.git -b kernel-4.19 --single-branch
cd sd-fuse_rk3399
  • 编译内核并重新打包固件
convert files/logo.jpg -type truecolor /tmp/logo.bmp
convert files/logo.jpg -type truecolor /tmp/logo_kernel.bmp
sudo LOGO=/tmp/logo.bmp KERNEL_LOGO=/tmp/logo_kernel.bmp ./build-kernel.sh debian-bullseye-core-arm64
sudo ./mk-sd-image.sh debian-bullseye-core-arm64
sudo ./mk-emmc-image.sh debian-bullseye-core-arm64

1.6.1 恢复出厂设置

在终端上执行如下命令:

sudo firstboot && sudo reboot

1.7 安装Docker

因Docker安装程序需要使用iptables, 而Debian默认使用的是nftables, 因此安装前先设置Debian使用传统的iptables:

sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy

1.7.1 安装docker

curl -fsSL https://get.docker.com | bash

验证是否安装成功:

sudo docker info

1.7.2 不使用sudo运行docker

sudo groupadd docker
sudo gpasswd -a ${USER} docker
sudo systemctl restart docker
sudo chmod a+rw /var/run/docker.sock

验证是否成功:

docker images

1.7.3 测试运行docker映像: 安装nextcloud网盘

mkdir ~/nextcloud -p
docker run -d -p 8888:80  --name nextcloud  -v ~/nextcloud/:/var/www/html/ --restart=always --privileged=true  arm64v8/nextcloud

安装完成后, 在电脑浏览器上访问: http://设备IP地址:8888, 即可查看nextcloud网盘页面。