Skip to content

Instantly share code, notes, and snippets.

@zzahkaboom24
Forked from sebastiaanfranken/remove-nouveau.sh
Created August 12, 2023 16:06
Show Gist options
  • Save zzahkaboom24/c90ccfae920fc937902633c660731fb0 to your computer and use it in GitHub Desktop.
Save zzahkaboom24/c90ccfae920fc937902633c660731fb0 to your computer and use it in GitHub Desktop.
Removes the nouveau module/driver from Fedora 29+
#!/bin/bash
# Removes the xorg-x11-drv-nouveau package from this machine, because it's not needed
sudo dnf remove xorg-x11-drv-nouveau -y
# Blacklist the nouveau module as a module and in dracut
sudo echo 'blacklist nouveau' > /etc/modprobe.d/blacklist-nouveau.conf
sudo echo 'omit_drivers+=" nouveau "' > /etc/dracut.conf.d/blacklist-nouveau.conf
# Backup the current initramfs
sudo mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
# Regenerate the current initramfs
sudo dracut -f /boot/initramfs-$(uname -r).img $(uname -r)
# Regenerate grub2's config
if [ -d /sys/firmware/efi ]; then
sudo grub2-mkconfig -o /etc/grub2-efi.cfg
else
sudo grub2-mkconfig -o /etc/grub2.cfg
fi
echo 'Done. You should reboot your machine now for all changes to come into effect.'
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment