How do I prevent Ubuntu from changing my laptop screen brightness level?

I faced the same problem on my Dell XPS. Currently there is no other way to save it according to brightness key.

  • First try executing

    sudo su -c 'echo 5 > /sys/class/backlight/acpi_video0/brightness'
    

If it succed,try with different value for 5 and choose your preference level.

  • Now edit /etc/rc.local file to execute this command at boot up.

    gksu gedit /etc/rc.local
    
  • Just before exit in the file, add the following line,

    echo 5 > /sys/class/backlight/acpi_video0/brightness
    

You can change value 5 to anything.