我正在尝试完成从 ubuntu 16.04 到 18.04 的静默升级脚本
这是要注意的地方:
- 我正在使用本地景观存储库 16.04/18.04
- 由于安全原因,客户端无法访问 Ubuntu 存储库。
- 由于使用情况,系统无法更新 UI。
- 一切都需要保持原始系统上的原样
- 我们基本上已经写好了脚本,而且看起来效果很好
- 但是我们被挂在询问我们是否要修改的部分
/etc/default/grub
有谁知道如何度过这一点?
我们尝试了许多不同的方法。这是我们的脚本:
#!/bin/bash
# Help ensure that nothing hangs waiting for input when running the apt commands
#echo 'DPkg::options { "--force-confold"; }' >> /etc/apt/apt.conf.d/local
#echo 'DPkg::options { "--force-confdef"; }' >> /etc/apt/apt.conf.d/local
# Update the apt package itself, and then initiate the release upgrade
sudo apt-get clean && sudo apt-get update && sudo apt-get install -y --only-upgrade apt && DEBIAN_FRONTEND=noninteractive && sudo apt-get -o Dpkg::Options::=--force-confdef -y --allow-unauthenticated dist-upgrade
sed -ri 's/(\[daemon\])/\1\nAutomaticLoginEnable = true\nAutomaticLogin = "computer-name"\n/' /etc/gdm3/custom.conf
sed -i 's/^APT::Periodic::Unattended-Upgrade "1";/APT::Periodic::Unattended-Upgrade "0";/' /etc/apt/apt.conf.d/10periodic
sed -i 's/^APT::Periodic::Unattended-Upgrade "1";/APT::Periodic::Unattended-Upgrade "0";/' /etc/apt/apt.conf.d/20auto-upgrades
sudo -u meds-6300-yl -- echo "yes" > /home/meds-6300-yl/.config/gnome-initial-setup-done
sed -i 's/Prompt=.*/Prompt=never/g' /etc/update-manager/release-upgrades
sudo -u meds-6300-yl -- gsettings set com.ubuntu.update-notifier no-show-notifications true
sudo -u meds-6300-yl -- gsettings set com.ubuntu.update-notifier regular-auto-launch-interval 99999
sudo -u meds-6300-yl -- gsettings set com.ubuntu.update-manager check-dist-upgrades false
sudo -u meds-6300-yl -- gsettings set com.ubuntu.update-manager check-new-release-ignore 'focal'