How to speed up Ubuntu on a Low-End computer?

If you think your Ubuntu box is slow. You may want to give Xubuntu a try.

I have a Ubuntu box on a relative old (5+ years) laptop (HP dv1000, Pentium Celerom M + 512MB ram). I mainly use it for lightweight activity such as office and web browsing. Recently, I put this laptop in my kitchen, which required connecting to an external monitor. I found that when I am in graphics mode, the overall system was getting slow.

After some investigations, I have the following conclusions:

  1. The native resolution of the laptop graphic card is 1024×900. Since I connected it to an external monitor (1680×1050), it required more CPU and memory from the system. (It is an integrated graphic card, and it does not have any memory on its own.)
  2. The Ubuntu uses Gnome desktop, which uses more resources and it is not optimized for low-end machine.
 

So I have few options –

  1. Go back to Windows (Guess what, a clean Windows XP runs even much faster than Ubuntu)
  2. Install other high performance system such as FreeBSD
  3. Stick with Ubuntu, but uses a different window manager.
 

I do not prefer the first option because I like to keep a distance from Microsoft product. For the second option, I normally prefer using FreeBSD as a server rather than desktop because of the hardware driver issues. Therefore, I decide to go with the third option. That will minimize the change and impact.

Ubuntu comes with two otherĀ siblings, Xbuntu and Kbuntu. Basically, these three systems share the same core, but with different themes, i.e., window manager:

  1. Ubuntu: Gnome
  2. Xubuntu: Xfce
  3. Kubuntu: KDE
 

I have tried these three window managers before. Here are their rankings in terms of fanciness, beauty, and resource consumption:

KDE > Gnome > Xfce

So I decide to give Xubuntu a try. After installing Xubuntu, I found that the overall system is a lot faster and smoother. I know that I’ve made a good decision.

FYI, if you need even more speed, consider to install Window Maker. It is even faster than Xfce!

–Derrick

Our sponsors:

How to Install FreeBSD on Sun Blade 100

Recently, I received a Sun Blade 100 as a gift. After doing some research on which OS is the best for this machine, I decide to go with FreeBSD. So, my journey with Sun began here.

I only used Sun/Solaris in my engineering courses in college, I don’t have much experience with Sun hardware. I assumed that the experience should be similar – I was wrong.

So, here is what I have: A Sun Blade 100 connected with a regular USB PC keyboard. Note that Sun comes with its own keyboard, which has additional keys like STOP.

Anyway, after downloading the image of FreeBSD 8.1 Sparc64 and burning it into a DVD (You can burn it on any OS), I tried to boot the machine from DVD (Note that Sun Blade was release in 2002. You may need to verify that it is a DVD reader. You can replace the CD reader by any IDE DVD reader if needed.). And I received the following error messages:

Boot device: net  File and args:
Timeout waiting for ARP/RARP packet
Timeout waiting for ARP/RARP packet
Timeout waiting for ARP/RARP packet
Timeout waiting for ARP/RARP packet
Timeout waiting for ARP/RARP packet

Apparently, this machine does not know how to boot from CD/DVD automatically. After reading 20 posts, I finally got a solution:

If you have a Sun Keyboard:
1.) Push the power button to turn on the machine
2.) Pressing STOP and A key together

Otherwise:
1.) Push the power button to turn on the machine
2.) After the beeping sound, push the power button twice in a short time.

After trying it for few times, I finally got into the OpenBoot:

Aborting auto-boot sequence.
ok

So, I want to boot from CD:

boot cdrom

That’s it. The installation of FreeBSD on Sun is pretty much the same as on PC, except that the color of the installation menu looks a little bit weird.

If you experience any difficulties on booting from CD, make sure that both harddrive and DVD drive are jumpered to Cable Select, also you can verify the connections by running this command in the OpenBoot:

probe-ide

which will return something like:

Device 0 (Primary Master)
   ATA Mode: XXX
Device 1 (Primary Slave)
   Removeable ATAPI Model: YYY

Now you can install FreeBSD on your sparc64 machine!

Few things I’ve learned from running FreeBSD on Sun Machine (Sparc64)

  • Sun Blade 100 uses ECC (Error Correction Codes) memory. It doesn’t like the regular desktop memory.
  • Sun Blade 100 is old, the CPU speed is equivalent to Pentium II. It takes a long time to compile applications from ports. I recommend to install the applications using pkg_add first, and then run portmaster to update all apps. It will save you lots of time.
  • freebsd-update does not work on sparc64 machine. If you want to upgrade the FreeBSD system, you need to rebuild the kernel.
  • Sun Blade 100 is a heavy duty snail. For example, it can handle lots of inquires at the same time without crashing, but the processing speed is extremely slow. I don’t recommend using it for any applications that use more than 10% of CPU resource, e.g., Webserver (dynamic content), Database or Web Framework. I tried running all of my websites (including this blog) on Sun, which resulted terribly slow. My recommendations: Firewall, Router, Load Balancer.

That’s it! Have fun with Sun + FreeBSD.

–Derrick

Our sponsors:

Package ssh is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

Today, I helped my friend to install Debian. It was done via two GUI remote desktop connections (i.e., slow), and therefore I would like to access the server via SSH. So I tried to install the SSH package:

sudo apt-get install -y ssh

and I received the following message:

Reading package lists... Done
Building dependency tree... Done
Package ssh is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Actually this is a very easy problem. Debian tries to download SSH from the package source (defined in /etc/apt/source.list) but the package (SSH) is not available. To solve this problem, we can simply edit the source list:

sudo nano /etc/apt/source.list

and insert (if not exists) or update (if exists) the following links into your file:

deb http://ftp.us.debian.org/debian/ lenny main contrib non-free
deb http://security.debian.org/ lenny/updates main contrib non-free

Since we’ve update the package source list, we need to update the package database of the system:

sudo apt-get -y update

Now we can install the package again:

sudo apt-get install -y ssh

and upgrade the entire system (optional):

sudo apt-get -y dist-upgrade

Have fun with Debian.

–Derrick

Our sponsors:

XAMPP: Error 1! Couldn’t start Apache! … Sorry, I’ve no idea what’s going wrong.

Today I helped my friend to install XAMPP on a Debian system. When I tried to start the Apache webserver, I got the following message:

#/opt/lampp/lampp startapache
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Error 1! Couldn't start Apache!
XAMPP: Starting diagnose...
XAMPP: Sorry, I've no idea what's going wrong.
XAMPP: Please contact our forum http://www.apachefriends.org/f/

This problem is likely related to your Apache configuration file. To drill down to the root of the problem, we can take a look to the Apache error log:

tail /opt/lampp/log/error_log

and it should give you some info on how to solve this computer problem.

–Derrick

Our sponsors:

Update for xz-4.999.9_1 failed

Recently, I tried to upgrade the installed port on my FreeBSD:

portmaster -Da

and I got the following message:

===>>> Launching child to update xz-4.999.9_1 to xz-5.0.0

===>>> Port directory: /usr/ports/archivers/xz

        ===>>> This port is marked IGNORE
        ===>>> is already in the base system

        ===>>> If you are sure you can build it, remove the
               IGNORE line in the Makefile and try again.

===>>> Update for xz-4.999.9_1 failed
===>>> Aborting update


===>>> You can restart from the point of failure with this command line:
       portmaster  ports-mgmt/portmaster

I google it and someone suggested to do the following:

Just run a

portmaster -e xz-4.999.9_1

And say yes to the prompt. 

Don’t do it!
I tried that and the nightmare began. It will first ask you whether you want to remove xz. Then it will go through every package that depends on xz, and ask you whether you want to delete them or not. If you accidentally click yes, your system will get into trouble.

Instead, try to deinstall it from port:

cd /usr/ports/archivers/xz
sudo make deinstall

This is a lot safer.

Our sponsors:

MySQL: Starting MySQL….. ERROR! The server quit without updating PID file

This step-by-step guide is mainly for FreeBSD, however the idea is the same for Linux. Every once a while, when I update my FreeBSD box, the system likes to shutdown my MySQL server. Therefore, I need to start it again after the update is done. Unfortunately, the upgrade process is not smooth every time. Sometimes it will throw me some error.

/usr/local/etc/rc.d/mysql.server start

Oh well, I got the following error messages:

Starting MySQL..... ERROR! The server quit without updating PID file.

Sometimes, the message will tell you the exact location of which PID file:

Starting MySQL..... ERROR! The server quit without updating PID file (/var/db/mysql/www.icesquare.com.pid).

There are several solutions to troubleshoot these problems. I will go over each one by one.

Solution 1: Reboot The Computer

Although it sounds simple, but it really works. During the system upgrade, the OS may disable some of your daemons. Instead of troubleshooting each one by one, the easiest way is to start everything over. For example, I experienced this problem today after upgrading the Apache and Ruby (Yes, MySQL is not part of the update), and I got this error message afterward. After rebooting the computer, the error message is gone.

Solution 2: Remove Your MySQL Config File

If you have modified your MySQL configuration file, MySQL may not like it few versions after (MySQL is not backward compatibility friendly). It can be the problem of using an unsupported variable, or something similar. The easiest way is to remove your configuration file, and try to start the MySQL server again:

Backup your MySQL configuration first.

mv /etc/my.cnf /etc/my.cnf.backup

And restart the MySQL server again:

/usr/local/share/mysql/mysql.server start

Hopefully you will see the following message:

Starting MySQL. SUCCESS!

Solution 3: Upgrade Your Database File

Sometimes, the newer MySQL doesn’t like the database created in earlier version. I discovered this when I upgrade to MySQL 5.5.7:

Starting MySQL..... ERROR! The server quit without updating PID file (/var/db/mysql/www.icesquare.com.pid).

Since MySQL tells me which PID file causes the problem, I open the file and take a look what’s going on:

sudo tail /var/db/mysql/www.icesquare.com.err

And I saw something interesting: tables: Table ‘mysql.proxies_priv’ doesn’t exist:

101112 10:49:16  InnoDB: Initializing buffer pool, size = 128.0M
101112 10:49:16  InnoDB: Completed initialization of buffer pool
101112 10:49:16  InnoDB: highest supported file format is Barracuda.
101112 10:49:17  InnoDB: 1.1.3 started; log sequence number 1589404
101112 10:49:17 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.proxies_priv' doesn't exist
101112 10:49:17 mysqld_safe mysqld from pid file /var/db/mysql/www.icesquare.com.pid ended

The reason is very simple. MySQL could not open a table created in the earlier version (< 5.7.7) because it is not compatible with the current version. So, we can try to start the MySQL in safe mode through rc.d. First, you can edit the /etc/rc.conf and put the following into the file:

mysql_enable="YES"
mysql_args="--skip-grant-tables --skip-networking"

Restart MySQL through rc.d:

/usr/local/etc/rc.d/mysql-server start

If you did it right, you should see something like the following:

Starting MySQL.. SUCCESS!

Now, MySQL is already running the safe-mode. We want to perform a MySQL upgrade on all tables:

sudo mysql_upgrade

You should see something like this:

Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql.sock'
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql.sock'
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.general_log                                  OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.host                                         OK
mysql.ndb_binlog_index                             OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.servers                                      OK
mysql.slow_log                                     OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user                                         OK
Running 'mysql_fix_privilege_tables'...
OK

Now, we want to switch the MySQL back to normal mode by commenting the extra options in /etc/rc.conf:

mysql_enable="YES"
#mysql_args="--skip-grant-tables --skip-networking"

And restart MySQL through /etc/rc.d:

/usr/local/etc/rc.d/mysql-server restart

Now the MySQL is up and running again!

Happy MySQLing.

–Derrick

Our sponsors: