A couple of tips on how to recover from a failed Ubuntu upgrade
Last week I decided to give Ubuntu 11.10 a try on my Toshiba Satellite L670-1DT (64 bit). Having Ubuntu 11.04 already installed on this machine, and having a lot of extra software that I did not want to reinstall on that machine, I thought it was wise to go for an upgrade, instead of a fresh install. Well, I was wrong.
I started the upgrade from within the graphical screen. Downloading the new packages went without a flaw. However, just after about ten minutes, and during the software replacement phase of the upgrade, bang, there it was: just a black screen, no graphical screen any more, and a fatal error message on the screen: kernel panic, and no other activity on the machine whatsoever. The only option I had, was to power off the machine, and hope for the best.
I powered the machine back on. It would still boot into Linux, but with a lot of error messages and only a text screen. There was no prompt, neither text based, and certainly not a graphical interface. So here I was, with a broken machine in an in-between state of two Ubuntu versions. What would be the best tactic of repair? And generally speaking, what are the best tactics of diagnosis and repair?
This is what I want to discuss in this blog entry, with a few simple basic tips. Oh and by the way: I fixed the Toshiba machine was (without reinstall…) and it’s working fine with Ubuntu 11.10 now, and Ubuntu 11.10 is just great. But would I recommend an upgrade from 11.04 to 11.10 instead of doing a fresh install? Well, I’m not so sure about that…just install a fresh Ubuntu 11.10.
Anyway, here is a couple of tips, for an Ubuntu machine that an upgrade was attempted on, with (at least…) no graphical screen appearing after a failed upgrade. My own situation after the failed upgrade was:
- no prompt
- no network
- a machine with an in-between Ubuntu version.
NB: all commands in Linux are case sensitive.
Tip 1. Always first check that your personal data is still in place.
If your personal data is still in place, you’ll feel a lot less lost.
Start your computer in Ubuntu recovery mode, and select root shell prompt. Press Ctrl-Alt-F2. A login prompt will appear. Type in your regular name and password. Type in: ls (Enter). Do you see your files? Okay then, your data is still in place.
Tip 2. Check and possibly repair your internet connection (at least temporarily), and use it to repair. With a network cable plugged in into the machine, start your machine in Ubuntu recovery mode. In the recovery menu, select the drop to root shell prompt option (possibly with networking option). Type in: ifconfig (Enter). In the best case, it will show something like this:
ifconfig
eth0 Link encap:Ethernet HWaddr 87:ae:1e:cf:0e:b3
inet addr:172.16.1.15 Bcast:172.16.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7047 errors:0 dropped:0 overruns:0 frame:0
TX packets:6503 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6643595 (6.6 MB) TX bytes:1093342 (1.0 MB)
Interrupt:40 Base address:0×8000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:336 errors:0 dropped:0 overruns:0 frame:0
TX packets:336 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:26880 (26.8 KB) TX bytes:26880 (26.8 KB)
The eth0 part is the networking part, and is the cable connection. It tells you that you have an IP address (inet addr). You could try a ping command to some internet site that can be pinged. If you get a response, you know that your network is still working.
From here, we have two scenarios:
- save personal data in a safe place and do a fresh installation; next, copy your data back on a fresh install
- continue the failed upgrade
If you want to go for the first option (save your data and start all over again), you can do the following, using the winscp program:
- install ssh on your Ubuntu machine: sudo apt-get install ssh. After installation, type: sudo /etc/init.d/ssh start. This will start your machine in server mode, and will allow you to get your files from the machine to any other place, including a to Windows machine. Download winscp. Install the package, and start it. Basically, you can now make a connection to your Ubuntu machine by entering the IP address of the Ubuntu machine, and by entering your username and password. Copy / paste all data that you would like to save. Your personal data is in /home/username.
Now let’s assume we want to opt for the second option: continue the failed upgrade. With a working network connection, you can just type in: sudo apt-get update, followed by sudo apt-get upgrade. Ignore error messages, and wait for the upgrade to finish.
But the situation could also be that you only see this:
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:336 errors:0 dropped:0 overruns:0 frame:0
TX packets:336 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:26880 (26.8 KB) TX bytes:26880 (26.8 KB)
In this case, your network is not working, and you’ll have to do some more work to, at least, get an Internet connection and to continue the previously failed upgrade.
Restart your computer in Ubuntu recovery mode, and select root shell prompt again. You can still:
- start scripts
- enable network interfaces
- get an IP adress through DHCP
Start scripts: all initialization scripts are located in the folder /etc/init.d/ Type in: /etc/init.d/networking start (Enter). After getting back to the prompt, type in: dhclient (Enter). Now check your network: ifconfig eth0. You should see that your Internet connection is working again, at least manually, and you should see something like shown in the first example, and you can continue the previously failed upgrade:sudo apt-get update (Enter) and sudo apt-get upgrade (Enter). Follow the instructions as shown on the screen.
Most of the time, and despite some very not-reassuring messages on the screen, you will see that the upgrade will continue up to a point where the upgrade procedure will prompt you to restart your machine. With a little bit of luck, the machine will be up and running again. If you’re not lucky, the machine will start, but will, e.g., not show any graphical screen. That happened in my case.
Tip 3. Check log files after (unsuccesful) full start.
Again, you may be lucky, or not. This was the case with my laptop, telling me (in text mode) something about apache being not well configured, and it just halted there: a black screen with some text.
Now we have two choices: on another machine, Google for the exact error message (I think that’s a don’t) and check some log messages (I think that’s a do). I think that Googling for the exact error message is a don’t, because the last message on the screen is NOT per se the fatal message. Myriads of causes can apply tho the system not booting 100% correctly, and you will find at least a hint to the exact cause in the log files.
Log files are located in the /var/log/ directory. You can always access them, non-graphically, by doing the Ctrl-Alt-F2 thing, logging in with your normal account. Once you are logged in, type in cd /var/log (Enter). Type ls, and you’ll see all log files. You can read the content with the cat command, e.g. cat boot.log. If the file is too big, you can do cat boot.log | more.
The most important log files are:
- boot.log. Always check it. It will tell you which programs did load correctly, and which did not. Sometimes, the load failure is as simple as the package not being installed. If this is the case, you can always add it by typing sudo apt-get install <packagename>
- Xorg.0.log (that is with X, not with x). This is the log file of the graphical part (the “X server”). Any problems with the graphical screen will be reported here
- dpkg.log. That’s a log of all installed and removed packages. Check what this file says about the missing (or wrongly installed package).
- syslog. That is the running system log.
The most important commands to read the log files in text mode are:
- cat (“show on the screen”)
- cat filename | more (“show on the screen as much as can fit on the screen”)
- cat filename | grep sometext (show on the screen the content of the file, but only the things that I want to see. e.g.: cat boot.msg | grep error
- tail -f filename (show the content on the screen and see the content as it is appended). e.g.: tail -f -n 100 /var/log/syslog. The -n is the number of lines
A tail command can always be interrupted with Ctrl-c.
Hope this information is helpful for anyone facing a failed Ubuntu upgrade.
Previewing files and folders on Ubuntu 11.04 with Gloobus Preview
This article applies to Ubuntu 11.04 64 bit edition
With a 450 GB hard drive on my Toshiba Satellite L670-1DT, disk space is barely an issue. That is why, these last months, I stuffed the hard drive with anything that could be of use for my work…and stuffed, almost anywhere, not paying too much attention to where I put it, as long as it ended somewhere on my home directory. Knowing my way around to find files and folders, finding the files that I needed was not too much of an issue. However, this needed to be improved…I wanted a way to preview my folders and my files, without opening the directories or the files. Googling (or for that matter, Duck-Duck-Going) a bit around, I found a tremendous application: Gloobus. Gloobus allows to preview folder and file content on a Linux desktop without really opening the folder or the file.
This is how I installed it on my Toshiba Satellite L670-1DT with Ubuntu 11.04.
1 – in a terminal, I added a repository: sudo add-apt-repository ppa:elementaryart/elementarydesktop. A trusted key was imported automatically.
2 - sudo apt-get update and sudo apt-get upgrade were done to update the installation sources, and to check whether any software needed to be upgraded before installing the Gloobus software
3 – then I installed gloobus: sudo apt-get install gloobus-preview
And I restarted the Ubuntu file manager from the terminal: nautilus -q
Well, the result was just astonishing. Selecting a file or a folder, and pressing space bar produced exactly the effect I wanted: a preview of a folder or file without opening it.
Check it out, it’s really worth the try! Oh and by the way, it also works on older versions with less quality video cards. Tested working also on Ubuntu 9.10 with the famous Brookdale chipset… (see other posts here…). The commands to install the software on Ubuntu 9.10 are just a bit different (other repositories to define):
sudo add-apt-repository ppa:gloobus-dev/gloobus-preview
sudo apt-get update
sudo apt-get install gloobus-preview
nautilus -q
Have fun!
Playing encrypted DVDs on Ubuntu 11.04 with Totem media Player
While on holiday, I wanted to play a couple of movie DVDs on my Ubuntu 11.04 x64 laptop. Unfortunately, some of the DVDs were encrypted, and I had not installed the Ubuntu DVD encryption library, which is needed to play encrypted DVDs on Ubuntu.
Back home, I installed the package, and tested the same DVDs that I could not play while on holiday.
Based on an excellent howto from http://linux.about.com/od/ubuntu_doc/a/ubudg34t2.htm, this is how to install the encryption library in Ubuntu 11.04 64 bit.
1. Open a terminal, and type: sudo apt-get install libdvdread* (press Enter, and enter your root password). This will install all needed DVD encryption library packages.
2. Staying in your terminal window, type: cd /usr/share/doc/libdvdread4 (press Enter)
3. Type sudo ./install-css.sh (press Enter). This will install a couple of other packages.
Test an encrypted DVD within Totem Media Player, it should work immediately for an ecrypted DVD.
Have fun!
Tired of Youtube Ads? Minitube!
This is just a very short blog entry. I like to listen and watch Youtube, but I don’t like their ads. I also don’t like the way the web page and the videos are more and more filled up with thes ads. Lastly, I do not want to continuously select songs manually. Having the same feeling? Don’t look any further. Install Minitube. The audio and video quality are very high, a playlist is automtically generated from the keywords you entered, and it can play full screen. For Ubuntu, install the Minitube application from the Ubuntu software Center (64 bit and 32 bit). For other platforms, just visit the author’s web site. Happy YouTubing!
Easily create high quality network diagrams with Dia
I’ve been noticing a lot of traffic on my WordPress site for people looking to use Dia as an alternative to Microsoft Visio. My dia tips and tricks contains some tips, just tell me if they’re of some use to you. Have fun!
Moving to a new computer (3)
In the posts “Moving to a new computer” , I describe situations that I encountered, while reconfiguring a brand new Toshiba laptop from Windows 7 to Ubuntu 10.10 x64.
continued from: moving to a new computer (2)
After having installed Ubuntu 10.10 x64 on my brand new Toshiba Satellite L670-1DT, I was curious to know if everything worked as expected. Well, it surpassed my expectations. It starts up in as little as 20 seconds, so I guess I will never ever use hibernation mode on it. Didn’t test it, won’t test it, 20 seconds is fast enough for booting (and much faster than the preinstalled Windows 7). All hardware, and all peripherals (including the Realtek wireless controller, built-in web cam and microphone) had been detected perfectly. They work without a flaw. A problem that I had with Windows 7 on this machine (wireless hanging after just 5 minutes, no modifications done from factory settings) just does not exist with Ubuntu. Screen resolution is perfect (the screen resolution of 1600×900 covers exactly the physical 17,3′ TFT screen). Also, the Ubuntu Family font make the whole Toshiba-Ubuntu combination an attractive machine.
To complete the software that I used on my old machine, I just needed to add Dia, VLC Media Player, Teamviewer, Skype and Gimp (yep, Gimp is not included by default in Ubuntu 10.10), but it’s available and it works just fine). All but Teamviewer was installed through the Ubuntu Software Center. All extra pieces of software work just fine.
Except for the data that I needed to copy from my old laptop, the machine was ready to roll. Well, copying the data was just a matter of copying over all files (no hidden files!!!). It was as easy as installing the SSH package on the old one. This allowed me to open my old machine from within my new machine by selecting Locations -> Connect to server – SSH, and copying all files from the old home directory to the new home directory. Next, for Firefox, I exported my bookmarks from within Firefox (Bookmarks -> Manage Bookmarks -> Import / Export). And finally, passwords that I stored in my old Firefox and that I did not want to reset in my new Firefox were transferred with Firefox Password Exporter. I have been using this machine now with Ubuntu for about two weeks. Never ever needed to use Windows 7 on it, never ever will.
Moving to a new computer (2)
cont. from previous post: Moving to a new computer (1)
In the posts “Moving to a new computer” , I describe situations that I encountered, while reconfiguring a brand new Toshiba laptop from Windows 7 to Ubuntu 10.10 x64.
Because Windows 7 is almost worthless for me, and because of the fact that it made my wireless box hang after five minutes, I decided to do the reconfiguration of the machine to Ubuntu x64 as soon as possible, but making it dual-boot, should the installation of Ubuntu not be successful . However, before starting the installation of Ubuntu 10.10, I needed to be sure that I could revert to the original situation, should anything happen during the installation. So I wanted to make some images of the C and the D drive. Well fortunately (I thought), there was a copy of Nero preinstalled on the machine, with the ability to make images of a drive…at least, the program had that feature, I saw it…clicking on it, a popup told me that that feature was only available after really buying the program (which I didn’t). So much for Nero. Fortunately, free software Clonezilla has exactly the same possibilities as any other commercial cloning program, it just comes with no warranty. If you can live with the fact that Clonezilla has no gui (it’s text screens based), then you can do with Clonezilla anything you want. Just burn your Clonezilla iso file to CD, start your computer with the CD, and follow the guide. Attach e.g. a big USB drive during usage of Clonezilla for you images. It will be recognized immediately, and you will be able to make a clone of your hard drive without any commercial hardware.
During this phase, however, Clonezilla found one bad sector on the D drive, and I got a warning that the cloning of the D drive would fail. I did not want to take the risk, so in the end, I just made some basic copies on two DVD’s through a Toshiba program that came with Windows. I tested the DVD’s, they seemed to do their job…so I started the installation of Ubuntu 10.10.
I had already downloaded the Ubuntu CD from the Ubuntu download site, and burned the ISO on CD. Well, what a progress in the installation method ever since previous Ubuntu installation procedures (which were already very easy). Some very fine features that I really liked:
- the installation software does some prerequisite checks, amongst which: is there enough space on the hard drive? are we on AC power? Do we have a connection to the Internet?
- the installation CD already allows you to choose whether or not you want to install some extra, non-free packages (flash, etc. etc.) during the installation.
- for time adjustment during installation, the system auto-detects the country where you live..and thus, your time zone settings are automatically set up correctly.
During installation, I decided to remove the (worthless) D partition, and to leave the C partition but to shrink it to 25 GB; the Windows partition would be at the starting point of the disk, leaving the rest of the disk free for Ubuntu. I created a /boot mount point as a small ext2 partition, a swap partition of 2 GB; the rest was allocated to the root (/) partition as ext3.
Installation of Ubuntu 10.10 with the CD worked without a flaw….until I rebooted the computer at the end. After restarting the computer in Ubuntu, the only thing I saw on a black screen was a kernel message, complaining about a Realtek wifi driver. Ubuntu just did not start well at first. Well if you’re ever in that situation: just don’t panic. The only thing that I needed to do, was to start Ubuntu just once in Rescue mode. Since I had configured the machine as dual boot…I had a boot menu where I could easily choose this option. With a network cable plugged in, in a fine, text based rescue menu, I just had to choose the option: “fix broken packages”. With this action, all packages were updated to the newest, and also to a new kernel. After that was done…my Ubuntu x64 machine was just ready to roll. And really no, my Wifi box never ever complained once.
On this dual boot machine, my Windows installation still needed to be tested. Well, it was not bad at all. Just one blue screen because of the resizing of the hard disk. Then booting once into rescue mode F8), and Windows discovering all by itself that the partition had been reduced to 10% of the original size. Working just fine as well. Will I ever use Windows on this machine? I guess not.
Time to check whether all peripherals (which worked fine in Windows, except the Realtek wifi controller) would also work in Ubuntu 10.10 x64. To be continued.
Moving to a new computer (1)
In the posts “Moving to a new computer” , I describe situations that I encountered, while reconfiguring a brand new Toshiba laptop from Windows 7 to Ubuntu 10.10 x64.
The last couple of weeks, I had a problem with a stuck key on my old Dell laptop. It was a physical damage and the laptop was out of warranty. So the problem could only be solved either by using an external USB keyboard, or by acquiring a new machine. Via the company that I work for, I got a very beautiful Toshiba Satellite L670-1DT. It’s a machine with a 500 GB hard drive, two partitions (C and D drive, each about 250 GB), 3 GB of RAM, a Pentium P6100, a big 17,3″ screen, a Realtek Wifi controller and a built-in webcam. It comes preinstalled with Windows 7. My goal was to install a recent 64 bit Ubuntu on this machine. I decided to go for Ubuntu 10.10 x64. Although I do have quite some experience with Suse Linux 64 bit, I never installed its counterpart 64 bit Ubuntu. So, since I did not know yet what to expect, I decided to keep the Windows 7 C partition, but to shrink it to a minimum (25 GB), to remove the D partition, and to install Ubuntu on the remaning 475 GB. This was just a precaution: since installing Ubuntu 10.10 on it, I never ever once touched the Windows 7 installation again.
This next couple of blog entries will deal with the things that I found out during the short usage time of Windows 7 on this machine, about the reconfiguration of the machine to Ubuntu 10.10, and about the data migration process from my old laptop to my new machine.
So let’s start with the beginning in this overview: the short time that I used Windows 7. I used Windows 7 (Home Edition) about 72 hours. Let’s face it: Windows 7 is good looking, it’s attractive. However, I encountered a problem on this (preinstalled!!!) Windows 7 computer that I just do not have with Ubuntu 10.10 on this new machine, since I installed it. After having booted the machine in Windows 7, it would just take a maximum of 5 (five!!!) minutes before my Wifi box at home would just hang, and prohibit any connection to the Internet. My wireless box is nothing special. It’s just a box from Online (http://www.online.nl). Powering the wireless box off and powering it on again would solve the problem for just five minutes maximum. Thank you mr Gates for a preinstalled Windows 7 OEM. Ubuntu, at least, does not hang your wireless box at all. To be continued.
Pimping your Ubuntu machine with gnome color chooser
This article applies to Ubuntu 9.10 (and maybe later versions as well)
Today, I just felt like pimping one of my Ubuntu machines. Spring is in the air today, and I wanted to have all items as green as possible, including the Gnome Applications menu. So I just started googling around. Entering as keyword things like “modify gnome start menu colors” and all that kind of things, I first found nothing more that discussions about editing a config file .gtkrc-2.0. Well it’s not the fact that I do not know how to edit or create a config file, but I thought: wow, here we are again, creating and editing config files: that’s not what most people want. Somewhat later, I found a package called Gnome Color Chooser. It’s installable through Synaptic (System -> Administration -> Synaptic Software Management, or whatever it is called in your native language). In the search field, enter gnome color chooser. Install the package. After installation, goto System -> Preferences -> Gnome Color Chooser. Now you’re ready to pimp your Ubuntu desktop! Have fun!
Excel annotations in OpenOffice.org and LibreOffice: a simple solution for an annoyance
OpenOffice.Org and LibreOffice are outstanding office productivity suites that can compete with any version of Microsoft Office. Both are available for Windows, Mac and Linux. On my laptop though, first with OpenOffice and, later on, with LibreOffice, I had an annoyance that I needed to solve: when opening documents that were originally created in Excel, and when seeing that a text annotation was made in a cell, I was able to see that the annotation was there. But I just couldn’t read its content. It was just as if the contrast was not high enough to allow the text in the annotation to appear. Now if you’re ever in that situation, just do the following. In your Open- or Libreoffice program, click on Extra -> Options -> Appearance. Look for “Annotations background” and change the default setting (some kind of yellow) to anything else. The color of the annotation should now change to the new color, and you should be able to see the text in the annotation. Now save your imported Excel file just in the original format (xls), and close OpenOffice. Re-open the file. The annotation color should be the new color, and you should be able do see the Excel annotations quite normally. Check it out!




