Difference between revisions of "Template:OfficialDebianCore/zh"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
(updated by API)
 
(7 intermediate revisions by the same user not shown)
Line 9: Line 9:
 
===查看IP地址===
 
===查看IP地址===
 
由于Debian Bullseye主机名默认为硬件型号, 所以可以使用ping命令来获得IP地址: <code>ping {{{1}}}</code><br/>
 
由于Debian Bullseye主机名默认为硬件型号, 所以可以使用ping命令来获得IP地址: <code>ping {{{1}}}</code><br/>
 +
Debian Bullseye使用network-manager管理网络, 网口默认配置成DHCP自动获取IP地址 (包括有多网口的设备)。
 
===通过ssh登录Debian===
 
===通过ssh登录Debian===
 
使用以下命令:<code>ssh pi@{{{1}}}</code><br/>
 
使用以下命令:<code>ssh pi@{{{1}}}</code><br/>
 
默认密码为pi
 
默认密码为pi
 +
 
===更新软件包===
 
===更新软件包===
 
====更换软件源为国内镜像源====
 
====更换软件源为国内镜像源====
Line 43: Line 45:
 
  | NanoPi-R2S
 
  | NanoPi-R2S
 
  | NanoPi-R2C-Plus
 
  | NanoPi-R2C-Plus
 +
| NanoPi-R2S-Plus
 
  | NanoPi-R2C =
 
  | NanoPi-R2C =
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 51: Line 54:
 
  | NanoPi-R5S =
 
  | NanoPi-R5S =
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
git clone https://github.com/friendlyarm/sd-fuse_rk3568.git -b master --single-branch
+
git clone https://github.com/friendlyarm/sd-fuse_rk3568.git -b kernel-6.1.y --single-branch
 
cd sd-fuse_rk3568
 
cd sd-fuse_rk3568
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
| NanoPi-R6C
 
  | NanoPi-R6S =
 
  | NanoPi-R6S =
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
git clone https://github.com/friendlyarm/sd-fuse_rk3588.git -b master --single-branch
+
git clone https://github.com/friendlyarm/sd-fuse_rk3588.git -b kernel-6.1.y --single-branch
 
cd sd-fuse_rk3588
 
cd sd-fuse_rk3588
 
</syntaxhighlight>
 
</syntaxhighlight>
Line 69: Line 73:
 
convert files/logo.jpg -type truecolor /tmp/logo.bmp
 
convert files/logo.jpg -type truecolor /tmp/logo.bmp
 
convert files/logo.jpg -type truecolor /tmp/logo_kernel.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 LOGO=/tmp/logo.bmp KERNEL_LOGO=/tmp/logo_kernel.bmp ./build-kernel.sh debian-bookworm-core-arm64
sudo ./mk-sd-image.sh debian-bullseye-core-arm64
+
sudo ./mk-sd-image.sh debian-bookworm-core-arm64
sudo ./mk-emmc-image.sh debian-bullseye-core-arm64
+
sudo ./mk-emmc-image.sh debian-bookworm-core-arm64
 
</syntaxhighlight>
 
</syntaxhighlight>
 
====恢复出厂设置====
 
====恢复出厂设置====
Line 78: Line 82:
 
sudo firstboot && sudo reboot
 
sudo firstboot && sudo reboot
 
</syntaxhighlight>
 
</syntaxhighlight>
===安装Docker===
+
===在Debian系统上安装Docker===
因Docker安装程序需要使用iptables, 而Debian默认使用的是nftables, 因此安装前先设置Debian使用传统的iptables:
+
请参考此链接: [[How to Install Docker on Debian/zh]]
<syntaxhighlight lang="bash">
+
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
+
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
+
</syntaxhighlight>
+
====安装docker====
+
<syntaxhighlight lang="bash">
+
curl -fsSL https://get.docker.com | bash
+
</syntaxhighlight>
+
验证是否安装成功:
+
<syntaxhighlight lang="bash">
+
sudo docker info
+
</syntaxhighlight>
+
====不使用sudo运行docker====
+
<syntaxhighlight lang="bash">
+
sudo groupadd docker
+
sudo gpasswd -a ${USER} docker
+
sudo systemctl restart docker
+
sudo chmod a+rw /var/run/docker.sock
+
</syntaxhighlight>
+
验证是否成功:
+
<syntaxhighlight lang="bash">
+
docker images
+
</syntaxhighlight>
+
====测试运行docker映像: 安装nextcloud网盘====
+
<syntaxhighlight lang="bash">
+
mkdir ~/nextcloud -p
+
docker run -d -p 8888:80  --name nextcloud  -v ~/nextcloud/:/var/www/html/ --restart=always --privileged=true  arm64v8/nextcloud
+
</syntaxhighlight>
+
安装完成后, 在电脑浏览器上访问: http://设备IP地址:8888, 即可查看nextcloud网盘页面。
+

Latest revision as of 08:18, 1 July 2024

1 Debian Core的使用

1.1 帐户与密码

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

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

1.2 查看IP地址

由于Debian Bullseye主机名默认为硬件型号, 所以可以使用ping命令来获得IP地址: ping {{{1}}}
Debian Bullseye使用network-manager管理网络, 网口默认配置成DHCP自动获取IP地址 (包括有多网口的设备)。

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-bookworm-core-arm64
sudo ./mk-sd-image.sh debian-bookworm-core-arm64
sudo ./mk-emmc-image.sh debian-bookworm-core-arm64

1.6.1 恢复出厂设置

在终端上执行如下命令:

sudo firstboot && sudo reboot

1.7 在Debian系统上安装Docker

请参考此链接: How to Install Docker on Debian/zh