Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
53
rated 0 times [  53] [ 0]  / answers: 1 / hits: 69218  / 3 Years ago, sun, august 15, 2021, 1:56:46

Usually I upgrade my Ubuntu installation through a ssh connection. Sometimes this ssh connection would be lost or I would accidentally close the terminal window.



It is possible to check the upgrade status after a ssh re-login into the computer?


More From » apt

 Answers
0

The following logs are related to apt upgrades:



/var/log/apt/history.log
/var/log/apt/term.log
/var/log/dpkg.log


If the command was dist-upgrade, there are additional logs in:



/var/log/dist-upgrade


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...



A GNU Screen Primer:



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.



Install screen:



sudo apt-get install screen


Run screen:



screen


After running screen you will get a command line prompt as with a normal terminal. You can then run the upgrade from inside screen:



sudo apt-get upgrade


To understand how this works, "detach" screen by pressing Ctrl+a, d. This will return you to the non-screen terminal. You can see the list of running screens with



screen -list


If you only have one screen running, you can reattach it with:



screen -raAd


(This detaches screen in case it is attached elsewhere, and reattaches it to the terminal you are currently running.)



Typically you cannot scroll 'normally' from within screen without some extra setup. To scroll within screen, press Ctrl-Esc to enter cursor mode. You can then scroll down and up with j and k. Press Esc again to exit cursor mode.



There are many more resources on the net available for additional screen functions. It is an invaluable standard tool for system administration.



See also:




[#34006] Monday, August 16, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
istictroubli

Total Points: 306
Total Questions: 96
Total Answers: 114

Location: Sao Tome and Principe
Member since Wed, Jul 13, 2022
2 Years ago
istictroubli questions
;