Numlock NOT 'on' when booting

No matter what I tried, when booting to ubuntu 20.04 LTS I can have to press the numlock key twice before it turns on . How do I manage this if I want that numlock on when entering my password during start up ?

Any help is welcome .

Give this a shot.

I clicked on the link “How to enable numlock at boot time for login screen?”

Place command with init scripts

sudo sed -i 's|^exit 0.*$|# Numlock enable\n[ -x /usr/bin/numlockx ] 
\&\& numlockx on\n\nexit 0|' /etc/rc.local

but there is no /etc/rc.local file in ubuntu 20.04 LTS,

there are only resembling files under /etc/ :

drwxr-xr-x   2 root root   4,0K dec  3 13:10 rc0.d
drwxr-xr-x   2 root root   4,0K dec  3 13:10 rc1.d
drwxr-xr-x   2 root root   4,0K dec  3 13:10 rc2.d
drwxr-xr-x   2 root root   4,0K dec  3 13:10 rc3.d
drwxr-xr-x   2 root root   4,0K dec  3 13:10 rc4.d
drwxr-xr-x   2 root root   4,0K dec  3 13:10 rc5.d
drwxr-xr-x   2 root root   4,0K dec  3 13:10 rc6.d
drwxr-xr-x   2 root root   4,0K okt 28 09:16 rcS.d

next solution was :

Enabling NumLock from startx

If you are not using a graphical display manager then add the following line to /etc/X11/xinit/xinitrc

/usr/bin/numlockx on

But that was already there in my xinitrc file.

The next solution was :

Enabling NumLock from lightdm configuration

In Ubuntu 14.04 the above methods of running numlockx don’t work. It can be run by changing configuration of LightDM display manager. Edit /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf file and add the following line at the end:

greeter-setup-script=/usr/bin/numlockx on

there was no 50-unity-greeter.conf file, but a 50-ubuntu.conf file as only file
I edited that file and added the above line, with numlock staying off when rebooting .

the next solution was this :
Enabling NumLock for Virtual Consoles (TTYs)

If you use the virtual consoles regularly, then you will quite likely want to have numlock on for the TTYs after boot up. The status of numlock/scroll-lock/capslock can be manipulated with the setleds command. One way to guarantee that numlock will be turned on after bootup for the TTYs is to run setleds via rc.local (a script run after every runlevel change; which in particular runs after booting up). To do so add something similar to the following in the file /etc/rc.local

# Turn Numlock on for the TTYs:
for tty in /dev/tty[1-6]; do
    /usr/bin/setleds -D +num < $tty

But, again, as in the first solution, there is no /etc/rc.local file in my Ubuntu 20.04 .

Next solution is :

Enable NumLock in KDE

From the K Menu, launch System Settings and click on Keyboard (Edgy users: K Menu → System Settings → Keyboard and Mouse → Keyboard). You can see in the middle section the options for “NumLock on KDE Startup”, where you can choose to Turn On, Turn Off, or Leave Unchanged. Select “Turn On” to turn NumLock on at startup.

I have turned the settings program, but there is no possibility to turn on Numlock, there is not a “Keyboard” option, only a “Keyboard Shortcuts” option in which there is nothing for changing Numlock.

I hope someone can help me with this, should be a simple solution somewhere, no ?
Awaiting your remarks, I will leave it for the moment now.

Henk Vanneste.

Perhaps you looked in the wrong place:

  1. Go to the settings menu and select “sytem settings”.

  1. Scroll down to “Hardware” and select “input devices”

  1. In Input devices select “Keyboard”. In the “Hardware” tab, there are the options for “NumLock”

1 Like

Dear Mina,

I am NOT on Windows, but on Ubuntu Linux 20.04 LTS,
it has a totaly other settings program .

Henk Vanneste .

This is Kubuntu (KDE). I was referring to:

Dear Mina,

I think Kubuntu is the only Ubuntu flavour that uses KDE, I am not sure, I will look at it later this afternoon (Brussels time) .

Thank you for trying to help me .

Henk .

There’s also Neon. Both are actually pretty similar.


The conclusion is that it’s a flaw in Ubuntu 20.04 :
it can not be done as far as I know .




One last stupid question: Have you checked that numlockx is actually installed on your computer?

Have you tried: sudo apt install numlockx ?

1 Like


Yes, I already installed numlockx long ago,
I just checked it, it is the latest version .

Thanks for your support, Mina, and have a good year .

Henk .

1 Like

@hankbonk: I reached the end of my wisdom here… :confused:


Me too, for such a simple thing, it’s ridiculous that we spent so much time on it .

I flagged it to make the forum monitoring people aware of this and look into it further .


Hankbonk (Henk Vanneste, Belgium) .

Sadly you did not say what make or model computer you have …

This may (or not) help by changing the bios setting

Many laptops have that setting in the BIOS.

  1. Turn on the computer and repeatedly press the ESC key to enter the Startup Menu (tab, f2, f10, f11, f12 many options look at the screen on switching on)
  2. Press F10 for Bios setup.
  3. Press on the System Configuration tab.
  4. Select Device Configuration from the list.
  5. Mark on the check box in front of NumLock ON at boot.
  6. Save & Exit

Different attack

1 Like

The PC Desktop is a HP Compaq Pro 4300 SFF .

And I forgot to mentio, it, but I did change the BIOS setting for the numlock to on :

  1. When starting up, the numlock light lits up, but only for a while .
  2. Before the Login screen appears that light goes out again !
  3. Then I have to push the Numlock Key TWICE before it lits up again .

Thanks for your post,


Henk Vanneste, aka Hankbonk .

Ok thanks
Is the keyboard cable (usb Or ps2) or WiFi
Is it the standard one sold by the makers of the computer
Do you have access to another keyboard to test if same action occurs

Some keyboards language are reversed qwerty against azerty so the action is different, when installing it does a check of that, could you have selected the Wong one ?
If you auto detect it can choose different against the correct one… had a similar problem with a French Mac which was French Canadian not French France… same language but slightly different layout

It’s unusual to have to switch 2 times to activate