xcalib error - unsupported ramp size

I'm trying to change the contrast with xcalib with the command xcalib -co 70 but I get the following error:

Error - unsupported ramp size 0

Solution 1:

This is actually a bug as reported upstream in debian and various other places. It seems newer version of X caused this. A user reported a workaround for intel drivers and it worked for me.

First of all, do make sure that the appropriate drivers are actually installed: $ sudo apt install xorg xserver-xorg-video-intel

You need to create a xorg .conf file to force usage of intel drivers. Create a file /etc/X11/xorg.conf.d/20-intel.conf and put these lines there.

Section "Device"
  Identifier "Intel Graphics"
  Driver "intel"
EndSection

On Ubuntu 18.04 and newer, the file /etc/X11/xorg.conf should contain Driver "intel" under the Section "Device". The Identifier may be called differently.

Now reboot or restart X (sudo systemctl restart display-manager).

Solution 2:

On Ubuntu 16.04 and earlier

The other answer has worked for me quite well.

On Ubuntu 18.04

I came across this thread stating that the xcalib in the Ubuntu repository is too old - built in 2008. There have been updates to the xcalib repository. So, you can clone the git repository from there, and build and install.

Firstly, you need to have git, make and cmake:

sudo apt install git cmake make

You will also require the following libraries:

sudo apt install libx11-dev libxrandr-dev libxxf86vm-dev

And the main steps:

git clone https://github.com/OpenICC/xcalib.git
cd xcalib
cmake CMakeLists.txt
sudo make install

You can uninstall by running:

sudo make uninstall 

One (those new to Linux) can search for these by

apt-cache search [some-keyword]

Besides,

My Experience

For me (on XPS 9570) (and at least one more), the other solution didn't work on Ubuntu 18.04 - it simply didn't work, besides the fact that it disables brightness keys. I have relied on that solution for inverting screen colours for quite some time - it did work on (X)Ubuntu 16.04, Debian Stretch.

Now, thanks to google - I have been googling since more 3 days - to me, it seems google keeps searching for your query when you're offline, so that it can give you more relevant results when you search for it again.