ubuntu 20.04升级到22.04中遇到的问题(by quqi99)

作者:张华 发表于:2022-04-23
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明
( http://blog.csdn.net/quqi99 )

昨天通过’sudo do-release-upgrade -d -f DistUpgradeViewNonInteractive’将ubuntu 20.04升级到了ubuntu 22.04 (注:从LTS版本升级到LTS版本一般得等8月份第1个小版本出来才会正式将22.04标为LTS,在此之前应加-d参数).

autofs与sssd冲突的问题

升级之后,今天发现一个问题,autofs不好使了.通过下列命令调试时看到了sssd字眼.

sudo systemdctl stop autofs
sudo automount --debug -f

发现sssd无法启动,将sssd删除之后(apt purge sssd) autofs就恢复正常了.

nfsv4不work的问题

还有一个问题,在升级之后nfs4不work了(mount -t nfs -s -o nfsvers=4,rw,rsize=32768,wsize=32768 nas:/Public /nas),待查,先不得不降到nfs3

$ cat /etc/auto.direct
/nas    -fstype=nfs,nfsvers=3,rw,rsize=32768,wsize=32768     nas:/Public
$ cat /etc/auto.direct
/nas    -fstype=nfs,nfsvers=3,rw,rsize=32768,wsize=32768     nas:/Public

使用下列方法debug nfs(也可使用:rpcdebug -m nfs -s all), 并看到下列错误,似乎是kernel 5.15与nfsv4(nfs-common)不work - https://bugzilla.redhat.com/show_bug.cgi?id=1719903

# https://www.serverstack.com/blog/2012/11/21/debugging-nfs-file-access-on-server-and-client-side/index.html
sudo rpcdebug -m nfs -s proc
sudo tail -f /var/log/syslog
sudo mount -t nfs -o nfsvers=4 nas:/Public /mnt/tmp

Apr 24 09:07:13 t440p kernel: [84981.523081] nfs41_sequence_process: Error 0 free the slot 
Apr 24 09:07:13 t440p kernel: [84981.523102] nfs4_proc_get_locations: FSID 52706b7bf323e1f3:0 on "nas"
Apr 24 09:07:13 t440p kernel: [84981.523106] nfs4_proc_get_locations at 000000006bf14052 is 28 bytes, crc: 0x83e7aee1:
Apr 24 09:07:13 t440p kernel: [84981.523109]  01000700 01007204 00000000 52706b7b
Apr 24 09:07:13 t440p kernel: [84981.523111]  f323e1f3 00000000 00000000
Apr 24 09:07:13 t440p kernel: [84981.523115] --> nfs41_call_sync_prepare data->seq_server 00000000209ff6e2

正常的切换到ubuntu 18.04,nfsv4正常并有下列日志:

Apr 24 09:15:52 node1 kernel: [  113.578775] NFS call  setclientid auth=UNIX, 'Linux NFSv4.0 node1/192.168.99.238'
Apr 24 09:15:52 node1 kernel: [  113.579047] NFS reply setclientid: 0
Apr 24 09:15:52 node1 kernel: [  113.579048] NFS call  setclientid_confirm auth=UNIX, (client ID 1de13162db060000)
Apr 24 09:15:52 node1 kernel: [  113.579636] NFS reply setclientid_confirm: 0
Apr 24 09:15:52 node1 kernel: [  113.579681] NFS call  setclientid auth=UNIX, 'Linux NFSv4.0 node1/192.168.99.238'
Apr 24 09:15:52 node1 kernel: [  113.580082] NFS reply setclientid: 0
Apr 24 09:15:52 node1 kernel: [  113.580083] NFS call  setclientid_confirm auth=UNIX, (client ID 1de13162db060000)
Apr 24 09:15:52 node1 kernel: [  113.580702] NFS reply setclientid_confirm: 0
Apr 24 09:15:52 node1 kernel: [  113.580714] --> nfs4_get_lease_time_prepare
Apr 24 09:15:52 node1 kernel: [  113.580715] <-- nfs4_get_lease_time_prepare
Apr 24 09:15:52 node1 kernel: [  113.581092] --> nfs4_get_lease_time_done
Apr 24 09:15:52 node1 kernel: [  113.581094] <-- nfs4_get_lease_time_done
Apr 24 09:15:52 node1 kernel: [  113.583488] NFS call  lookup Public
Apr 24 09:15:52 node1 kernel: [  113.583709] NFS reply lookup: 0
Apr 24 09:15:52 node1 kernel: [  113.583712] NFS call  lookup Public
Apr 24 09:15:52 node1 kernel: [  113.584106] NFS reply lookup: 0

无法ssh到dropbear的问题

另外,还遇到一个ssh问题,报:no matching host key type found. Their offer: ssh-rsa, 通过下列方法解决:

$ tail -n3 /etc/ssh/ssh_config
    KexAlgorithms +diffie-hellman-group1-sha1
    HostkeyAlgorithms +ssh-dss,ssh-rsa
    PubkeyAcceptedKeyTypes +ssh-dss,ssh-rsa

gnome lunar-calendar插件无法显示中文的问题

升级到ubuntu 22.04之后,发现我之前在20.04下一直使用的一些gnome插件消失了(如跨时区显示时间,如天气,截屏, 具体见: https://extensions.gnome.org/local/ ). 在运行下列命令并重启机器之后截屏恢复了(sudo apt install gnome-screenshot, https://extensions.gnome.org/extension/1112/screenshot-tool/ ),但天气(https://extensions.gnome.org/extension/750/openweather/) 和跨时区显示时间(https://extensions.gnome.org/extension/1060/timezone/)的还是未恢复.

sudo apt install gnome-shell-extensions gnome-tweaks gnome-shell-extension-manager chrome-gnome-shell -y
then need to reboot the machine
sudo systemctl status display-manager

先安装依赖(apt install gir1.2-lunar-date-3.0),再安装农历插件https://extensions.gnome.org/extension/675/lunar-calendar/ ,最后需设置ubuntu语言全系统为中文农压显示才不会乱码。

其他设置

也做了其他一些设置:

# avoid: update-notifier.desktop[132410]: Cannot stat file /proc/3829/fd/1023: Permission denied
sudo apt purge update-notifier update-notifier-common -y

# avoid: /usr/lib/systemd/system-generators/netplan failed with exit status 1.
sudo mv /etc/netplan/01-network-manager-all.yaml /etc/netplan/01-network-manager-all.yaml_bak
sudo netplan apply

# fwupd-refresh.service: Main process exited
# https://github.com/fwupd/fwupd/issues/2058
fwupdmgr refresh -v
fwupdtool get-updatessudo 
sudo systemctl disable fwupd-refresh

20220507更新

继续将一台台式机也更新到ubuntu 22.04时遇到了下列错误:

hua@node1:~$ sudo update-initramfs -u -k all -v
...
Calling hook reiserfsprogs
Adding binary-link sbin/reiserfsck
ln: failed to create symbolic link '/var/tmp/mkinitramfs_c7SIXF/sbin/reiserfsck': File exists
Adding binary /usr/sbin/reiserfsck
cp: failed to access '/var/tmp/mkinitramfs_c7SIXF//usr/sbin/reiserfsck': Too many levels of symbolic links
E: /usr/share/initramfs-tools/hooks/reiserfsprogs failed with return 1.
Removing /boot/initrd.img-5.4.0-109-generic.dpkg-bak
update-initramfs: failed for /boot/initrd.img-5.4.0-109-generic with 1.

hua@node1:~$ sudo find /usr/share/initramfs-tools/ -name 'reiserfsprogs'
/usr/share/initramfs-tools/hooks/reiserfsprogs

运行下列命令解决:

sudo mv /usr/share/initramfs-tools/hooks/reiserfsprogs /tmp/
sudo dpkg --configure -a && sudo apt -f install

#sudo dpkg -S /usr/share/initramfs-tools/hooks/reiserfsprogs
#sudo dpkg -P reiserfsprogs

还有一个问题:

Errors were encountered while processing:
 usrmerge

继续解决:

sudo apt purge usrmerge
sudo dpkg --configure -a && sudo apt -f install

20220512更新 - 升级thinkpad x1yoga的问题

将thinkpad x1 yoga也从ubuntu 20.04升级到22.04, 结果遇到了一个大问题. 按poweroff后无法关机(屏幕关了,但FnLk灯还亮着可能是电源没关),所以需长按电源键才能关机,然后再短按电源键才能开机. 最近一次日志里也没看到什么异常日志.

# 显示最后一次关闭 Linux 系统之前的系统日志, -r代表按时间倒序显示
sudo journalctl -rb -1
5月 12 09:24:47 x1 systemd-journald[268]: Journal stopped
5月 12 09:24:47 x1 systemd-shutdown[1]: Sending SIGTERM to remaining processes...
5月 12 09:24:46 x1 systemd-shutdown[1]: Syncing filesystems and block devices.
5月 12 09:24:46 x1 systemd[1]: Shutting down.
5月 12 09:24:46 x1 systemd[1]: Reached target System Power Off.
...

为了加速重启测试速度修改了:

cat << EOF | sudo tee -a /etc/systemd/system.conf
DefaultTimeoutStopSec=4s
EOF
sudo systemctl daemon-reload

在grub中测试了下列选项, 没一个能解决问题的:

reboot=efi
reboot=bios
reboot=acpi
reboot=pci
acpi=force
apm=power_off

接着测试了更新firmwall, 但也不能解决问题:

fwupdmgr refresh --force
fwupdmgr get-updates
fwupdmgr update

也测试了下列能让OS无法启动的方法:

# append 'apm power_off=1' into /etc/modules as well. NOTE: it will cause os not be able to boot
#GRUB_CMDLINE_LINUX="noacpi acpi=off acpi=force apm power_off=1

上述方法让OS无法启动, 在使用启动盘修复启动的过程中又发现了一个默认值的问题, ubuntu 22.04在grub中必须添加下列配置才能发现win10双分区.

#remove 20_memtest86+ and set GRUB_DISABLE_OS_PROBER=false to intect
#grep memtest /boot/grub/grub.cfg
sudo mv /etc/grub.d/20_memtest86+ .
GRUB_DISABLE_OS_PROBER="false"
sudo update-grub

上面运行了grub就有windows了也有linux, 然后进windows了发现莫名其妙地重启后grub又消失了.
只好继续启动盘进ubuntu, 但此时居然报:

grub-probe cannot find a grub drive for /dev/sda1 check your device.map
blkid |grep sda1
cat /boot/grub/device.map

没办法, 只好试着使用ubuntu 20.04重装并从22.04降级到20.04. 用ubuntu 20.04启动盘选择不格rootfs的那个安装模式,这样它不会毁坏你在rootfs上自己的数据,至于应用应该联网让它多保留你之前已经安装的应用,新版的应用配置文件会延用以前的,这样可以只是少数应用无法用而已.
注: 由于是降级,所以上面的并未保留数据,那就装完ubuntu 20.04后继续进usb启动盘(192.168.99.125,安装openssh-server)来从t440p上将rootfs sync过来吧.

rsync -xavP --numeric-ids --exclude='/nas' --exclude='/bak' --exclude='/tmp' --exclude='/EFI' --exclude='/media' --exclude='/mnt'  / [email protected]:/mnt/

猜你喜欢

转载自blog.csdn.net/quqi99/article/details/124359949