Over a year ago I installed Elementary OS on an old Macbook Air from circa 2011. It worked fine, albeit slowly, for a couple of weeks until I performed a suggested nvidia driver update. I read similar stack exchange questions from time to time but none of the suggestions worked.

So here’s my first question to the community:

  • I am confronted to an infinite log-in loop: the system recognises my password, then goes blank a moment, only to return to the log-in screen. I consulted I am unable to login "infinite login loop" and Can't login after upgrade without being able to solve the problem

  • the system’s response to « sudo rm -r $HOME/ .Xauthority » is « rm: cannot remove ‘.Xauthority’: No such file or directory »

  • the system’s response to « lspci | grep VGA » is « 02:00.0 VGA compatible controller: NVIDIA Corporation MCP89 [GeForce 320M] (rev a2) »

  • the system’s response to « sudo lshw -c video » is « *-display UNCLAIMED » (followed by a raft of technical hardware description)

Question: how do I get the system to work again after this failed upgrade?

Thank you!

PS - I am no IT expert, but an average office package user trying to continue using older computers to avoid waste of our planet’s resources.

1 Answer 1


I kept getting issues with the 'this looks like spam' flag and have reduced the post to be particular to my solution rather than the exhaustive list of other possible solutions I came across.

To continue with your current attempted solution

If you want to double check the existence of .Xauthority run ls -la for the $HOME directory which includes options to show hidden files and will let you confirm whether or not the .Xauthority file is there are not.

If it does, you Should see it along with .xsession-errors (which should exist since you're having trouble getting out of this boot loop) and allow you to try that solution again.

It's also possible that the file may have been created under the root home directory accidentally instead of the user's $HOME directory, in which case you can check this by:

# login and become root

$ sudo -i

# then as root, check if the .Xauthority file exists

$ ls -la 

# and remove, no need for sudo since you're logged in as root in console

$ rm .Xauthority

# if you happen to see another file for xorg.conf.new remove 
# that too, it's automatically generated and when it's in the 
# home folder and is unused unless moved to /etc/X11

$ rm xorg.conf.new

Resolve Using Recovery Mode

For below, in case you can't reach a console from normal boot as aforementioned using keyboard combinations, then boot into recovery mode, enable networking, and then select the option for dropping to root. This is suggested because you're going to need to install software and aside from the obvious, enabling networking will automatically remount your primary disk with read/write permissions as necessary.

Solution 1: Blacklisting the Nouveau Driver

You can first try blacklisting the nouveau drivers and rebooting to see if that might resolve the issue:

$ sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
$ sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"

# before restarting, you should update the initramfs by running
# the following (to purge the system of nouveau loading)

$ sudo update-initramfs -u

# then restart

$ sudo reboot

Alternatively, the answer provided here explains when troubleshooting using nvidia drivers in the case of Ubuntu, that you need to exit the Xserver display before installing the nvidia drivers and after you've stopped lightdm by switching to a virtual terminal (The tty console) where instead, after arriving at the console

# stop lightdm

$ sudo stop lightdm

# edit nvidia configuration file to blacklist nouveau

$ sudo nano /etc/modprobe.d/nvidia-graphics-drivers.conf

# and then add the following entries
blacklist nouveau
blacklist lbm-nouveau
blacklist nvidia-173
blacklist nvidia-96
blacklist nvidia-current
blacklist nvidia-173-updates
blacklist nvidia-96-updates
alias nvidia nvidia_current_updates
alias nouveau off
alias lbm-nouveau off

# Hit Ctrl or Cmd + X to exit, yes to save, yes to same file name 
# (create it if it doesn't exist but it should already exist 
# after installing nvidia drivers.

As one further alternative to blacklisting the nouveau driver and trying to get the two drivers to play nice together, don't do any of the above and simply try changing this in your grub configuration:

# use your preferred text editor

$ sudo nano /etc/default/grub

# Add or modify this line to include


The above ensures, in one way or another, there's no conflict with your on-board graphics driver or the system's open source nouveau driver.

Solution 2: Get Rid of Nvidia Drivers and revert to system drivers

Using the recovery mode console:

# removes all drivers related to nvidia

$ sudo apt purge nvidia*

# however, if you have a need for CUDA or some other drivers,
# from nvidia, you can target specifically the display driver running

$ dpkg -l | grep nvidia

# then from the list find the nvidia driver that was installed and
# specifically purge that one, for example

$ sudo apt purge nvidia-driver-384 

# or

$ sudo apt purge nvidia-384

# as an added assurance

$ sudo apt autoremove
$ sudo apt autoclean

# as a side note, some functions may be needed from the below package
# on certain systems and may not necessarily seem needed for elementary
# Install after purging nvidia

$ sudo apt install nvidia-common

Then to ensure the system loads, we will re-install the elementary desktop, a helpful Ubuntu package, remove any xorg configurations that may have been previously set when nvidia drivers were installed and then manually re-add the open source nouveau drive back to be loaded, all before updating initramfs and rebooting

# You can optionally remove elementary-desktop before installing

$ sudo apt remove elementary-desktop

# otherwise

$ sudo apt install elementary-desktop 
$ sudo ubuntu-drivers autoinstall
$ sudo rm /etc/X11/xorg.conf
$ echo 'nouveau' | sudo tee -a /etc/modules
$ sudo update-initramfs -u
$ sudo reboot

  • Thank you Doedigo for the comprehensive explanation. As this matter had become too technical for me, I have proceeded with a new installation by an IT professional. Best regards.
    – Micha
    Commented Nov 10, 2022 at 22:35
  • You're welcome, if you feel the answer would've been sufficient, please help users identify the question as being answered by marking it as so. Thank you for checking in and updating us about the issue being resolved!
    – Doedigo
    Commented Nov 11, 2022 at 1:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.