20.04 and above:
Opening a console
To open a console, you can press Ctrl + Alt + f5 or boot into grub recovery mode.
Method #1 Removing Old Configuration files.
As System 76 support says in their article, you can remove the old configuration files to fix this issue:
- Add a new user
sudo adduser test
log in as the new user (test
)
If the login worked without any issues then there are problems with the configuration files of the main user.
Backup/remove the old configuration files:
mv ~/.config ~/.config.old
mv ~/.local ~/.local.old
mv ~/.cache ~/.cache.old
mv ~/.nvidia-settings-rc ~/.nvidia-settings-rc.old
mv ~/.nv ~/.nv.old
sudo reboot
- If the configuration files are automatically generated then leave this step:
sudo mkdir ~/.config
sudo mkdir ~/.local
sudo mkdir ~/.cache
sudo mkdir ~/.nv
sudo mkdir ~/.nvidia-settings-rc
sudo reboot
Now try logging in with the regular user.
Method #2 Changing permissions of .Xauthority
- Identify the permissions of the file by running (run this in your home directory):
ls -lah | grep -i Xauthority
You should see the file listed with the permissions first, followed by the username and group that own it. If you see “root” listed there, you’ve found the source of the problem.
Give proper permissions:
sudo chown username:username .Xauthority
change "username" with your username.
Removing Gnome shell extensions
Sometimes a corrupted gnome-shell extension can also cause this issue. Removing the extensions will help:
sudo rm -r ~/.local/share/gnome-shell/extensions/*
Resetting gnome
Sometimes, there are problems with configuration files, in that case resetting gnome and its applications will help:
sudo dconf reset -f /
Installing correct Nvidia drivers
- First, remove all the Nvidia drivers by running:
sudo apt purge nvidia*
- Auto install the recommended drivers:
sudo ubuntu-drivers autoinstall
- Install the specific drivers for your device:
ubuntu-drivers devices
# identify the drivers needed
sudo apt install nvidia<version>
- Try using system76 drivers (optional):
sudo touch /etc/apt/preferences.d/system76-apt-preferences
echo "Package: *
Pin: release o=LP-PPA-system76-dev-stable
Pin-Priority: 1001
Package: *
Pin: release o=LP-PPA-system76-dev-pre-stable
Pin-Priority: 1001" >> /etc/apt/preferences.d/system76-apt-preferences
sudo apt-add-repository -y ppa:system76-dev/stable
sudo apt-get update
sudo apt install system76-driver-nvidia
sudo apt update && sudo apt full-upgrade
Disabling AMD Radeon Drivers
On newer versions of Ubuntu AMD, GPU chips are not well supported, so sometimes it is causing the issue. Turning it off would help:
sudo echo blacklist radeon >> /etc/modprobe.d/blacklist.conf
sudo update-initramfs -c -k all
sudo shutdown -r now
Reinstalling display manager
Sometimes the display manager needs some troubleshooting, reinstall it:
sudo apt install --reinstall ubuntu-desktop gdm3 gnome-shell
After that run:
sudo dpkg-reconfigure gdm3
Select the option gdm
and press enter.
Changing display managers
You can install a new display manager by the following commands:
sudo apt install lightdm
### If you want sddm
sudo apt install sddm
Then run:
sudo dpkg-reconfigure <display manager name> # example lightdm
Thanks to System76 support, for letting me use some information (method #1, method #3, and method #4) for letting me use some information from their article.
sudo ubuntu-drivers devices
, and thensudo apt-get install
the recommended driver./var/log/syslog
and check for any error that might relate to something you did recently. My issue was an error related toflatpak
, which I've installed the day before but ended up not needing it. After uninstalling it, everything went back to normal.