Category Archives: PlanetHantsLUG

Arch Linux, XFCE, and UK Keyboards

I know Arch Linux doesn't hold your hand like other distros do, but I think it could make setting the keyboard layout easier.

Firstly, set the locale in rc.conf:

    ...
    KEYMAP="uk"
    LOCALE="en_GB.UTF-8"
    ...

and then reboot.  Reboot?  Surely there's a better way, but I don't know what it is.

Edit /etc/locale.gen to uncomment the ones you want to use — en_GB.UTF-8 and en_GB in my case.

Then you can run

    # locale > /etc/locale.conf

For 'normal' sorting of ls listings etc., edit /etc/locale.conf and set

    LC_COLLATE="C"

That should sort things out on the console.

For XFCE, it's tricky because the Applications Menu / Settings / Keyboard seems to be ignored.  So refer to https://wiki.archlinux.org/index.php/Xorg#Setting_Keyboard_Layout_With_Hot-Plugging and add this to /etc/X11/xorg.conf:

    Section "InputClass"
        Identifier             "Keyboard Defaults"
        MatchIsKeyboard        "yes"
        Option                 "XkbLayout" "gb"
    EndSection

and restart X.

Arch Linux — updating Perl from 5.14 to 5.16

Recent updates (in June 2012) to Arch Linux replaced Perl 5.14 with 5.16.

Imagine my surprise when Perl scripts (including cpanp) suddenly stopped working.

I asked about the problem on PerlMongers and the Arch Linux forum, and did the following to solve it:

  • Delete all files under /usr/bin/site_perl, /usr/lib/perl5/site_perl and /usr/share/perl5/site_perl to remove the duplicates installed by the cpan shell.
  • Rebuild all AUR packages that contain perl XS modules. This will print them out:
    sudo pacman -Qml | awk '/_perl/auto/.+.so$/ { print $1 }' | uniq

    (There weren't any on my system.)

  • Reinstall perl-cpanplus-dist-arch
  • Run cpanp to install the Perl modules that aren't available on Arch or AUR, for example:
    sudo cpanp -i Math::Combinatorics

Which seems to have done the job.

Static ddrescue

GNU ddrescue is an excellent tool for recovering files from failing hard disks.

The source code can be downloaded and is easy to compile.  But it's most useful if statically-linked, creating a Linux executable file that can run on its own without extra libraries — from a live CD for example.

To create a statically-linked version, run this instead of the usual ./configure:

./configure LDFLAGS=-static --no-create

Then run make in the normal way.