Difference between revisions of "Template:DebianBusterDesktop-Common"
(updated by API) |
(updated by API) |
||
Line 5: | Line 5: | ||
Root: | Root: | ||
− | + | the root user account is disabled by default, you may configure the root password through the 'sudo passwd root' command. | |
− | + | ||
− | === | + | ===View IP address=== |
− | + | Since the Debian Buster hostname is FriendlyElec.lan by default, you can use the ping command to get the IP address: | |
+ | <syntaxhighlight lang="bash"> | ||
+ | ping FriendlyElec.lan | ||
+ | </syntaxhighlight> | ||
− | === | + | ===Connect to Debian via SSH=== |
− | + | ||
− | + | ||
− | + | ||
− | === | + | |
− | + | ||
− | + | ||
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | ssh pi@FriendlyElec.lan | |
</syntaxhighlight> | </syntaxhighlight> | ||
+ | The default password is: pi | ||
− | === | + | ===Update Software Packages=== |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | $ sudo apt-get update | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | ==== | + | |
− | + | ===Install the kernel-header package=== | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | sudo dpkg -i /opt/linux-headers-*.deb | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | ==== | + | |
− | + | ===Change time zone=== | |
+ | ====Check the current time zone==== | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | timedatectl | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | ==== | + | ====List all available time zones==== |
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | timedatectl list-timezones | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ====Set the time zone (e.g. Shanghai)==== | |
− | === | + | |
− | + | ||
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | sudo | + | sudo timedatectl set-timezone Asia/Shanghai |
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | + | ===Change startup LOGO and Wallpaper=== | |
− | + | ====Change startup LOGO==== | |
− | === | + | Replace the following two files in the kernel source code directory and recompile the kernel:<br/> |
− | + | kernel/logo.bmp<br/> | |
+ | kernel/logo_kernel.bmp<br/> | ||
+ | Or use the script to operate, as shown below: | ||
+ | * Download scripts: | ||
+ | {{#switch: {{{1}}} | ||
+ | | NanoPi-NEO3 | ||
+ | | NanoPi-R2S | ||
+ | | NanoPi-R2C-Plus | ||
+ | | NanoPi-R2C = | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | git clone https://github.com/friendlyarm/sd-fuse_rk3328.git -b kernel-4.19 | |
+ | cd sd-fuse_rk3328 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | | NanoPi-R5S = | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | git clone https://github.com/friendlyarm/sd-fuse_rk3568.git -b master | |
+ | cd sd-fuse_rk3568 | ||
+ | | NanoPi-R6S = | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | git clone https://github.com/friendlyarm/sd-fuse_rk3588.git -b master | ||
+ | cd sd-fuse_rk3588 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | | #default = | |
− | + | ||
− | = | + | |
− | + | ||
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | git clone https://github.com/ | + | git clone https://github.com/friendlyarm/sd-fuse_rk3399.git -b kernel-4.19 |
− | cd | + | cd sd-fuse_rk3399 |
− | + | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | }} | |
+ | * Compile kernel and repackage firmware | ||
<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 eflasher | ||
+ | LOGO=/tmp/logo.bmp KERNEL_LOGO=/tmp/logo_kernel.bmp ./build-kernel.sh debian-buster-desktop-arm64 | ||
+ | ./mk-emmc-image.sh debian-buster-desktop-arm64 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ====Change Wallpaper==== | |
+ | Modify the following configuration file: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | /home/pi/.config/pcmanfm/LXDE/desktop-items-0.conf | |
− | + | ||
− | + | ||
− | + | ||
− | - | + | |
− | - | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ||
+ | ===Soft Factory Reset=== | ||
+ | Execute the following command in a terminal: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | sudo firstboot && sudo reboot | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ||
+ | ===Start the program automatically at startup(For example Kodi)=== | ||
+ | Put the desktop file in the ~/.config/autostart/ directory, for example: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | mkdir ~/.config/autostart/ | |
− | + | cp /usr/share/applications/kodi.desktop ~/.config/autostart/ | |
− | + | ||
− | + | ||
− | + | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | === | + | ===Disable auto-mounting=== |
− | + | ||
− | + | ||
− | + | ||
− | === | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | sudo systemctl mask udisks2 | |
+ | sudo reboot | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | === | + | ===Setup Chinese language and Input method=== |
− | + | ====Setup Chinese language==== | |
− | + | Enter the following command and select 'zh_CN.UTF-8': | |
− | + | ||
− | === | + | |
− | + | ||
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | sudo dpkg-reconfigure locales | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | Add environment variables to .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> | ||
− | + | Reboot device: | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | sudo reboot | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | ==== | + | ====Installing Chinese input method==== |
− | + | Enter the following command to install fcitx and Pinyin input method: | |
<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 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | After reboot, press Ctrl+Space to switch between Chinese and English input methods, and the input method icon will appear in the upper right corner, right-click the input method icon in the upper right corner to switch input methods in the pop-up menu, as shown below:<br /> | |
+ | [[File:Debian10-chinese-im.png|frameless|480px]]<br /> | ||
+ | |||
+ | ===Install x11vnc Server on Debian for Remote Access=== | ||
+ | ====Install x11vnc server==== | ||
+ | The following command to install x11vnc server: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | sudo apt-get install x11vnc | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | ====Set | + | ====Set your password==== |
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | sudo x11vnc -storepasswd /etc/x11vnc.pwd | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | ==== | + | ====Setup x11vnc server with systemd auto start up==== |
+ | Create service configuration file: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | sudo vi /lib/systemd/system/x11vnc.service | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | Let’s copy and paste the following configuration into our newly create service file: | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
<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> | ||
− | + | The following commands to reload the systmd system and to enable and start the x11vnc service: | |
− | + | ||
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | sudo | + | sudo systemctl daemon-reload |
+ | sudo systemctl enable x11vnc.service | ||
+ | sudo systemctl start x11vnc | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | ====Testing remote access==== | ||
+ | Start the VNC client software, input IP:5900 to connect:<br /> | ||
+ | [[File:Debian10-x11vnc.png|frameless|480px]]<br /> | ||
− | === | + | ===Install Docker Engine on Debian=== |
− | + | The docker installer uses iptables for nat, unfortunately Debian uses nftables, here we just setup Debian to use the legacy iptables: | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | sudo update-alternatives --set iptables /usr/sbin/iptables-legacy | |
+ | sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ====Install Docker Engine==== | |
− | === | + | |
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | curl -fsSL https://get.docker.com | bash | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | Let’s verify: | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | sudo docker info | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | Run | + | ====Run Docker as a non-root user==== |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | sudo | + | sudo groupadd docker |
+ | sudo gpasswd -a ${USER} docker | ||
+ | sudo systemctl restart docker | ||
+ | sudo chmod a+rw /var/run/docker.sock | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | Let’s verify: | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | docker images | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ====Testing Docker: Installing Nextcloud with docker==== | |
<syntaxhighlight lang="bash"> | <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> | </syntaxhighlight> | ||
+ | After installation, visit: http://Device-IP-Address:8888 on your computer browser to view the nextcloud web page. |
Revision as of 06:37, 7 September 2022
Contents
- 1 Account & Password
- 2 View IP address
- 3 Connect to Debian via SSH
- 4 Update Software Packages
- 5 Install the kernel-header package
- 6 Change time zone
- 7 Change startup LOGO and Wallpaper
- 8 Soft Factory Reset
- 9 Start the program automatically at startup(For example Kodi)
- 10 Disable auto-mounting
- 11 Setup Chinese language and Input method
- 12 Install x11vnc Server on Debian for Remote Access
- 13 Install Docker Engine on Debian
1 Account & Password
Regular Account:
User Name: pi Password: pi
Root:
the root user account is disabled by default, you may configure the root password through the 'sudo passwd root' command.
2 View IP address
Since the Debian Buster hostname is FriendlyElec.lan by default, you can use the ping command to get the IP address:
ping FriendlyElec.lan
3 Connect to Debian via SSH
ssh pi@FriendlyElec.lan
The default password is: pi
4 Update Software Packages
$ sudo apt-get update
5 Install the kernel-header package
sudo dpkg -i /opt/linux-headers-*.deb
6 Change time zone
6.1 Check the current time zone
timedatectl
6.2 List all available time zones
timedatectl list-timezones
6.3 Set the time zone (e.g. Shanghai)
sudo timedatectl set-timezone Asia/Shanghai
7 Change startup LOGO and Wallpaper
7.1 Change startup LOGO
Replace the following two files in the kernel source code directory and recompile the kernel:
kernel/logo.bmp
kernel/logo_kernel.bmp
Or use the script to operate, as shown below:
- Download scripts:
git clone https://github.com/friendlyarm/sd-fuse_rk3399.git -b kernel-4.19 cd sd-fuse_rk3399
- Compile kernel and repackage firmware
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 eflasher LOGO=/tmp/logo.bmp KERNEL_LOGO=/tmp/logo_kernel.bmp ./build-kernel.sh debian-buster-desktop-arm64 ./mk-emmc-image.sh debian-buster-desktop-arm64
7.2 Change Wallpaper
Modify the following configuration file:
/home/pi/.config/pcmanfm/LXDE/desktop-items-0.conf
8 Soft Factory Reset
Execute the following command in a terminal:
sudo firstboot && sudo reboot
9 Start the program automatically at startup(For example Kodi)
Put the desktop file in the ~/.config/autostart/ directory, for example:
mkdir ~/.config/autostart/ cp /usr/share/applications/kodi.desktop ~/.config/autostart/
10 Disable auto-mounting
sudo systemctl mask udisks2 sudo reboot
11 Setup Chinese language and Input method
11.1 Setup Chinese language
Enter the following command and select 'zh_CN.UTF-8':
sudo dpkg-reconfigure locales
Add environment variables to .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
Reboot device:
sudo reboot
11.2 Installing Chinese input method
Enter the following command to install fcitx and Pinyin input method:
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
After reboot, press Ctrl+Space to switch between Chinese and English input methods, and the input method icon will appear in the upper right corner, right-click the input method icon in the upper right corner to switch input methods in the pop-up menu, as shown below:
12 Install x11vnc Server on Debian for Remote Access
12.1 Install x11vnc server
The following command to install x11vnc server:
sudo apt-get install x11vnc
12.2 Set your password
sudo x11vnc -storepasswd /etc/x11vnc.pwd
12.3 Setup x11vnc server with systemd auto start up
Create service configuration file:
sudo vi /lib/systemd/system/x11vnc.service
Let’s copy and paste the following configuration into our newly create service file:
[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
The following commands to reload the systmd system and to enable and start the x11vnc service:
sudo systemctl daemon-reload sudo systemctl enable x11vnc.service sudo systemctl start x11vnc
12.4 Testing remote access
Start the VNC client software, input IP:5900 to connect:
13 Install Docker Engine on Debian
The docker installer uses iptables for nat, unfortunately Debian uses nftables, here we just setup Debian to use the legacy iptables:
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
13.1 Install Docker Engine
curl -fsSL https://get.docker.com | bash
Let’s verify:
sudo docker info
13.2 Run Docker as a non-root user
sudo groupadd docker sudo gpasswd -a ${USER} docker sudo systemctl restart docker sudo chmod a+rw /var/run/docker.sock
Let’s verify:
docker images
13.3 Testing Docker: Installing Nextcloud with docker
mkdir ~/nextcloud -p docker run -d -p 8888:80 --name nextcloud -v ~/nextcloud/:/var/www/html/ --restart=always --privileged=true arm64v8/nextcloud
After installation, visit: http://Device-IP-Address:8888 on your computer browser to view the nextcloud web page.