Howto- NumLock on by default in Linux

If you prefer that the NumLock is activated automatically when you turn on your computer, then follow the instructions in this post.

Install the package  numlockx :

– For ubuntu and other debian based

sudo apt-get install numlockx

– Fedora and other rpm based

yum install numlockx

– Now edit  /etc/gdm/Init/Default   and  inert the bellow  code.

sudo vi /etc/gdm/Init/Default

and insert this lines:

if [ -x '/usr/bin/numlockx' ];
 /usr/bin/numlockx on
 save , exit

Is done.

  • Jay Ro

    Um… this is a BIOS setting. It’s not like Linux turns off NumLock during the boot process.

  • Sergio Chiodi Yamato

     For ubuntu 11.10 and above
    sudo gedit /etc/lightdm/lightdm.conf

    you see this

    greeter-setup-script=/usr/bin/numlockx on (add this line)
    Save and restart.

  • theAntiBob

     that is incorrect
    SOME bios’ have a numlock on by default setting
    linux (x11/xorg, gdm/kdm/lightdm, etc) has it’s own setting for numlock status

  • theAntiBob

     NEVER use sudo for gui based commands
    use gksu/gksudo for gnome/ubuntu
    use kdesu for kde/kubuntu
    /root should not – does not need piles of gui settings