If Ubuntu is booting into a command-line interface (CLI) instead of the graphical user interface (GUI), it could be due to several reasons. Here's how you can troubleshoot and potentially resolve the issue:
1. Basic Troubleshooting Steps
Check if GUI is Installed
First, ensure that a GUI (like GNOME, KDE, etc.) is installed.
sudo apt update
sudo apt install ubuntu-desktop
This command installs the default Ubuntu GNOME desktop. If you use a different desktop environment, replace ubuntu-desktop with the relevant package, like kubuntu-desktop for KDE.
Start the GUI Manually
Try starting the GUI manually:
startx
or
sudo systemctl start gdm3
For other display managers, the command might be:
sudo systemctl start lightdm
# or
sudo systemctl start sddm
2. Check Systemd Default Target
Ensure the system is set to boot into the graphical target by default:
sudo systemctl set-default graphical.target
sudo systemctl isolate graphical.target
The second command will switch to the graphical target immediately.
3. Check for Driver Issues
If the issue occurred after changing GPU drivers, there might be a problem with the driver configuration.
Verify the Driver in Use
Check which drivers are currently in use:
lspci -k | grep -A 3 -E "(VGA|3D)"
Check Driver Configuration
If you have configured amdgpu to use instead of radeon, ensure the configuration files are correct.
4. Check Xorg Logs
Xorg logs might have useful information about why the GUI is not starting:
cat /var/log/Xorg.0.log
5. Reconfigure Xorg
If you suspect Xorg configuration issues, you can reconfigure it:
sudo dpkg-reconfigure xserver-xorg
6. Reinstall Display Manager
Reinstalling the display manager might fix broken configurations:
sudo apt --reinstall install gdm3
If you use a different display manager, replace gdm3 with lightdm, sddm, or your preferred choice.
Example Scenario: Fixing the Boot Issue After GPU Change
Here’s a consolidated example if the problem started after changing the GPU driver:
-
Switch to command-line mode:
- You should already be in command line mode if the GUI isn't starting, otherwise, press
Ctrl + Alt + F3 to switch to a terminal.
-
Check the configuration files:
- Ensure
/etc/modprobe.d/amdgpu.conf and /etc/modprobe.d/blacklist-radeon.conf are correctly set up as previously discussed.
-
Regenerate initramfs:
sudo update-initramfs -u
-
Reboot the system:
sudo reboot
-
Check if the display manager starts:
-
Check the Xorg logs:
- Look for errors in
/var/log/Xorg.0.log.
If after these steps the GUI isn’t starting, you may need to consider rolling back to the radeon driver or further investigate logs to find the root cause.
Rolling Back
If necessary, revert to the radeon driver:
-
Remove the configuration files for amdgpu:
sudo rm /etc/modprobe.d/amdgpu.conf
-
Unblacklist the radeon driver:
- Either delete or comment out the line in
/etc/modprobe.d/blacklist-radeon.conf.
-
Regenerate initramfs:
sudo update-initramfs -u
-
Reboot:
sudo reboot
This should revert back to using the radeon driver if amdgpu was causing issues. If you need more assistance, you can ask for help with specific error messages or context, and I’ll guide you accordingly.