Archive for the 'troubleshoot' Category

MySQL error 2002

This solves the following MySQL error:
Got error: 2002: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2) when trying to connect

You should try to investigate why this is happening. Still, a quick trick to fix it and can restore the missing sock is simply creating a symlink to the original one:
ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock

Reset GNOME Panel

So you are customizing the GNOME panel in order to access your favorite apps quickly and easily. While doing so, you can’t figure out how to get rid of some annoying icons or just can’t move the Menu Bar back to its initial position (the problem I was facing). Sometimes you just need to reset stuff.

Do the following:

  1. rm -r ~/.gconf/apps/panel
    This will remove the panel configuration, you can back it up first if you’re paranoid.
  2. Log out of GNOME (shortcut CTRL + ALT + BACKSPACE)
  3. Log back in and you’re done.

Mount a CD image to a directory

ISO CD images
Mounting a CD image in ISO format (eg. image.iso) is quite straightforward. Just execute the following in the terminal:
sudo mkdir /media/iso
sudo mount -t iso9660 -o ro,loop image.iso /media/iso

Other CD images
For other types of CD images such as NRG, BIN/CUE, MDF, CDI, CCD/IMG or C2D; you should first convert them to ISO and then mount them as described above. Fortunately, a nice and neat application exists for that purpose: KIso.

  1. First, install KIso by executing the following:
    sudo apt-get install kiso
  2. Open KIso by running sudo kiso. Now click on CD Image -> Convert Image and select the image (eg. image.bin) to convert.
    Convert image using KIso
  3. An ISO version of the image (image.iso) is now available in the original image’s directory. You can now execute the procedure described in ISO CD images.

KDE start up applications

If you’re using KDE and wish to have applications launched automatically on start up, you simply need to add an application launcher in ~/.kde/Autostart/. A simple and clean way of achieving this is to create a symlink of the application in ~/.kde/Autostart/

For example, assuming you want Skype to startup automatically, execute the following:
ln -s /usr/bin/skype ~/.kde/Autostart/skype

Slow Booting Up?

I’m running Ubuntu on a quite descent laptop configuration. Up to now, Ubuntu’s booting was taking around 3 minutes, a bit too long. After some analysis and research, I was able to reduce that to under 35 seconds. If you’re having a similar problem, the following procedure might be helpful.

  1. Install bootchart, a cool small application that allows you to see what’s happening on boot time.
    Type the following in the shell:
    sudo apt-get install bootchart
    This will create on each boot a log image in /var/log/bootchart/
    describing the runtime booting processes.
  2. Reboot your machine and check the created log image. In my case, the boot sequence looked as follows:
    Previous Booting Sequence
    Booting was taking 177 seconds.
  3. Analyse the log. We notice that usplash, a user application that draws a splash screen on boot (thus dispensable), seems to be consuming way too much CPU time, and for too long. A search on Ubuntu forums shows that usplash is a bit buggy, and that this boot problem is quite common.
  4. Disable the concerned process. For usplash, the following will do:
    sudo apt-get remove usplash
    Now reboot, and check the new created image log. In my case, it looks like that:
    Check Post-Mod Boot Sequence
    Down to 31 seconds!
  5. Remove bootchart if you don’t need it any longer, otherwise a log will be created on each boot. Execute:
    sudo apt-get remove bootchart

Important note: Don’t try to be smart and disable all boot processes (just in case you were thinking about that!). Make sure you know what you’re doing.

Kile spell checking

Kile is a top-notch KDE frontend LaTeX editor. Enabling spell checking for it requires a small trick if you’re running Ubuntu, which is Gnome based. Several options, including spell checking, for KDE applications are configured within the KDE control center. To get the job done, proceed as follows:

  1. First, you need to install the KDE control center
    sudo apt-get install kcontrol
  2. Then, open KDE control center by running the kcontrol command, navigate to KDE Components -> Spell Checker and set the spell checking Client to ASpell
  3. Spell checking will now be enabled next time you start Kile!

Kile LaTeX Editor

Create a symlink

In case you ever forgot how to create a symlink, here’s a simple example:
ln -s /home/user/applications/hello_world /bin/hw

/home/user/applications/hello_world can now be run as /bin/hw or more simply hw (since it’s in the /bin directory).

Is Gutsy Gibbon nothing but trouble?

So I’ve been using Ubuntu 7.10 (Gutsy Gibbon) for a couple of weeks now. In comparision to Ubuntu 7.04 (Feisty Fawn), I’m facing quite a few problems which I wasn’t able to solve or didn’t even bother to:
- Some applications are not running anymore, for some reason. Actually they’re running, but as soon as they’re loaded they automatically shut down; not error message or system crash or anything. Among other things: Azureus, some system tools (eg. System -> Administration -> Screen Graphics), and even the System -> About Ubuntu page (which is absolutely weird). A first diagnosis would lead you to uninstall and reinstall the applications in question, but the problem is definetly somewhere else (since system tools are affected). It’s probably some simple configuration-related issue (99.9%), or some very ugly bug (0.1%), caused by this release. SOLVED
- Wine is occasionaly giving me a headache particularly when it comes to changing the graphic resolution of an application running under it.
- No luck in getting Compiz Fusion to work.
- No Ubuntu 7.10 guide was setup yet on Ubuntu.com, that’s really annoying. I must refer to 7.04 everytime. I understand that the release is still fresh, and that it takes time for the community to get the docs together, I thus restrain myself to waiting, but still I feel something is missing. SOLVED – new docs available
- Flash Player 9 and Firefox = memory leak. This is a very serious error; for some flash content displayed in Firefox, the memory leaks continuously, until all your system ressources are sucked up and you have no other solution than to restart the browser, or ultimately the computer. This problem was really annoying, a big part of my effort went into debugging the flash SWF first; until I figured out this problem only occured on the comibnation Ubuntu 7.10 – Firefox. Reporting that bug on launchpad.

Labrat

Still, I must admit some things seem to have improved since my migration to Gutsy:
- On Feisty, for no particular reason, the screen sometimes just flickered and went blank (my guess would be something is going wrong with X11). In that case, the only solution was to reboot. I’m not experiencing that behavior anymore in Ubuntu 7.10 fortunetly.
- Performance has increased it seems, some application are running faster such (the kernel is in for something, thank you Linus!) such as Eclipse.
- No particular improvements though on Nautilus, it still occasionaly crashes and restarts itself.

Overall, I would suggest at that time not upgrading to Gutsy, particularly if you’re the average linux user. The smart thing to do, in my situation, would be to downgrade back to Feisty, but the process will involve backing up everything and reinstalling Ubuntu from scratch, which would consume very scarce ressouces: time and effort. Since I’m feeling like a lab rat (like any other Ubuntu enthusiast), I’ll stick to Gutsy and try to do my part in making it better.

Update
Lot has changed since I updated; new updates, applications, bug fixes and problems fixed. I am now quite satisfied with Gutsy!

Find out the version of Ubuntu installed

A quick tip in case you are wondering what version of Ubuntu you have installed. Just run the following in the console:
cat /etc/issue
I’m guessing this command is not that useful, but still worth to mention.

Annoying Unlock Keyring Dialog

Problem: so I have more than one wireless network in my neighborhood. I once tried to connect to another secure network which requires an authentication key and since every time ubuntu starts; i get this annoying Unlock Keyring dialog.

Unlock Keyring

To get rid of it, simply go as follow:

  1. From the GNOME panel, select System -> Administration -> Keyring Manager
  2. In the Keyring Manager windows, hit F9 (shows keyrings)
  3. Select the default keyring from the left panel; than Keyring -> Delete Keyring
  4. Confirm deletion. Tada!