System Updates - Ubuntu 16.04


#1

I think i’m up the creek with no paddle.

I did some system updates via apt, gave the system a reboot and now i can’t even ssh to it.

It tells me my network is down and that i need to do a live rescue to access the system.

I do live rescue and i can ssh back into the system.

I’m abit out of my depth here… any help would be great.

thanks


#2

Did you contact your provider to ask him if something is wrong with your server?


#3

yeah they said that there was no issues hardware side and that i should run rescue mode and check system logs.

I tried taking a look… but wasn’t 100% on what to look for… there appeared to be no dmesg or boot.log?


#4

If you can’t log in with SSH, maybe you could take a look at /var/log/auth.log or /var/log/dmesg for network issues ?
Otherwise it’s gonna be compicated to understand what happened during the apt update :confused:


#5

might just be you need to wait it out while it boots up i did same thing and then waited long enough and it came back up on its own. without changing anything.


#6

thanks for the help guys.

I ended up nuking it and i’ve started with a clean install. :confused:

not sure if i’ll be doing updates again…

Does any one else stay on top of apt update / apt upgrade ??**_

Should i be doing these regularly?


#7

i do often


#8

I’ve had this happen before and the issue was the port, in that it had reverted back to 22 instead of 4747.


#9

I do, and recommend others do as well :slight_smile: There are often important security updates (i.e. kernel updates when vulnerabilities are discovered) that are pretty good to keep up on. Apt shouldn’t really be breaking anything we provide, though occasionally an update will state that the default conf for a program has changed and ask if you want to overwrite with the new version or keep the current version. As a rule of thumb, keep all existing config files - overwriting the defaults of something like php, apache or sshd configs will have unintended consequences.


#10

Hey @dtech @chachachang @liara ,

thanks all for the replies… this is very helpful to know and I’ll be sure to keep the system updated regularly.

Knowing that i can’t break too much as long as i don’t overwrite configs.

Appreciate all your help.

Cheers


#11

I usually set certain config files to read-only so they dont get changed during updates. I’m not sure if the cmd is the same with ubuntu or debian as i use a CentOS system as Main Server.

But the command i use there is:

chattr +i /path/to/file/not/to/change.conf (This is to prevent the File being changed)
chattr -i /path/to/file/not/to/change.conf (This is to allow the File to be changed again)


#12

I do often as well, just like I logged in and see I have 21 updates waiting right now! I run two different boxes currently (mine and a friends at his place) and do it. Plus now and then updates require rebooting, and I am a person that thinks any box needs rebooted now and then (because sometimes reboots show hardware that is starting to fail - like SMART saying a hard drive had errors).

I wrote a text file in my HOME directory I CAT when I do updates to copy the commands:

sudo apt-get update

sudo apt-get dist-upgrade

sudo apt-get upgrade

I have found doing updates in that order seem to ensure that I don’t have any issues.


#13

Thanks again everyone for the help!!

i think i’ll take on your adivce @tokolosh and @POWerSUrgeSW3.

Does it matter if i use

apt-get update
or
apt -y update

do they both do the same thing ?


#14

I found this while doing some Googling, because I wondered the same question when you posted it:

apt-get-current can be used just like plain apt-get, but it is got a small superpower. When performing install, upgrade, or dist-upgrade (or full-upgrade for apt) commands, it will automatically perform an apt-get -y update (or apt -y update)

Found that here https://github.com/alanfranz/apt-current

I’m interested, probably do some more digging myself. But sometimes “we” take for granted some of the commands we think are “simple”…


#15

nice find @POWerSUrgeSW3 !!!

have you gone ahead and installed apt-get-current?

Had any luck with it ?

I just started looking into it myself…


#16

I have not yet, end of the year vacation and then working a trade show this last week… just haven’t had time. But I plan on looking into it. Love finding more efficient ways of doing things!