Fix for RedShift crash on startup for Ubuntu MATE 21.04

It is known that RedShift does not want to start normally on login in Ubuntu MATE 21.04. It is bug 1910270.
Latest analysis shown that we can fix this.

So we need to install RedShift (if not installed):

sudo apt-get install redshift redshift-gtk

Then disable its systemd user-service for current user by

systemctl --user mask redshift.service redshift-gtk.service

Then disable its systemd user-service for LightDM user (special system user, who runs graphical greeter) by

sudo mkdir -p /var/lib/lightdm/.config/systemd/user
sudo ln -sf /dev/null /var/lib/lightdm/.config/systemd/user/redshift.service
sudo ln -sf /dev/null /var/lib/lightdm/.config/systemd/user/redshift-gtk.service
sudo chown -R lightdm: /var/lib/lightdm/.config

And optionally create autostart desktop file for the current user to allow RedShift autostart:

mkdir -p ~/.config/autostart/

cat << EOF > ~/.config/autostart/redshift-gtk.desktop 
[Desktop Entry]
Type=Application
Exec=redshift-gtk
Hidden=false
X-MATE-Autostart-enabled=true
Name[en_US]=redshift
Name=redshift
Comment[en_US]=
Comment=
X-MATE-Autostart-Delay=0
EOF

And enjoy :slight_smile:

5 Likes