Difference between revisions of "Template:UbuntuJammyDesktop-Common/zh"
From FriendlyELEC WiKi
(updated by API) |
(updated by API) |
||
(7 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
<br/> | <br/> | ||
Root用户:<br/> | Root用户:<br/> | ||
− | | + | 用户名: root<br/> |
+ | 密码: fa<br/> | ||
===查看IP地址=== | ===查看IP地址=== | ||
由于主机名默认为FriendlyElec.lan, 所以可以使用ping命令来获得IP地址: | 由于主机名默认为FriendlyElec.lan, 所以可以使用ping命令来获得IP地址: | ||
Line 35: | Line 36: | ||
<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 60: | Line 71: | ||
| NanoPi-R2S | | NanoPi-R2S | ||
| NanoPi-R2C-Plus | | NanoPi-R2C-Plus | ||
+ | | NanoPi-R2S-Plus | ||
| NanoPi-R2C = | | NanoPi-R2C = | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
Line 65: | Line 77: | ||
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 |
cd sd-fuse_rk3568 | cd sd-fuse_rk3568 | ||
</syntaxhighlight> | </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 |
cd sd-fuse_rk3588 | cd sd-fuse_rk3588 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 124: | Line 139: | ||
* 在文件浏览器定位到视频文件,右击选择使用"Play with mpv media player"播放视频 | * 在文件浏览器定位到视频文件,右击选择使用"Play with mpv media player"播放视频 | ||
* 通过Kodi播放, 默认会调用mpv进行硬解播放 | * 通过Kodi播放, 默认会调用mpv进行硬解播放 | ||
+ | * 使用Chromium网页浏览器, 可以硬解播放网页上视频 (限CPU能支持的视频格式) | ||
====命令行播放==== | ====命令行播放==== | ||
* 播放本地视频 | * 播放本地视频 |
Latest revision as of 06:11, 19 January 2024
Contents
1 Account & Password
2 帐户与密码
普通用户:
用户名: pi
密码: pi
Root用户:
用户名: root
密码: fa
3 查看IP地址
由于主机名默认为FriendlyElec.lan, 所以可以使用ping命令来获得IP地址:
ping FriendlyElec.lan
4 通过ssh登录Ubuntu
ssh pi@FriendlyElec.lan
默认密码为pi
5 更新软件包
5.1 更换软件源为国内镜像源
$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.org $ sudo sed -i -e 's/ports.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
5.2 更新软件包列表
$ sudo apt-get update
6 安装软件中心
$ sudo apt-get install snapd $ sudo snap install snap-store
7 安装内核头文件
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
8 更改时区
8.1 检查当前时区
timedatectl
8.2 列出所有时区
timedatectl list-timezones
8.3 设置时区 (比如上海)
sudo timedatectl set-timezone Asia/Shanghai
9 更换开机LOGO和桌面墙纸
9.1 更换开机LOGO
替换内核下面的两个文件,重新编译内核:
kernel/logo.bmp
kernel/logo_kernel.bmp
或者使用脚本来操作,如下所示:
- 下载脚本
git clone https://github.com/friendlyarm/sd-fuse_rk3399.git -b kernel-4.19 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 ubuntu-jammy-desktop-arm64 ./mk-emmc-image.sh ubuntu-jammy-desktop-arm64
9.2 恢复出厂设置
在终端上执行如下命令:
sudo firstboot && sudo reboot
10 开机自动启动程序(例如Firefox)
把要开机启动的程序的desktop文件放入~/.config/autostart/目录即可,例如:
mkdir ~/.config/autostart/ cp /usr/share/applications/firefox.desktop ~/.config/autostart/
11 取消USB存储设备自动挂载
sudo systemctl mask udisks2 sudo reboot
12 设置中文语言与输入法
12.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
13 硬解播放视频
13.1 界面播放
- 在文件浏览器定位到视频文件,右击选择使用"Play with mpv media player"播放视频
- 通过Kodi播放, 默认会调用mpv进行硬解播放
- 使用Chromium网页浏览器, 可以硬解播放网页上视频 (限CPU能支持的视频格式)
13.2 命令行播放
- 播放本地视频
export DISPLAY=:0.0 mpv --fs /home/pi/Videos/demo.mp4
- 播放网络视频
export DISPLAY=:0.0 mpv --fs https://www.youtube.com/watch?v=lK-nYDmC1Dk
14 安装Plex多媒体服务器
运行以下命令安装:
echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add - sudo apt update sudo apt install plexmediaserver
成功安装后,启用 Plex(系统启动时自动启动):
sudo systemctl enable plexmediaserver sudo systemctl start plexmediaserver sudo systemctl status plexmediaserver
安装完成后, 在电脑浏览器上输入以下地址登录Plex服务器后台: http://IP地址:32400/web/
15 安装Docker
15.1 安装docker
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt update sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
验证是否安装成功:
sudo docker info
15.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
15.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网盘页面。