Contents
How to run Apt-get upgrade after losing SSH?
Screen provides a virtual terminal that continues running even if your ssh connection is lost. After running screen you will get a command line prompt as with a normal terminal. You can then run the upgrade from inside screen: To understand how this works, “detach” screen by pressing Ctrl+a, d. This will return you to the non-screen terminal.
Why can you not take over a SSH session?
Finally, the reason why you can’t take over a SSH session this way is because a sshd process is not controlled by a host terminal, instead it provides the slave part of a terminal – a pts device – while the master part controlling it resides on the client machine, here with a broken-down SSH session in between.
How can I reattach to a broken SSH session?
While you can’t reattach to a broken SSH session, you can reparent the process running inside SSH – functionally equivalent to what you want. In your case, you would take over the apt-get process to be controlled from a new SSH session, screen session or the like.
Can you see old output of SSH session?
Unfortunately you will not see old output of the SSH session, such as the apt-get output asking you for confirmation. There are multiple other tools that basically work the same as reptyr (that is, via ptrace debug attachment). See the following questions and answers where they are discussed:
How to resume or abandon an apt-get upgrade?
The last few lines looked like this: Installing new version of config file /etc/init.d/procps Configuration file ‘/etc/sysctl.conf’ ==> Modified (by you or by a script) since installation. ==> Package distributor has shipped an updated version.
Is it safe to re-run Apt-get upgrade?
If the command was dist-upgrade, there are additional logs in: FYI, it is usually safe to just re-run the upgrade and apt will continue where it left off when the process died due to disconnection.
How can I speed up an apt-get update process?
Another possibility would be using axel and the apt-fast script. It is advertised as speeding up downloads by doing parallel downloads, but it also seems to be good about keeping track of what’s already been downloaded, presumably because it has to track the file pieces as it downloads in parallel chunks.
How to fix broken pipe error with SSH?
Fixing broken pipe error with SSH 1 If you connect to multiple servers via SSH, set it on your machine. 2 If you are a sysadmin and several of users complain about frequent SSH connection disconnect, you may set it on the… More
What should I do if I Lose my SSH connection?
When ssh’ing into a remote server and starting a long-running process in the foreground, it is best practice to use GNU Screen. Screen provides a virtual terminal that continues running even if your ssh connection is lost. After running screen you will get a command line prompt as with a normal terminal.
How to check ” apt-get upgrade ” status?
If the command was dist-upgrade, there are additional logs in: FYI, it is usually safe to just re-run the upgrade and apt will continue where it left off when the process died due to disconnection. However… When ssh’ing into a remote server and starting a long-running process in the foreground, it is best practice to use GNU Screen.