LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   YUM via SSH (https://www.linuxquestions.org/questions/fedora-35/yum-via-ssh-478563/)

ACDII 08-29-2006 05:29 PM

YUM via SSH
 
If I am in the middle of a YUM upgrade and I get disconnected, does it continue yumming? :jawa:

macemoneta 08-29-2006 10:45 PM

Not normally. However, when performing remote maintenance operations, the 'screen' command is your friend. You can run multiple terminal sessions from a single login, disconnect (intentionally or accidentally), and reconnect (even from another computer at another location). The man page has all the info, but here's all you need:

1- Login as normal (via ssh, or even with a local terminal session)
2- Issue the command: screen
3- You now have what appears to be a normal session, but notice the titlebar has changed
4- To add an addition session: ctrl-a,c (ctrl-a followed by hitting the letter 'c')
5- To end a session, exit as you normally would. You will drop back to other sessions, until you finally exit screen.
6- To switch sessions: ctrl-a,number (where number is the session - for example ctrl-a,1 or ctrl-a,2)
7- To disconnect: ctrl-a,d
8- To reconnect to a disconnected screen: screen -r (if there are multiple disconnected screens, you will be presented with a list).

ACDII 08-30-2006 09:05 AM

OK, well, I will find out soon if anything came of it. I had dropped the connection while in the middle of the update. The console is totally dead, no keyboard, mouse, or video, but ssh works fine. Happened in the middle of update through the gui.

ACDII 08-30-2006 09:26 AM

OK, I was able to log back in and did the screen command, worked like a charm, but tried to run YUM and got this.

# yum -y update
Loading "installonlyn" plugin
Existing lock /var/run/yum.pid: another copy is running. Aborting.


Hmm, is there any way to re-establish connection to that session?

macemoneta 08-30-2006 11:23 AM

First, check to see if another process is actually running:

ps -Afl | grep yum

If so, then kill it: 'killall yum'. If that doesn't work (the process still shows in the 'ps' command), then 'killall -9 yum'.

If not, then the process did not clean up its lock file. Just remove it with 'rm -f /var/run/yum.pid'.

You should also clean the partially updated cache: 'yum clean all'.

You can rerun the yum command now.

ACDII 08-30-2006 01:00 PM

Excellent, works and I tested it running YUM and I was able to disconnect and then return to the session. :D


All times are GMT -5. The time now is 10:49 PM.