#!/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