0

there's a raspberry pi that I ssh logged into it works fine and then I sudo apt-get updateed it.

during the process, I just turned off the terminal thinking that the update process should be running on its own...

but after that, I tried to login again and it doesn't work.

Was it wrong for me to suddenly log out like that?

How can I make my raspberry do stuff even though I'm logged out?

2

Was it wrong for me to suddenly log out like that?

Generally speaking, you don't want to suddenly stop the install process, as it leaves your file system in a somewhat undefined state. If you can get access to the console (either by ssh or directly) then try to repair the installation by typing:

sudo dpkg --configure -a
sudo apt-get install -f

How can I make my raspberry do stuff even though I'm logged out?

I would recommend screen for that. It creates a virtual shell that does not die on logouts, so you can reload it between logins.

| improve this answer | |
1

Generally speaking, it's usually safe to rerun the update.

Assuming you are using a standard Linux....

The following logs are related to apt (and thereby to upgrade):

$ ls /var/log/apt/ | grep 'log$'
history.log
term.log

and also

/var/log/dpkg.log 

Lastly, from this post it seems that hard reboot (i.e. disconnecting the power) will allow you to log in the device again.

I hope you set it up to static IP, otherwise you can check your router.

Note: the update process, if haven't been run in a while, can take a few hours.

| improve this answer | |
1

When the current session is destroyed, any applications running in it are also killed. To prevent this, use nohup as so:

sudo nohup apt-get update &

or

sudo nohup apt-get install --yes package &

This will run in the background immediately return you to the prompt after you run it. The second version will automatically answer yes to any questions (which is important since you aren't at the interactive shell with this version). If something goes wrong, you'll either need to try it again normally or look at the logs.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.