How to update from Debian 7 to Debian 8 on Google Compute Engine

google-cloud-platform

Is there a particular way to update from debian 7 to debian 8 on a machine on Google Compute Engine?

While I can connect to the machine with gcloud ssh command, after I did the update I'm unable to connect from the Console using SSH on browser; I get a "Could not connect, retrying (1/3)…" error.
For the update process I follow the documentation on Debian official website.

The error on console log is:
instance-1 sshd[18651]: Connection closed by XX.XXX.XX.XX [preauth]

Nothing more and I have already tried to restart the machine.

So, the questions are:
– Is there specific documentation for Google Compute Engine for update debian 7 to debian 8?
– Have anyone make the update, get my error and solve the issue about ssh from browser?

Thanks

Marco

Best Answer

First, it is not recommended to upgrade the OS in place. Instead you should deploy the application on an image of the next version.

Also, this question is now one year old. Debian 7 Wheezy is not supported anymore.

I was able to upgrade Debian 7 to Debian 8 Jessie in Compute Engine. I just replaced "wheezy" with "jessie" in /etc/apt/source.list and /etc/apt/source.list.d/* and then ran a "apt-get dist-upgrade".

See the Debian Jessie upgrading documentation for all about upgrading from 7 to 8. https://www.debian.org/releases/jessie/amd64/release-notes/ch-upgrading.en.html.

I tried with both:

  • The latest standard Debian 7 image "debian-7-wheezy-v20160531". It's still available but deprecated.

    It appears to work. If you try on one of your projects be careful: the image is 1.5 years old and hasn't received security updates.

  • A new image built from https://github.com/andsens/bootstrap-vz/blob/master/manifests/official/gce/deprecated/wheezy-backports.yml.

    It works mostly, what I noticed is that /etc/hosts file is missing the name of the machine, and the hostname defaults to "localhost". I am not sure why but that still does not break ssh.

Regarding the sshd error:

instance-1 sshd[18651]: Connection closed by XX.XXX.XX.XX [preauth]

It means that the ssh client closed the connection during the SSH preauthentication phase.

It often means that the the sshd daemon can't read the user's ~/.ssh/* files. The error messages above this line could bring more information, you can also try adding "-vv" to the ssh command.

If you still have the issue, I suggest you follow the "Troubleshooting SSH errors " part of the troubleshooting guide https://cloud.google.com/compute/docs/troubleshooting#ssherrors.