玩客云折腾问题总结

本文记录以下折腾玩客云(armv7hf_linux)遇到的大大小小的问题,因为单列不够篇幅,所以都在这里进行汇总

LXde桌面环境找不到垃圾桶

1
2
#垃圾桶应该在如下位置
~/.local/share/Trash 或~/.local/share/Trash/files

感谢

image-20220407205859469

Linux新建和增加swap分区

方式一:新建磁盘分区作为swap分区

1
2
3
4
5
6
7
8
9
10
11
1.以root身份进入控制台(登录系统),输入
swapoff -a #停止所有的swap分区

2. 用fdisk命令(例:# fdisk /dev/sdb)对磁盘进行分区,添加swap分区,新建分区,在fdisk中用“t”命令将新添的分区id改为82(Linux swap类型),最后用w将操作实际写入硬盘(没用w之前的操作是无效的)。

3. mkswap /dev/sdb2 #格式化swap分区,这里的sdb2要看您加完后p命令显示的实际分区设备名

4. # swapon /dev/sdb2 #启动新的swap分区

5. 为了让系统启动时能自动启用这个交换分区,可以编辑/etc/fstab,加入下面一行
/dev/sdb2 swap swap defaults 0 0

方式二:用文件作为swap分区

1
2
3
4
5
6
7
8
9
10
11
1.创建要作为swap分区的文件:增加1GB大小的交换分区,则命令写法如下,其中的count等于想要的块的数量(bs*count=文件大小)。
# dd if=/dev/zero of=/root/swapfile bs=1M count=1024

2.格式化为交换分区文件:
# mkswap /root/swapfile #建立swap的文件系统

3.启用交换分区文件:
# swapon /root/swapfile #启用swap文件

4.使系统开机时自启用,在文件/etc/fstab中添加一行:
/root/swapfile swap swap defaults 0 0

新建和增加交换分区用到的命令为:mkswap、swapon等,而想关闭掉某个交换分区则用“swapon /dev/sdb2”这样的命令即可。

VNC环境安装及开机自启(tightvncserver)

一、安装

ssh连接之后,命令行输入

1
sudo apt-get install tightvncserver

安装好之后请一定先使用此命令设置一个VNC密码:

1
vncpasswd

(先输入操作密码两次,然后会询问是否设置一个查看(view-only)密码,按自己喜欢,一般没必要。)

设置开机启动

设置开机启动,需要在/etc/init.d/中创建一个文件。例如tightvncserver:
(注:启动脚本的名称,有和程序名一致的习惯)

1
sudo vi /etc/init.d/tightvncserver

内容如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
### BEGIN INIT INFO
# Provides: tightvncserver
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop tightvncserver
### END INIT INFO

# More details see:
# http://www.penguintutor.com/linux/tightvnc

### Customize this entry
# Set the USER variable to the name of the user to start tightvncserver under
export USER='root'
### End customization required

eval cd ~$USER

case "$1" in
start)
# 启动命令行。此处自定义分辨率、控制台号码或其它参数。
su $USER -c '/usr/bin/tightvncserver -depth 16 -geometry 800x600 :1'
echo "Starting TightVNC server for $USER "
;;
stop)
# 终止命令行。此处控制台号码与启动一致。
su $USER -c '/usr/bin/tightvncserver -kill :1'
echo "Tightvncserver stopped"
;;
*)
echo "Usage: /etc/init.d/tightvncserver {start|stop}"
exit 1
;;
esac
exit 0

(注:USER变量的值为默认用户名,这里是root。)

然后给 tightvncserver 文件加执行权限:

1
sudo chmod 755 /etc/init.d/tightvncserver

并更新开机启动列表:

1
sudo update-rc.d tightvncserver defaults

重启玩客云:

1
sudo reboot

手动启动

当然也可以手动启动VNC服务器程序,使用以下命令:

1
tightvncserver -geometry 800x600 :1

如果首次启动,并且未曾使用vncpasswd命令设置密码,程序会要求设置密码。开机启动很方便,所以还是推荐开机启动。

命令参数说明:

一、指定控制台的号码。

启动多个控制台,可以提供互不影响的多个桌面环境。如果不加此参数,tightvncserver会自动寻找从1开始的下一个空闲控制台。加上此参数,会强制使用指定的控制台,如果此控制台已经启动则报错。加此参数可有效防止无意多次启动程序(会启动多个控制台)白白浪费系统资源。

特殊的0号控制台——0号控制台就是连接真实显示器真正输出图像的那个桌面。对于VNC客户端,不输入端口号登录,默认就登录到0号控制台,方便。但是因为0号是真正的桌面,所以和开机启动桌面环境存在冲突。因此自动启动的配置教程中,使用1号控制台。

二、-geometry 800×600,分辨率。可以不加。

终止VNC控制台:

1
tightvncserver -kill :1

VNC客服端登录

下载VNC-Viewer:http://www.realvnc.com/download/viewer/

登录地址输入“IP地址 : 控制台号码”,0号控制台可不加号码。

image-20220407210849278

Armbian更新出错,提示“the following signatures couldn’t be verified because the public key is not available”

原报错日志找不到已经,此处从网上摘录,关注重点为”公共密钥无法验证(public key….)“

感谢春泥酱

运行apt-get update时出现“the following signatures couldn’t be verified because the public key is not available”

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
lbl@orangepi4:~$ sudo apt-get update
Ign:1 https://mirrors.tuna.tsinghua.edu.cn/debian stretch InRelease
Get:2 https://mirrors.tuna.tsinghua.edu.cn/debian stretch-updates InRelease [91.0 kB]
Get:3 https://mirrors.tuna.tsinghua.edu.cn/debian stretch-backports InRelease [91.8 kB]
Err:2 https://mirrors.tuna.tsinghua.edu.cn/debian stretch-updates InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7638D0442B90D010 NO_PUBKEY 04EE7237B7D453EC
Err:3 https://mirrors.tuna.tsinghua.edu.cn/debian stretch-backports InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7638D0442B90D010 NO_PUBKEY 04EE7237B7D453EC
Get:5 https://mirrors.tuna.tsinghua.edu.cn/debian-security stretch/updates InRelease [94.3 kB]
Err:5 https://mirrors.tuna.tsinghua.edu.cn/debian-security stretch/updates InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9D6D8F6BC857C906 NO_PUBKEY AA8E81B4331F7F50
Get:6 https://mirrors.tuna.tsinghua.edu.cn/debian stretch Release [118 kB]
Get:7 https://mirrors.tuna.tsinghua.edu.cn/debian stretch Release.gpg [2,410 B]
Ign:7 https://mirrors.tuna.tsinghua.edu.cn/debian stretch Release.gpg
Hit:4 https://apt.armbian.com bionic InRelease
Reading package lists... Done
W: GPG error: https://mirrors.tuna.tsinghua.edu.cn/debian stretch-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7638D0442B90D010 NO_PUBKEY 04EE7237B7D453EC
E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/debian stretch-updates InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: https://mirrors.tuna.tsinghua.edu.cn/debian stretch-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7638D0442B90D010 NO_PUBKEY 04EE7237B7D453EC
E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/debian stretch-backports InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: https://mirrors.tuna.tsinghua.edu.cn/debian-security stretch/updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9D6D8F6BC857C906 NO_PUBKEY AA8E81B4331F7F50
E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/debian-security stretch/updates InRelease' is not signed.
lbl@orangepi4:~$

原因:

这个问题在使用apt-get update就会出现,Ubuntu 环境下,也会出现这个情况,出现这个问题的原因是:apt打包系统具有一组受信任的密钥,这些密钥确定软件包是否可以通过身份验证并因此受信任以安装在系统上。但是有时候系统并没有所需的所有密钥,因此会遇到此问题。

如果不解决这个问题,那么在使用sudo apt-get upgrade时就会遇到错误而无法更新。

解决办法:

只需要将出现NO_PUBLIC添加进到系统即可,将最后出现的一串KEY 通过以下命令添加到系统中。如我上面最后出现的一串NO_PUBKEY 7638D0442B90D010 NO_PUBKEY 04EE7237B7D453EC NO_PUBKEY EF0F382A1A7B6500
这里共有3个,所以要添加三次,使用下面命令

1
2
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010
# 将最后更换为你自己日志所给出的即可

每个密钥只需要添加一次就可以,添加成功标志:

1
2
3
4
5
6
7
lbl@orangepi4:~$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010
Executing: /tmp/apt-key-gpghome.pDTXaMVLxm/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010
gpg: key 7638D0442B90D010: 14 signatures not checked due to missing keys
gpg: key 7638D0442B90D010: public key "Debian Archive Automatic Signing Key (8/jessie) <ftpmaster@debian.org>" imported
gpg: Total number processed: 1
gpg: imported: 1

至此,密钥已经添加成功,试试

1
2
sudo apt-get update
sudo apt-get upgrade