Molly-Guard is a program for exactly this purpose; it requires you do a small amount of setup, and have /usr/sbin
before /sbin
in your $PATH
.
Otherwise, according to this the exact details are highly dependent on the GUI / DE's implementation. Since we know your friend is using Xubuntu, this narrows it, but without recompiling Xfce with this support built-in (which would create further issues) it seems very hard.
According to my bountiful research, you can theoretically just replace /sbin/shutdown
with a script that checks if an apt job is up and executes sudo shutdown -c
or sudo init 2
to cancel a running shutdown and wait
for it to exit, but I'm not sure how robust this is.
According to this, you could just make it hard for the user to shutdown, instead of hooking a script.
Finally, as outlined here, you could install unattended-upgrades
over whatever system you're using for autoupdates now, and make sure it exits before shutdown as detailed in this answer.
There are many options, all of which are varying levels of unreliable, but I think the best one, which solves what I think is, to some extent, an underlying X / Y Problem at play here, is this:
Use crontab
to make his computer run dpkg --configure -a
on every boot.
@LovesTha: For your purpose, I recommend unattended-upgrades
, or perhaps Molly-Guard.
Immediately after Ubuntu 18.04 was released I created a chatroom where Ask Ubuntu users could report applications from the default Ubuntu repositories that were removed from the official 16.04 repositories in Ubuntu 18.04. The total reported missing applications that had been removed from the default repositories in Ubuntu 18.04 was not more than 10 applications. I interpret this as evidence that you should have few problems with removed applications when upgrading from 18.04 to 20.04.
When upgrading from 16.04 to 18.04 I also found that a few applications that could not be upgraded were still installed and I could still open them, but some of them had to be removed because they didn't work properly in Ubuntu 18.04. Afterwards I searched for replacements and discovered reasons why some of these applications were removed from the default Ubuntu repositories. It was because new alternative applications were added to the Ubuntu 18.04 repositories that were better than the old ones. I strongly recommend that you don't give up if one of your favorite applications was removed from the default Ubuntu 20.04 repositories until you search in Ubuntu Software to check if there is a better replacement for it. You may be pleasantly surprised at the results!
Regarding PyCharm, Sublime text editor and Visual Studio Code I have all three of them currently installed in Ubuntu 18.04 which was fresh installed on a new computer. Before installing Ubuntu 18.04 I saved a list of all my existing extensions in PyCharm, Sublime and VSCode in a text file so that I could quickly reinstall them later.
Regarding third-party applications the release upgrade process is conservative and doesn't remove them, although I prefer to resolve possible compatibility issues by reinstalling all of them after upgrading. Before reinstalling any third-party applications I search in Ubuntu Software to check if there are any new applications in the latest release that I might like better.
Best Answer
What does “dist-upgrade” mean?
It upgrades current OS and installed programs
The process does not affect personal data stored in
/home
folderThe process will not upgrade the OS version, will not wipe data or settings
It is safe to run it
As you can guess, a backup of personal files is not specially required before an
sudo apt dist-upgrade
but recommended for general use.From apt-get manual: