Friday, October 21, 2011

Google Chrome (Chromium) font anti-aliasing is wrong on LXDE (L)Ubuntu Oneiric (11.10)

The solution was to add the following in the ~/.fonts.conf 

xml version="1.0"?>DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
 <match target="font">
  <edit mode="assign" name="rgba">
   <const>noneconst>
  edit>
 match>
 <match target="font">
  <edit mode="assign" name="hinting">
   <bool>truebool>
  edit>
 match>
 <match target="font">
  <edit mode="assign" name="hintstyle">
   <const>hintslightconst>
  edit>
 match>
 <match target="font">
  <edit mode="assign" name="antialias">
   <bool>truebool>
  edit>
 match>
 <match target="font">
   <edit mode="assign" name="lcdfilter">
    <const>lcddefaultconst>
   <edit>
 <match>
</fontconfig>

One may have to play around with the "hintstyle" to get it right. The available options are:
  • hintslight
  • hintmedium
  • hintfull
  • none

Wednesday, October 19, 2011

Ubuntu Oneiric (11.10) DPKG error removing old Linux kernel

I stumbled into another trouble removing my obsolete packages after upgrading into Ubuntu Oneiric 11.10 with Linux kernel 3.00-12. The problem is with removing the old 64bit kernel 2.6.35-24. The Debian package name is 2.6.35-24. The error I got is following:
[13:41:34] user@machin:[/var/lib/dpkg/info]$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following packages will be REMOVED:
  linux-image-2.6.35-24-generic
0 upgraded, 0 newly installed, 1 to remove and 31 not upgraded.
1 not fully installed or removed.
After this operation, 139 MB disk space will be freed.
Do you want to continue [Y/n]?
(Reading database ... 248250 files and directories currently installed.)
Removing linux-image-2.6.35-24-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 2.6.35-24-generic /boot/vmlinuz-2.6.35-24-generic
update-initramfs: Deleting /boot/initrd.img-2.6.35-24-generic
run-parts: executing /etc/kernel/postrm.d/zz-extlinux 2.6.35-24-generic /boot/vmlinuz-2.6.35-24-generic
P: Checking for EXTLINUX directory... found.
P: Writing config for /boot/vmlinuz-3.0.0-12-generic...
E: /usr/share/syslinux/debian/extlinux: No such file or directory
run-parts: /etc/kernel/postrm.d/zz-extlinux exited with return code 1
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-2.6.35-24-generic.postrm line 328.
dpkg: error processing linux-image-2.6.35-24-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-2.6.35-24-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
The highlighted lines told me the error is caused by the postrm script called zz-extlinux located in /etc/kernel/postrm.d/. I don't know how I managed to have extlinux installed on my system. If I am not mistaken booting is still managed by grub-2. So, I decided to remove both extlinux and linux-image-2.6.35-24-generic. But, since my DPKG is already going crazy removing linux-image-2.6.35-24-generic and failing on zz-extlinux, I have to remove the old Linux image first. I quickly patched the zz-extlinux script with an "exit 0" at top followed by an "sudo apt-get -f install". One could also make it non-executable as following as a solution, followe:
sudo chmod -x /etc/kernel/postrm.d/zz-extlinux; sudo apt-get -f install
This solved my problem removing the Linux image. Now, I guess one can also remove extlinux considering Grub-2 is the bootloader.
sudo apt-get remove --purge extlinux

Tuesday, October 18, 2011

Changing Gnome-Screensaver Background on Lubuntu 11.10 (Oneiric)

I had to find a way on Lubuntu flavoured LXDE to lock/unlock the current running desktop session. The obvious easy way is to use xscreensaver and/or gnome-screensaver and do one of the following:
xscreensaver-command -lock
gnome-screensaver-command --lock
I chose to keep with gnome-screensaver since it is prettier. But immediate annoyance was after locking screen, gnome-screensaver would not retain the same background as current Lubuntu session. After trying so many options (gconf, editing files in /etc), finally I figured - the solution is rather easy.

It appears Lubutu session keeps a separate sets of options from LXDE. When gnome-screensaver is launched, it takes the background option of LXDE (not Lubuntu). To match same background both on LXDE and Lubuntu, which also matches gnome-screensaver background inside Lubuntu session, the steps are below:
  1. Set preferred desktop background on running Lubuntu session by right-click > Desktop Preferences > Background.
  2. Log-out from Lubuntu session.
  3. On the log-in prompt, select LXDE as desktop session to log into.
  4. Once inside LXDE, you'll see the desktop background that gnome-screensaver uses as background.
  5. From the right-click menu, change the background to match your preference.
That's all !!! Now, you can log in back into Lubuntu and lock screen by initiating gnome-screensaver (I use a Compiz command shortcut with Ctrl+Alt+L which triggers "gnome-screensaver-command --lock") and desktop background will match.

Ubuntu Oneiric 11.10 - problem with package dictionaries-common

I started getting troubles with dictionaries-common package right from the beginning of upgrading into Ubuntu Oneiric (11.10). The error message looks kind of like the following:


Setting up dictionaries-common (1.11.5ubuntu1) ...
update-default-wordlist: Question empty but elements installed for class "wordlist"
  dictionaries-common/default-wordlist: return code: "0", value: ""
  Choices: , Manual symlink setting
  shared/packages-wordlist: return code: "10" owners/error: "shared/packages-wordlist doesn't exist"
  Installed elements: american (American English)
  Please see "/usr/share/doc/dictionaries-common/README.problems", section
  "Debconf database corruption" for recovery info.
update-default-wordlist: Selected wordlist "" 
does not correspond to any installed package in the system
and no alternative wordlist could be selected.
dpkg: error processing dictionaries-common (--configure):
 subprocess installed post-installation script returned error exit status 255
dpkg: dependency problems prevent configuration of xscreensaver-data-extra:
 xscreensaver-data-extra depends on dictionaries-common; however:
  Package dictionaries-common is not configured yet.
dpkg: error processing xscreensaver-data-extra (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
 dictionaries-common
 xscreensaver-data-extra
E: Sub-process /usr/bin/dpkg returned an error code (1)

May be I was too quick to have skimmed over the error message and did not realize what is missing. It looks like the problem actually is that I do not have any word-list installed (or, somehow uninstalled during the distribution upgrade process) on my machine for the dictionary to point to. The quick solution is to install the preferred word-list as following:
sudo apt-get install wamerican-insane
 This should remove fix the package installation error with dictionaries-common package.


Compiz Config Settings Manager (CCSM) crashes with SIGSEGV on (L)ubuntu Oneiric (11.10)

On my latest Lubuntu 11.10 installation, CCSM stumbles into a segmentation violation (SIGSEGV) if "Desktop Cube" is enabled in Compiz plugins and I try to disable it through CCSM. Since, I managed to convince myself that "Expo" is capable of providing what I really need, I needed a way to disable it without using CCSM. So, for my own future reference and someone who's going through the same kind of nagging crash, the Compiz config file is located here:
/home/$USER/.config/compiz-1/compizconfig/Default.ini
My list of enabled plugins are below:
 [core] 
s0_active_plugins = core;detection;gtkloader;composite;opengl;copytex;decor;mousepoll;commands;imgjpeg;regex;addhelper;annotate;resize;grid;compiztoolbox;place;imgsvg;imgpng;notification;dbus;gnomecompat;resizeinfo;opacify;wobbly;move;text;loginout;scale;animation;kdecompat;thumbnail;workarounds;scaleaddon;scalefilter;animationaddon;expo;ezoom;switcher;
All one has to do is remove "cube" (or whichever is causing trouble) from "s0_active_plugins".

LightDM Fails to Load with (L)ubuntu Oneiric (11.10)

After my migration from default Ubuntu with Unity and Gnome3 to Lubuntu with LXDE and OpenBox, I realized I have managed to sacrifice beautiful LightDM, the new default login manager on 11.10 and instead, running not so pretty LXDM.

After realizing that LightDM is missing the first thing to do was obviously:
sudo apt-get install lightdm
Followed by:
sudo dpkg-reconfigure lightdm
sudo service lxde stop
sudo service lightdm start
Not much to my surprise on 11.10, LightDM didn't start. After a little digging through the log files located at /var/log/lightdm, I came across the following:

"lightdm can not write to /var/lib/lightdm/.Xauthority"

Time to check /var/lib/lightdm directory:

[11:13:26] user@machine:[/var/lib/lightdm]$ sudo ls -alh
total 44K
drwxr-x---  9  109  130 4.0K 2011-10-14 20:08 .
drwxr-xr-x 74 root root 4.0K 2011-10-17 16:56 ..
drwx------  4  119  136 4.0K 2011-10-14 15:28 .cache
drwx------  4  119  136 4.0K 2011-10-14 15:28 .config
drwx------  3  119  136 4.0K 2011-10-14 15:28 .dbus
-rw-------  1  119  136   16 2011-10-14 15:32 .esd_auth
drwx------  2  119  136 4.0K 2011-10-14 18:29 .gconf
-rw-------  1  119  136    0 2011-10-14 19:55 .goutputstream-54JJ3V
drwx------  2  119  136 4.0K 2011-10-14 15:28 .gvfs
drwxrwxr-x  3  119  136 4.0K 2011-10-14 15:32 .local
drwx------  2  119  136 4.0K 2011-10-14 16:22 .pulse
-rw-------  1  119  136  256 2011-10-14 15:32 .pulse-cookie
-rw-------  1  119  136    0 2011-10-14 20:08 .Xauthority


After checking /etc/passwd and /etc/group, it confirmed that somehow user-id 119 and groupd-id 136 has gone missing from my system. So, as a quick roll-back, I did the following:

sudo apt-get remove --purge lightdm
sudo mv /var/lib/lightdm /var/lib/lightdm.bak
sudo apt-get install lightdm
sudo service lxdm stop
sudo apt-get remove --purge lxdm
sudo service lightdm start

Voila, LightDM showed up with a nice log-in prompt. Re-installing LightDM, added a new user and group with ids 109 and 130 respectively. Also, the ls output in /var/lib/lightdm looks correct.

[11:33:08] user@machine:[/var/log/lightdm]$ sudo ls -al /var/lib/lightdm/
total 44
drwxr-x---  9 lightdm lightdm 4096 2011-10-18 11:14 .
drwxr-xr-x 74 root    root    4096 2011-10-18 11:15 ..
drwx------  4 lightdm lightdm 4096 2011-10-18 11:14 .cache
drwx------  3 lightdm lightdm 4096 2011-10-18 11:14 .config
drwx------  3 lightdm lightdm 4096 2011-10-18 11:14 .dbus
-rw-------  1 lightdm lightdm   16 2011-10-18 11:14 .esd_auth
drwx------  5 lightdm lightdm 4096 2011-10-18 11:15 .gconf
d?????????  ? ?       ?          ?                ? .gvfs
drwxrwxr-x  3 lightdm lightdm 4096 2011-10-18 11:14 .local
drwx------  2 lightdm lightdm 4096 2011-10-18 11:14 .pulse
-rw-------  1 lightdm lightdm  256 2011-10-18 11:14 .pulse-cookie
-rw-------  1 lightdm lightdm   49 2011-10-18 11:14 .Xauthority



Edit (20 Jan 2012):
I stumbled into another problem with LightDM after uninstalling gnome-settings-daemon. It looks like the background file to set for LightDM is requested through gnome-settings-daemon for some reason on my system. So, if you have the same problem, a quick apt-get install gnome-settings-daemon will solve the problem.