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 dpkg-reconfigure lightdm
and selected kdm. With kdm you can select a previous session or a default one. This was the way to go. – Ivan Ferrer Villa Feb 12 '14 at 21:40sbackup
, everything worked but after restart I got into login loop. For me nothing mentioned in answers worked so i did a fresh system install. I commented my part so that any link between both can help community. Things i restored were folders : home, etc,usr,var. – study-route Jul 07 '15 at 14:03sudo ubuntu-drivers devices
, and thensudo apt-get install
the recommended driver. – kabdulla Apr 04 '17 at 07:05~/.profile
as implied by Dan Cundiff's answer. Much more likely than all the other suggestions. You fuck up your .profile, and you can't log in next time. That simple. – Daniel Dinnyes May 27 '18 at 21:44/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. – dferrazm Jun 06 '19 at 10:00ubuntu-drivers devices
I could see that I needed to install recommended driver sosudo ubuntu-drivers autoinstall
fixed it – diegosasw Mar 26 '20 at 10:04ampgpu-pro-uninstall
to get rid of the old drivers and the standard ones built in seem to work fine. Can't do a proper answer - not enough rep. – kennyB Jun 02 '20 at 02:27Automatic Login
option.. To fix this I opened the command prompt (Ctrl+Alt+F7), created a guest user viasudo adduser myguest
and logged in with it to disable theAutomatic Login
option... – Mr. Blond Sep 09 '20 at 18:21~/.profile
including~/.zshrc
. I don't know if I made this mistake or if it happened after I had installed Oh My Zsh (I think so) – felipsmartins Aug 23 '22 at 22:14Ubuntu on Wayland
on the login screen, it helped in my case – Dmitriy Pavlukhin Oct 08 '22 at 11:19/var/log/syslog/
and found error messageJS Error: TypeError: malformed UTF-8 character sequence at offset.........org/gnome/shell/ui/main.js......
I deleted in my home directory the foldergnome-shell
- the path ishome/<your user>/.local/share/gnome-shell
. This solved my login loop and I was able to login as normal. – David Miller Mar 23 '24 at 15:22