Difference between revisions of "Template:UbuntuJammyDesktop-Common/zh"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
 
(updated by API)
Line 88: Line 88:
 
sudo firstboot && sudo reboot
 
sudo firstboot && sudo reboot
 
</syntaxhighlight>
 
</syntaxhighlight>
===开机自动启动程序(例如Kodi)===
+
===开机自动启动程序(例如Firefox)===
 
把要开机启动的程序的desktop文件放入~/.config/autostart/目录即可,例如:
 
把要开机启动的程序的desktop文件放入~/.config/autostart/目录即可,例如:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 115: Line 115:
 
sudo reboot
 
sudo reboot
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
===安装Plex多媒体服务器===
 +
运行以下命令安装:
 +
<syntaxhighlight lang="bash">
 +
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
 +
</syntaxhighlight>
 +
成功安装后,启用 Plex(系统启动时自动启动):
 +
<syntaxhighlight lang="bash">
 +
sudo systemctl enable plexmediaserver
 +
sudo systemctl start plexmediaserver
 +
sudo systemctl status plexmediaserver
 +
</syntaxhighlight>
 +
安装完成后, 在电脑浏览器上输入以下地址登录Plex服务器后台: http://IP地址:32400/web/ <br/>
 
===安装Docker===
 
===安装Docker===
 
====安装docker====
 
====安装docker====

Revision as of 09:32, 29 October 2022

1 Account & Password

2 帐户与密码

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

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

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 dpkg -i /opt/linux-headers-*.deb

7 更改时区

7.1 检查当前时区

timedatectl

7.2 列出所有时区

timedatectl list-timezones

7.3 设置时区 (比如上海)

sudo timedatectl set-timezone Asia/Shanghai

8 更换开机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

8.2 恢复出厂设置

在终端上执行如下命令:

sudo firstboot && sudo reboot

9 开机自动启动程序(例如Firefox)

把要开机启动的程序的desktop文件放入~/.config/autostart/目录即可,例如:

mkdir ~/.config/autostart/
cp /usr/share/applications/firefox.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

12 安装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/

13 安装Docker

13.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

13.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

13.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网盘页面。