Ubuntu Studio 23.04误删KDE Plasma后仅进入TTY模式,无网络且无法从U盘启动的恢复求助
Hey James, I totally feel your pain—losing your desktop environment and being stuck in TTY with no network is the worst kind of Linux headache. Let's work through this step by step, starting with the most critical issue first: getting your network back so you can reinstall KDE.
Step 1: Connect to WiFi from TTY
Since you don't have an Ethernet port, we'll set up wireless connection via command line:
- First, identify your wireless network interface name by running:
iw dev
Look for a line starting withInterface(usually something likewlan0orwlp2s0). - Scan for available WiFi networks with:
iwlist [你的接口名] scan | grep ESSID
Replace[你的接口名]with the name you found in step 1—this will show you all nearby WiFi names. - Create a Netplan configuration file to connect to your network:
sudo nano /etc/netplan/01-wifi-config.yaml
Paste in the following (make sure to use correct indentation, YAML is picky about this):
Replace the placeholders with your actual WiFi details, then save and exit nano withnetwork: version: 2 wifis: [你的接口名]: dhcp4: true access-points: "你的WiFi名称": password: "你的WiFi密码"Ctrl+O,Enter, thenCtrl+X. - Apply the network configuration:
sudo netplan generatesudo netplan apply
Wait a few seconds, then test if you're connected by pinging a website:ping google.com—if you get responses, you're online!
Step 2: Reinstall KDE Plasma Desktop
Now that you have network access, let's restore your desktop environment:
- Update your package list first:
sudo apt update - Install the core KDE Plasma components (since you confirmed you deleted Plasma, this will bring back everything you need):
sudo apt install plasma-desktop plasma-workspace sddm
Note: If you want the full Ubuntu Studio desktop experience, you can also installubuntu-studio-desktopinstead—it includes all the default apps and tools. - Make sure the display manager (SDDM, which handles the login screen) is enabled:
sudo systemctl enable sddm --now - Reboot your system with
sudo reboot—you should now see the KDE login screen instead of TTY.
Step 3: If Reinstalling KDE Fails, Boot from USB via Command Line
If the above steps don't work and you need to boot from your USB drive, here's how to do it from TTY:
- Insert your bootable USB drive, then run
lsblkto find its device name. Look for a device with a size matching your USB drive (usually/dev/sdbor/dev/sdc—be careful not to mix this up with your internal hard drive). - Use
efibootmgrto list all available boot entries:efibootmgr
Look for an entry that mentions "USB" or your drive's brand (e.g., "Kingston DataTraveler"). Note the number next to it (likeBoot0002). - Set that USB entry as the next boot priority:
sudo efibootmgr -n [USB项编号]
Replace[USB项编号]with the number you noted (e.g.,0002). - Reboot with
sudo reboot—your system should now boot directly from the USB drive.
If you run into any errors with these steps (like missing commands or permission issues), just let me know the exact error message and we'll troubleshoot further!
备注:内容来源于stack exchange,提问作者James Russell

