Tuesday, August 11, 2015

Setting the keyboard and language RHEL and CentOS 7 command line

Setting the console keyboard RHEL and CentOS 7

When transferring VMs and systems built in one locale to another the keyboards become a problem.  In the earlier versions of Linux we simply changed a symlink or edited the /etc/sysconfig/keyboard file, but as of version 7 we now have to use localectl or edit the correct files to make the change permanent.

Having read various pages scattered across the Internet a lot of them talk about using the localectl command to change your keyboard and locale settings for a console installation.  However, the localectl command did not update the console keyboard and things such as the | key didn't work when changing from UK to US locale.  Even after a reboot the keyboard would still be wrong.

So how do you get the keyboard changed for the console in RHEL and CentOS 7 permanently?

Persistant Changing The Keyboard and Locale

Here we will assume that the system is currently set to en_GB.UTF-8 and uk keyboard.

1. Edit the /etc/locale.conf file and make sure the following is in it;
LANG="en_US.utf8"

2. Edit the /boot/grub2/grub.cfg file and change
vconsole.keymap=uk    change to    vconsole.keymap=us
Do that for all occurrences, a quick method is;
sed -i 's/vconsole.keymap=uk/vconsole.keymap=us/g' /boot/grub2/grub.cfg

3. Edit /etc/sysconfig/grub and change
vconsole.keymap=uk    change to     vconsole.keymap=us
Like step 2 you can use sed to perform the change as follows;
sed -i 's/vconsole.keymap=uk/vconsole.keymap=us/g' /etc/sysconfig/grub

By doing these steps and then rebooting your system your keyboard and locale would set itself to the new locals for the console.

Sunday, August 9, 2015

Fedora 22 - What a mess!!!!

Well, having done the fedup upgrade, and a fresh install of Fedora 22, I must say I am extremely disappointed.  It's like having taken a backward step into the dark ages of the early days of Sun OS (when they used to re-write the OS from scratch).  What did you do guys?  Fedora 20 was the easiest and by far the fastest of the versions to date, both to install and to use.  Today I have lost days trying to get Fedora 22 to work from my nice stable Fedora 20, and boy have you messed it up.  Are you trying to lose people to the Debian side?  I hope you don't try to put any of this into RHEL 8 otherwise you'll lose them a major market share.

The problems;
1. First WTF - you do an fsck on every partition and disk, making us wait days before we can go and select the disks we want to use for the installation.  There are many complaints I see out their about slow installations and people blaming anaconda for kernel issues, when clearly you decide to run an fsck on every disk and partition.  I have 1TB of  disk space partitioned across about 6 or so partitions, this took nearly 1 hour before I could continue the install, and only found out by monitoring the processes and running strace on what you were doing.  COME ON - we're supposed to install sub 20 minutes, not take 3 hours to do an install.

RECOMMENDATION: Shoot the person who created the new installer.  Do they work for Microsoft or something?  A spy in the camp perhaps?

2. The fedup upgrade messed up the audio big time.  Instead of being able to plug in and out a head set I find that the audio recording works fine as long as you don't plug in an external headset, or unplug it if you booted it with the headset in.  The weird thing is that when you do this it for some reason decides to only record the last second or so of what you recorded last!  Another WTF moment, when Fedora 20 worked perfectly fine with plugging in and out a headset between the built-in and external jack sockets.
I'm still working on what the cause of this is, since I have to remember to boot my system with the headset in if I want to use it for recording or using skype, since as soon as I unplug I have no microphone capability.  The output audio is working (but only after installing from scratch).
This is without mentioning the freezes and hard reboots.

RECOMMENDATION: Use the driver code that worked previously for older kit, and add to it, not destroy it.

3. Although FedUp is a nice way of getting your system up to date, it unfortunately has the same problems as with any upgrade - existing files.  I'm a stickler and even more so for keeping my system config files in a directory of their own and symlinking to them.  So that way I can do a fresh update and a diff if need be to work in the new, and of course a good partitioning scheme.

4. Slow start up and shutdown.  Another backward step, thanks guys.  How slow do you really want this system to be?  I'm using an SSD and F20 came up faster and shutdown a lot quicker (apart from the pulse audio process that would take ages to stop if you didn't log out before shutting down).  Now, I don't know what you're doing, but come on, if the system doesn't shutdown in less than 30 seconds I want to know what you're playing at.

5. The Live image is a nice image, although takes ages to start up from USB, and too long for the installer, but it works nicely with audio and everything.  So why when I install it does it then break everything?

  • I'm forced to create a new user as any old GNOME configs cause the log in screen to break, that's if you can get to the login screen.
  • The login screen might not even appear - until after you update the system, which you have to do from single user mode since the whole damn system hangs at the login screen or before.
  • After the update you can eventually get to the login screen, and start to get your system working, but don't take any of your old GNOME config, apart from specific applications
What I want to know is why you don't just transfer the working image directly to the hard disk?  If it works on the USB it should work exactly the same after I install to hard disk.  But oh, no.


On going work
Only a few points so far, as I've only just got 22 working today from a fresh install, and so far NOT impressed.  If the developers at Fedora keep going in this direction I will almost likely move to Debian, which for me would be a nightmare as since 1996 I've been a RedHat fan and promoted it everywhere with its stability and resilience, but all of a sudden we seem to be leaking crap into the development of the system and as an S.A. and infrastructure builder, would not currently be encouraging people to use the next RHEL 8 (if it's going to be based on this) into their environments.

Be warned!
So a warning to you all, don't believe what these magazine writers (online or otherwise) tell you.  If you do this stuff for real and use it every day for your main operating system, I would give F22 a miss, and wait until they can make it faster, other wise like me you will lose a day and a half of your life debugging the crap that has recently made the best operating system one that will quickly slip away if it continues on this path.

Update as of 1st September 2015
Having had F22 running for a few weeks now I've swapped gdm for kdm, and as per F20 improved boot up and shutdown speeds immensely. GDM has become so complex that the speed of start up and shutdown is painful. For those of you wanting to get back to an O/S that boots up and shutdown faster than windows or mac then i recommend changing to GDM but still using gnome for its features.