Difference between revisions of "Template:DebianBusterDesktop-Common/zh"
(updated by API) |
(updated by API) |
||
(15 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
===帐户与密码=== | ===帐户与密码=== | ||
− | 普通用户: | + | 普通用户:<br/> |
− | + | 用户名: pi<br/> | |
− | + | 密码: pi<br/> | |
+ | <br/> | ||
+ | Root用户:<br/> | ||
+ | 默认没有设置root密码,可通过sudo passwd root命令配置root密码 | ||
+ | ===查看IP地址=== | ||
+ | 由于Debian主机名默认为硬件型号, 所以可以使用ping命令来获得IP地址: <code>ping {{{1}}}</code><br/> | ||
+ | ===通过ssh登录Debian=== | ||
+ | 使用以下命令:<code>ssh pi@{{{1}}}</code><br/> | ||
+ | 默认密码为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> | ||
− | + | ====更新软件包列表==== | |
− | ==== | + | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | $ sudo apt-get update | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ===安装x11vnc远程桌面=== | |
+ | x11vnc是一个VNC服务器, 安装后我们可以不依赖外部的显示设备, 通过网络远程登录Debian桌面。 | ||
+ | ====安装x11vnc==== | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | sudo apt-get install x11vnc | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | ==== | + | ====设置VNC登录密码==== |
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | sudo x11vnc -storepasswd /etc/x11vnc.pwd | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | ==== | + | ====设置x11vnc在开机时自动启动==== |
− | + | 新建如下文件: | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | sudo vi /lib/systemd/system/x11vnc.service | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | 内容如下: | |
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | [ | + | [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 | |
− | = | + | |
− | + | ||
− | + | ||
− | + | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | 设置systemd服务: | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | sudo systemctl daemon-reload | |
+ | sudo systemctl enable x11vnc.service | ||
+ | sudo systemctl start x11vnc | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ====测试远程桌面==== | |
− | + | 在电脑上启动VNC客户端软件, 在地址栏输入: IP地址:5900 连接即可, 效果如下图所示, 图中设备IP地址为192.168.1.123, 使用端口5900进行连接:<br /> | |
− | === | + | [[File:Debian10-x11vnc.png|frameless|480px]] |
− | + | ===安装内核头文件=== | |
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | sudo dpkg -i /opt/linux-headers-*.deb | |
− | + | ||
− | + | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | 测试编译内核模块: | |
<syntaxhighlight lang="bash"> | <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> | ||
− | + | ||
+ | ===更改时区=== | ||
+ | ====检查当前时区==== | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | timedatectl | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ====列出所有时区==== | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | timedatectl list-timezones | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ====设置时区 (比如上海)==== | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | sudo timedatectl set-timezone Asia/Shanghai | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | === | + | ===更换开机LOGO和桌面墙纸=== |
− | + | ====更换开机LOGO==== | |
− | + | 替换内核下面的两个文件,重新编译内核:<br/> | |
− | + | kernel/logo.bmp<br/> | |
− | === | + | kernel/logo_kernel.bmp<br/> |
− | + | 或者使用脚本来操作,如下所示:<br/> | |
− | + | * 下载脚本 | |
− | + | {{#switch: {{{1}}} | |
− | + | | NanoPi-NEO3 | |
− | + | | NanoPi-R2S | |
− | + | | NanoPi-R2C-Plus | |
− | + | | NanoPi-R2S-Plus | |
+ | | NanoPi-R2C = | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | ./ | + | git clone https://github.com/friendlyarm/sd-fuse_rk3328.git -b kernel-4.19 --single-branch |
+ | cd sd-fuse_rk3328 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | | NanoPi-R5C | |
− | + | | NanoPi-R5S = | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | = | + | |
− | + | ||
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | git clone https://github.com/friendlyarm/sd-fuse_rk3568.git -b kernel-6.1.y --single-branch | |
+ | cd sd-fuse_rk3568 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | | NanoPi-R6C | |
+ | | NanoPC-T6 | ||
+ | | NanoPi-R6S = | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | git clone https://github.com/friendlyarm/sd-fuse_rk3588.git -b kernel-6.1.y --single-branch | |
+ | cd sd-fuse_rk3588 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | | #default = | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | git clone https://github.com/friendlyarm/sd-fuse_rk3399.git -b kernel-4.19 --single-branch | |
+ | cd sd-fuse_rk3399 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | }} | |
− | + | * 编译内核并重新打包固件 | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | 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 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | 注: 如果你的系统不是debian-buster-desktop-arm64,请根据实际情况指定 | |
+ | ====更换桌面墙纸==== | ||
+ | 修改如下配置文件: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | /home/pi/.config/pcmanfm/LXDE/desktop-items-0.conf | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | === | + | ====恢复出厂设置==== |
− | + | 在终端上执行如下命令: | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | sudo firstboot && sudo reboot | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | === | + | ===开机自动启动程序(例如Kodi)=== |
− | + | 把要开机启动的程序的desktop文件放入~/.config/autostart/目录即可,例如: | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | mkdir ~/.config/autostart/ | |
+ | cp /usr/share/applications/kodi.desktop ~/.config/autostart/ | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | === | + | ===取消USB存储设备自动挂载=== |
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | sudo | + | sudo systemctl mask udisks2 |
+ | sudo reboot | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | === | + | ===设置中文语言与输入法=== |
− | + | ====设置中文语言==== | |
+ | 输入以下命令,用空格选中 'zh_CN.UTF-8' | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | sudo dpkg-reconfigure locales | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | 添加环境变量到 .bashrc: | |
− | + | ||
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | 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 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | 重启确认一下设置是否生效: | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | sudo reboot | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | sudo | + | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ====安装中文输入法==== | |
+ | 输入如下命令安装fcitx和拼音输入法: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
+ | 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 | sudo reboot | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | 重启后, 按Ctrl+Space即可切换中英文输入法, 右上角也出现了输入法图标, 右击右上角的输入法图标, 在弹出菜单中可以切换输入法, 如下图所示:<br /> | |
+ | [[File:Debian10-chinese-im.png|frameless|480px]] | ||
+ | ===安装Plex多媒体服务器=== | ||
+ | 访问 Plex官网的如下地址: https://www.plex.tv/media-server-downloads/<br /> | ||
+ | 在下载页面上, 选择 ”Plex Media Server” 分类, 平台选择 ”Linux“, 版本选择 "Ubuntu(16.04+)/Debian(8+) - ARMv8", <br /> | ||
+ | 下载得到deb包后, 使用 dpkg 命令安装软件包即可: <br /> | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | sudo | + | sudo dpkg -i plexmediaserver_1.31.0.6654-02189b09f_arm64.deb |
− | + | ||
− | + | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | < | + | 安装完成后, 在电脑浏览器上输入以下地址登录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/