Posts Tagged ‘upgrade’

After a couple of hours downtime, The Node is back running the ridiculously named “Beefy Miracle” release 17 of Fedora Linux. This wasn’t a smooth upgrade and I’ve upgraded via “preupgrade-cli” since Fedora 7.

Anyway this looks like a script writing bug basically and the solution is simple if you’re physically sitting in front of your server. The whole reason to use “preupgrade-cli” rather than the graphical “preupgrade” tends to imply no X session or an SSH terminal. Which has always worked in the past.

This is basically a foot-note to this preupgrade article which details how to upgrade Fedora Linux remotely using only preupgrade’s command line. Except, before you reboot to complete the upgrade you’ll see this:-

sh: /sbin/grub: No such file or directory
/bin/echo: write error: Broken pipe
All finished. The upgrade will begin when you reboot.

Usually after this point (minus the error) you type “reboot” and then lose your connection, wait a couple of hours and then start attempting to login again. When you can, you’ll find you’re back on Fedora 16 again. Huh.

People on forums were trying all sorts of things like reinstalling the preupgrade package and GRUB2 and such…none of which is necessary. Red herring!

After the normal preupgrade has done it’s thing and before you reboot as requested, open up your grub configuration file:-

vi /boot/grub2/grub.cfg

You’ll see the list of “menuentry” stanzas for each kernel, the top one of which is the upgrade, which is clearly labelled. This is what needs to be booted to without a user necessarily being at the console.

Above this chunk you’ll see this line:-

set default="1"

This is the bit that tells Fedora which kernel to load from “/boot” if no physical keyboard changes happen. They’re loaded in order starting from the top down, one stanza at a time. You’ll notice that the upgrade stanza is top of the list.

In GRUB, the stanzas are counted from 0 not 1. So the default kernel to load will always be the next one down, which is usually your last Fedora 16 kernel.

Told ya it was a simple scripting error :-)

Change the set default line to read: -

set default="0"

Save the file and now reboot. Fixed and your new Fedora release should begin installing. Give it a couple of hours and then retry an SSH session to that machine. Once in, check with: -


uname -r
cat /etc/fedora-release

Phew! I was worried with all the technical chatter on Bugzilla regarding this release. I was also worried about the reported move from the mess of directories under /sbin/lib /lib /sbin, /usr/sbin and so on…thinking this upgrade rather than a fresh install might knacker my system. But I worried needlessly, the upgrade script creates sym-links for backwards compatibility. So everything works again. Sorry for the downtime.

So you can’t wait for the over the air (OTA) update to Android 4.0 “Ice Cream Sandwich” on your Nexus S? Well, you can do it manually. Before you do though, keep in mind that as of today the reason you might not have gotten the OTA update for the Nexus S is because many people are reporting a bug that leads to increased battery drain. I’m still getting about a day’s usage out of my Nexus S, but only just barely with light usage. You may want to wait.

The only pre-requisite for this update is that your Nexus S must be the model with the AMOLED screen, not the SLCD screen. This means it must be model number GT-I9020 instead of GT-I9023. The AMOLED screen model is more common anyway, but it’s good to check. To find out which model of Nexus S you have, power it off and pull the battery and read the model number from the barcode label on the back of the phone under the battery. If you have the AMOLED model version, you’re good to go.

Anyway, if you do want to go ahead with the manual update, you’ll need the Android 4.0.3 ICS update build from here. Download the file and use your USB cable to copy the file (called ‘VQ8PQk_V.zip’) to the root of your SD card directory – so that’s directly under “/sdcard”. If you put it in a sub-directory, Android won’t be able to find it.

Next, power down your phone whilst holding down the volume up button and power it on again without taking your finger off the volume up button. When the boto menu comes up, use the volume up/down controls to navigate up and down. Select the Recovery option and press the power button to select it. When the exclamation icon comes up, press the power button followed by volume up. Select the “VQ8PQk_V.zip” file from the file system again using the volume up/down buttons and press the power button to select it.
The update will now install automatically. When it is done, select “Reboot” and you will now be at version 4.0.3 of Android 4.0. That’s it. However, on the Nexus S, there appears to be more of a drain on the battery that you would like. My battery usage shows the Android OS using between 28% and 35% of the available power. This may be because something is preventing the OS from sleeping properly or the load on the CPU is too high. Which is a shame, because the new ICS interface is much more responsive and smoother than it was under Android 2.3.6. There is also a tighter integration with Google+ now and a saner way of organising your apps on the home screen.

I’ll keep you updated with any patches to 4.0.3 on the Nexus S when they become available.

Update: In case anybody wants to know, installing the ICS update manually does not mean you cannot receive any future updates OTA from Google. Any future updates to ICS 4.0.3 will be pushed to your device as normal. If and when Google patch the battery drain problem (4.0.4 perhaps) you can either get it OTA if it’s being rolled out normally or use the above procedure on any future patched images and install manually.

In the past, I’ve always used Preupgrade to remotely upgrade Fedora. However, when rebooting to download the install.img, this sometimes fails. If that doesn’t work for you, you could try this method which only uses yum and omits preupgrade altogether.


1 #!/bin/bash
2 UPGRADE_VERSION=$1
3 if [ -z ${UPGRADE_VERSION} ]; then
4 echo "No Fedora upgrade version supplied. Exiting..."
5 else
6 echo "Upgrading to Fedora version '${UPGRADE_VERSION}'. Please wait..."
7 mkdir ~/Upgrades/Fedora-${UPGRADE_VERSION}-upgrade
8 cd ~/Upgrades/Fedora-${UPGRADE_VERSION}-upgrade
9 wget ftp://ftp.sunet.se/pub/Linux/distributions/fedora/linux/releases/
${UPGRADE_VERSION}/Fedora/x86_64/os/Packages/fedora-release-*
10 rpm -Uvh fedora-release-*
11 yum clean all
12 yum -y update
13 fi

You should be able to tell what is happening in this simple bash script. You enter the Fedora version as an argument to the script, else it fails. Then it downloads the core Fedora release RPM packages to /root/Upgrades/[fedora_release_version_subdirectory] from a remote Fedora Project mirror FTP site.
The rpm command is invoked to install the release. Lastly, the yum cache is cleared and all updates are applied.

After the script has run, you need to issue a ‘reboot’ command. Log back in as root and type: -

uname -r

You should now see that you are running the version you entered as an argument (assuming it exists on the server). Like all upgrades, I would refrain from skipping releases. Upgrading from Fedora 12 to 13 will probably be okay, but upgrading straight from Fedora 12 to Fedora 14 or 15 is not recommended.

Introduction

Normally, you would upgrade your Fedora distribution by downloading a CD/DVD image locally. However, it is possible to remotely upgrade your Fedora box from anywhere using just an SSH terminal. I’ve been doing this on the same box since Fedora 8 through to 13 without a hitch but like anything, proceed at your own risk :-) Here’s how you do it…

For the purposes of this tutorial, we’ll upgrade from Fedora 12 to Fedora 13. First, make yourself root.

su - root

Before we upgrade, we must make sure we have all the latest updates.

yum -y update

Next, we cleam the yum cache.

yum clean all

Now we come to the upgrade process. There are two ways to do this, one using preupgrade or upgrading using yum. Usually, using preupgrade won’t cause a problem, but if you for any reason can’t use preupgrade, I’ll show you an alternative using yum.

Upgrading Using Preupgrade

First you need to install preupgrade if you haven’t already.

yum install preupgrade

Once, it’s installed, call it from the command line using:

preupgrade-cli

This will show you a list of releases you can upgrade to. If all goes well, it should show you an entry like ‘Fedora 13 (Goddard)’ in the list. To upgrade, append the release string to the preupgrade-cli command:

preupgrade-cli "Fedora 13 (Goddard)"

This will take a fairly long time, but be patient as it’s downloading all needed packages from the Internet. Once preupgrade has finished, you need to reboot so all the new packages can be installed.

reboot

That’s it :-) Once everything is installed, you now have a shiny new install of Fedora 13.

Upgrading Using Yum

If preupgrade didn’t work for you or if you prefer using yum anyway, here is the alternative.

Install the Fedora 13 release packages: -

For i386 (32-bit) use:

rpm -Uvh ftp://download.fedora.redhat.com/pub/fedora/linux/releases/
13/Fedora/i386/os/Packages/fedora-release-*.noarch.rpm

For x86_64 (64-bit) use:

rpm -Uvh ftp://download.fedora.redhat.com/pub/fedora/linux/releases/
13/Fedora/x86_64/os/Packages/fedora-release-*.noarch.rpm

Once this is done, run:

yum upgrade

to finally upgrade the system. If you are using the RPMFusion repositories on your system, you can update them and the RPMFusion packages by using:

rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpm-fusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm && yum -y update

You’ll need to install the GRUB bootloader to the MBR of your hard drive with:

/sbin/grub-install /dev/sda

Finally, reboot the system:

reboot

…and you should be done. Bare in mind that all of the above may not work for you, so like everything Linux, backup your data before doing this. But like I said, I’ve managed to do this from Fedora 8 to Fedora 13 with no problems. Hope this was helpful :-)

Search The Node
XBox LIVE Gamertag
The Node Downloads
Mini Tweets

Switch to our mobile site