Difference between revisions of "Template:DebianBusterDesktop-Common/zh"
(updated by API) |
(updated by API) |
||
(8 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | |||
===帐户与密码=== | ===帐户与密码=== | ||
普通用户:<br/> | 普通用户:<br/> | ||
Line 8: | Line 7: | ||
默认没有设置root密码,可通过sudo passwd root命令配置root密码 | 默认没有设置root密码,可通过sudo passwd root命令配置root密码 | ||
===查看IP地址=== | ===查看IP地址=== | ||
− | + | 由于Debian主机名默认为硬件型号, 所以可以使用ping命令来获得IP地址: <code>ping {{{1}}}</code><br/> | |
− | < | + | |
− | ping | + | |
− | </ | + | |
− | + | ||
===通过ssh登录Debian=== | ===通过ssh登录Debian=== | ||
− | < | + | 使用以下命令:<code>ssh pi@{{{1}}}</code><br/> |
− | ssh pi@ | + | |
− | </ | + | |
默认密码为pi | 默认密码为pi | ||
===更新软件包=== | ===更新软件包=== | ||
====更换软件源为国内镜像源==== | ====更换软件源为国内镜像源==== | ||
+ | 编辑/etc/apt/sources.list替换成以下内容: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | 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-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 http://mirrors.163.com/debian-security/ buster/updates main non-free contrib | ||
+ | deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib | ||
</syntaxhighlight> | </syntaxhighlight> | ||
====更新软件包列表==== | ====更新软件包列表==== | ||
Line 30: | Line 30: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===安装x11vnc远程桌面=== | ===安装x11vnc远程桌面=== | ||
− | x11vnc是一个VNC服务器, 安装后我们可以不依赖外部的显示设备, | + | x11vnc是一个VNC服务器, 安装后我们可以不依赖外部的显示设备, 通过网络远程登录Debian桌面。 |
====安装x11vnc==== | ====安装x11vnc==== | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
Line 73: | Line 73: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
sudo dpkg -i /opt/linux-headers-*.deb | sudo dpkg -i /opt/linux-headers-*.deb | ||
+ | </syntaxhighlight> | ||
+ | 测试编译内核模块: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | sudo apt update | ||
+ | sudo apt install git gcc make bc | ||
+ | git clone https://github.com/RinCat/RTL88x2BU-Linux-Driver.git | ||
+ | cd RTL88x2BU-Linux-Driver | ||
+ | make -j$(nproc) | ||
+ | sudo make install | ||
+ | sudo modprobe 88x2bu | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 100: | Line 110: | ||
| NanoPi-R2S | | NanoPi-R2S | ||
| NanoPi-R2C-Plus | | NanoPi-R2C-Plus | ||
+ | | NanoPi-R2S-Plus | ||
| NanoPi-R2C = | | NanoPi-R2C = | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | git clone https://github.com/friendlyarm/sd-fuse_rk3328.git -b kernel-4.19 | + | git clone https://github.com/friendlyarm/sd-fuse_rk3328.git -b kernel-4.19 --single-branch |
cd sd-fuse_rk3328 | cd sd-fuse_rk3328 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | | NanoPi-R5C | ||
| NanoPi-R5S = | | NanoPi-R5S = | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | git clone https://github.com/friendlyarm/sd-fuse_rk3568.git -b | + | 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> | ||
+ | | NanoPi-R6C | ||
+ | | NanoPC-T6 | ||
| NanoPi-R6S = | | NanoPi-R6S = | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | git clone https://github.com/friendlyarm/sd-fuse_rk3588.git -b | + | 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> | ||
| #default = | | #default = | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | git clone https://github.com/friendlyarm/sd-fuse_rk3399.git -b kernel-4.19 | + | git clone https://github.com/friendlyarm/sd-fuse_rk3399.git -b kernel-4.19 --single-branch |
cd sd-fuse_rk3399 | cd sd-fuse_rk3399 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 125: | Line 140: | ||
convert files/logo.jpg -type truecolor /tmp/logo_kernel.bmp | convert files/logo.jpg -type truecolor /tmp/logo_kernel.bmp | ||
LOGO=/tmp/logo.bmp KERNEL_LOGO=/tmp/logo_kernel.bmp ./build-kernel.sh debian-buster-desktop-arm64 | LOGO=/tmp/logo.bmp KERNEL_LOGO=/tmp/logo_kernel.bmp ./build-kernel.sh debian-buster-desktop-arm64 | ||
+ | sudo ./mk-sd-image.sh debian-buster-desktop-arm64 | ||
./mk-emmc-image.sh debian-buster-desktop-arm64 | ./mk-emmc-image.sh debian-buster-desktop-arm64 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | 注: 如果你的系统不是debian-buster-desktop-arm64,请根据实际情况指定 | ||
====更换桌面墙纸==== | ====更换桌面墙纸==== | ||
修改如下配置文件: | 修改如下配置文件: | ||
Line 187: | Line 204: | ||
下载得到deb包后, 使用 dpkg 命令安装软件包即可: <br /> | 下载得到deb包后, 使用 dpkg 命令安装软件包即可: <br /> | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | sudo dpkg -i plexmediaserver_1. | + | sudo dpkg -i plexmediaserver_1.31.0.6654-02189b09f_arm64.deb |
</syntaxhighlight> | </syntaxhighlight> | ||
安装完成后, 在电脑浏览器上输入以下地址登录Plex服务器后台: http://IP地址:32400/web/ <br/> | 安装完成后, 在电脑浏览器上输入以下地址登录Plex服务器后台: http://IP地址:32400/web/ <br/> | ||
− | + | ===在Debian系统上安装Docker=== | |
− | === | + | 请参考此链接: [[How to Install Docker on Debian/zh]] |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + |
Latest revision as of 10:53, 4 December 2023
Contents
1 帐户与密码
普通用户:
用户名: pi
密码: pi
Root用户:
默认没有设置root密码,可通过sudo passwd root命令配置root密码
2 查看IP地址
由于Debian主机名默认为硬件型号, 所以可以使用ping命令来获得IP地址: ping {{{1}}}
3 通过ssh登录Debian
使用以下命令:ssh pi@{{{1}}}
默认密码为pi
4 更新软件包
4.1 更换软件源为国内镜像源
编辑/etc/apt/sources.list替换成以下内容:
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-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 http://mirrors.163.com/debian-security/ buster/updates main non-free contrib deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib
4.2 更新软件包列表
$ sudo apt-get update
5 安装x11vnc远程桌面
x11vnc是一个VNC服务器, 安装后我们可以不依赖外部的显示设备, 通过网络远程登录Debian桌面。
5.1 安装x11vnc
sudo apt-get install x11vnc
5.2 设置VNC登录密码
sudo x11vnc -storepasswd /etc/x11vnc.pwd
5.3 设置x11vnc在开机时自动启动
新建如下文件:
sudo vi /lib/systemd/system/x11vnc.service
内容如下:
[Unit] Description=Start x11vnc at startup. Requires=display-manager.service After=syslog.target network-online.target Wants=syslog.target network-online.target [Service] Type=simple ExecStart=/usr/bin/x11vnc -display :0 -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pwd -rfbport 5900 -shared -capslock -nomodtweak ExecStop=/usr/bin/x11vnc -R stop Restart=on-failure [Install] WantedBy=multi-user.target
设置systemd服务:
sudo systemctl daemon-reload sudo systemctl enable x11vnc.service sudo systemctl start x11vnc
5.4 测试远程桌面
在电脑上启动VNC客户端软件, 在地址栏输入: IP地址:5900 连接即可, 效果如下图所示, 图中设备IP地址为192.168.1.123, 使用端口5900进行连接:
6 安装内核头文件
sudo dpkg -i /opt/linux-headers-*.deb
测试编译内核模块:
sudo apt update sudo apt install git gcc make bc git clone https://github.com/RinCat/RTL88x2BU-Linux-Driver.git cd RTL88x2BU-Linux-Driver make -j$(nproc) sudo make install sudo modprobe 88x2bu
7 更改时区
7.1 检查当前时区
timedatectl
7.2 列出所有时区
timedatectl list-timezones
7.3 设置时区 (比如上海)
sudo timedatectl set-timezone Asia/Shanghai
8 更换开机LOGO和桌面墙纸
8.1 更换开机LOGO
替换内核下面的两个文件,重新编译内核:
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 LOGO=/tmp/logo.bmp KERNEL_LOGO=/tmp/logo_kernel.bmp ./build-kernel.sh debian-buster-desktop-arm64 sudo ./mk-sd-image.sh debian-buster-desktop-arm64 ./mk-emmc-image.sh debian-buster-desktop-arm64
注: 如果你的系统不是debian-buster-desktop-arm64,请根据实际情况指定
8.2 更换桌面墙纸
修改如下配置文件:
/home/pi/.config/pcmanfm/LXDE/desktop-items-0.conf
8.3 恢复出厂设置
在终端上执行如下命令:
sudo firstboot && sudo reboot
9 开机自动启动程序(例如Kodi)
把要开机启动的程序的desktop文件放入~/.config/autostart/目录即可,例如:
mkdir ~/.config/autostart/ cp /usr/share/applications/kodi.desktop ~/.config/autostart/
10 取消USB存储设备自动挂载
sudo systemctl mask udisks2 sudo reboot
11 设置中文语言与输入法
11.1 设置中文语言
输入以下命令,用空格选中 'zh_CN.UTF-8'
sudo dpkg-reconfigure locales
添加环境变量到 .bashrc:
echo "export LC_ALL=zh_CN.UTF-8" >> ~/.bashrc echo "export LANG=zh_CN.UTF-8" >> ~/.bashrc echo "export LANGUAGE=zh_CN.UTF-8" >> ~/.bashrc
重启确认一下设置是否生效:
sudo reboot
11.2 安装中文输入法
输入如下命令安装fcitx和拼音输入法:
sudo apt update sudo apt-get install fcitx fcitx-pinyin sudo apt-get install im-config sudo apt-get install fcitx-table* sudo apt-get install fcitx-ui-classic fcitx-ui-light sudo apt-get install fcitx-frontend-gtk2 fcitx-frontend-gtk3 fcitx-frontend-qt4 sudo apt-get remove --purge scim* ibus* sudo reboot
重启后, 按Ctrl+Space即可切换中英文输入法, 右上角也出现了输入法图标, 右击右上角的输入法图标, 在弹出菜单中可以切换输入法, 如下图所示:
12 安装Plex多媒体服务器
访问 Plex官网的如下地址: https://www.plex.tv/media-server-downloads/
在下载页面上, 选择 ”Plex Media Server” 分类, 平台选择 ”Linux“, 版本选择 "Ubuntu(16.04+)/Debian(8+) - ARMv8",
下载得到deb包后, 使用 dpkg 命令安装软件包即可:
sudo dpkg -i plexmediaserver_1.31.0.6654-02189b09f_arm64.deb
安装完成后, 在电脑浏览器上输入以下地址登录Plex服务器后台: http://IP地址:32400/web/