有人知道do-release-upgrade -q
实际上做什么吗?
希望它能够在不需要交互的情况下进行升级,如果是这种情况,它会覆盖配置还是保留原始配置?或者它会做其他事情吗?
stephenm@mcr-pc-29392:~$ do-release-upgrade --help
Usage: do-release-upgrade [options]
Options:
-h, --help show this help message and exit
-V, --version Show version and exit
-d, --devel-release Check if upgrading to the latest devel release is
possible
--data-dir=DATA_DIR Directory that contains the data files
-p, --proposed Try upgrading to the latest release using the upgrader
from $distro-proposed
-m MODE, --mode=MODE Run in a special upgrade mode. Currently 'desktop' for
regular upgrades of a desktop system and 'server' for
server systems are supported.
-f FRONTEND, --frontend=FRONTEND
Run the specified frontend
-s, --sandbox Test upgrade with a sandbox aufs overlay
-c, --check-dist-upgrade-only
Check only if a new distribution release is available
and report the result via the exit code
-q, --quiet
手册页甚至没有提到它。
DO-RELEASE-UPGRADE(8) DO-RELEASE-UPGRADE(8)
NAME
do-release-upgrade - upgrade operating system to latest release
SYNOPSIS
do-release-upgrade [options]
DESCRIPTION
Upgrade the operating system to the latest release from the command-line. This is the preferred command if the machine has no
graphic environment or if the machine is to be upgraded over a remote connection.
OPTIONS
-h, --help
show help message and exit
-d, --devel-release
Check if upgrading to the latest devel release is possible
-p, --proposed
Try upgrading to the latest release using the upgrader from Ubuntu-proposed
-m MODE, --mode=MODE
Run in a special upgrade mode. Currently "desktop" for regular upgrades of a desktop system and "server" for server systems
are supported.
-f FRONTEND, --frontend=FRONTEND
Run the specified frontend
-s, --sandbox
Test upgrade with a sandbox aufs overlay
SEE ALSO
update-manager(8), apt-get(8)
答案1
好的,我通过测试研究了这个问题,我安装了一个虚拟的 Ubuntu 10.04,编辑了一些配置文件,然后运行了 do-release-upgrade -q,
它的运行方式完全相同,我需要回答有关 mysql 密码和修改配置的所有相同问题。
这让我开始研究代码,想弄清楚它到底做了什么。do-release-upgrade 的代码是这里
通过查看,似乎使用该-q
选项只是省略了一点点输出。
据我所知,这是它唯一省略的内容。
if not options.quiet:
print _("Checking for a new ubuntu release")
..
if not options.quiet:
print _("No new release found")
...
if not options.quiet:
print _("Release upgrade not possible right now")
print _("The release upgrade can not be performed currently, "
"please try again later. The server reported: '%s'") % m.new_dist.upgrade_broken
sys.exit(NO_RELEASE_AVAILABLE)
看起来这除了省略上述输出之外没有做任何其他事情,这在升级输出的总体方案中至少可以说是微不足道的。
答案2
对于非交互式升级,您可以指定该--frontend=DistUpgradeViewNonInteractive
选项。
模式详情来自:
- https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-ubuntu-16-04-lts
- 我可以进行静默或无人值守发布升级吗?
使用 sudo 的脚本:
apt-get upgrade -y
apt-get dist-upgrade -y
apt-get install -y update-manager-core
iptables -I INPUT -p tcp --dport 1022 -j ACCEPT' # optional, in case upgrade fails
do-release-upgrade --frontend=DistUpgradeViewNonInteractive