Sample Header Ad - 728x90

Pass Enter key to dist-upgrade's prompt, running inside a GUI terminal on a remote machine, accessible henceforth only over SSH

0 votes
1 answer
26 views
I earlier had RDP access to a remote machine (a typical physical desktop PC) using which I launched a sudo apt dist-upgrade inside a GUI gnome-terminal. Since then I have lost the RDP connection and only have SSH[1] . Since there was no 'assume yes' in the apt command, inspecting cat /var/log/dist-upgrade/screenlog.0 over SSH has revealed that the upgrade, still running, is stuck on a prompt[2] , seeking the user to hit Enter or select yes (and then hit Enter). Note that at this point dist-upgrade has been running for about an hour (excluding the await since) and has installed lots of packages. The objective now is to pass Enter to that running dist-upgrade (or teminate the upgrade altogether but this may corrupt the system). An LLM has suggested using gdb -p pid /usr/libexec/gnome-terminal-server followed by call (int)write(0, "\n", 1) where pid and executable are obtained from ps -ex | grep terminal. However that errs as No symbol "write" in current context. since No debugging symbols found in /usr/libexec/gnome-terminal-server). Another approach is to use xdotool to generate a programmatic click. Alas, it's not already installed on remote and installing it now isn't possible since an update is running. This is true of all programs - at this point we have to work with what we've got (standard bash) and nothing new can be installed. *What to do?* --------
#tail /var/log/dist-upgrade/screenlog.0
Package configuration


Upgrade to the firefox snap  
                                                                                         
Starting in Ubuntu 22.04, all new releases of firefox are only available to Ubuntu users through the snap package. This package update will transition your system over to the snap by installing it.It is recommended to close all open firefox windows before proceeding to the upgrade.  

                        <-- 0:jammy -- time-stamp -- Apr/01/24 15:45:57 --
Asked by lineage (113 rep)
Apr 2, 2024, 02:46 AM
Last activity: Apr 2, 2024, 02:58 AM