The problem occured after installing proprietary Nvidia graphics driver using those commands.
sudo apt-get update && clear && apt-cache search nvidia-[0-9] | grep 'binary driver' sudo apt-get purge nvidia* sudo apt-get install nvidia-340 nvidia-settings sudo nvidia-xconfig
The fix is to let the built-in ubuntu-drivers program decide automatically which graphics driver to install.
Open the terminal and type this command to update the apt repositories.
sudo apt update
Then, remove all packages started with
nvidia using this command.
sudo apt remove '^nvidia'
After that, let the apt remove not needed packages automatically using this command.
sudo apt autoremove
Finally, let ubuntu-drivers automatically install the suitable proprietary Nvidia graphics driver for your GPU. And restart your computer / laptop by
sudo ubuntu-drivers autoinstall && sudo reboot
After that, your computer will install the graphics driver and restart itself and bootup in a good condition.
That’s it. The problem solved and the error gone.