Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

Ubuntu 系統常見疑難雜症解決方案 (精簡版)

編輯:Linux 教學

說明

本文內容與 ID 45918 高度重疊,此處提供精簡指令卡片,適合快速查閱。完整解析請參考 ID 45918。

快速指令卡

問題核心指令關鍵檔案/路徑
取得 Root (單用戶)GRUB → Advanced → recovery mode → root → mount -o remount,rw //etc/fstab, /boot/grub/grub.cfg
取得 Root (Live USB)mount /dev/sda2 /mnt; mount /dev/sda1 /mnt/boot/efi; for d in dev proc sys; do mount --bind /$d /mnt/$d; done; chroot /mnt/dev/sda2 (根), /dev/sda1 (EFI)
修改 Kernel 參數單次啟動GRUB → e → rw init=/bin/bash → Ctrl+x/boot/grub/grub.cfg
重設密碼passwd root / passwd user/etc/shadow
重設 GRUB 密碼grub-mkpasswd-pbkdf2 → /etc/grub.d/40_custom → update-grub/boot/grub/grub.cfg
Windows 覆寫 GRUB 修復Live USB chroot → grub-install /dev/sda; update-grub (BIOS) / grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu; update-grub (UEFI)/boot/efi, /boot/grub
Windows 讀 Linux 分區WSL2: wsl --mount \\.\PHYSICALDRIVE2 --partition 1 --type ext4Linux Reader, Ext2Fsd (舊)
開機慢 (systemd 分析)systemd-analyze blame; systemd-analyze critical-chain/etc/systemd/system/*.service
停用慢速服務systemctl disable ntpdate snapd.seeded plymouth-quit-wait/etc/systemd/system/
雙系統時間差 (UTC/Local)timedatectl set-local-rtc 1 --adjust-system-clock/etc/adjtime
瀏覽器/音訊無聲systemctl --user restart pipewire pipewire-pulse wireplumber; pavucontrol~/.config/pulse/, /etc/pipewire/
強制清空垃圾桶rm -rf ~/.local/share/Trash/{files,info}/*~/.local/share/Trash/
檔案系統修復fsck -f /dev/sda2 (卸載狀態)/etc/fstab
套件修復dpkg --configure -a && apt -f install/var/lib/dpkg/
initramfs 重建update-initramfs -u -k all/boot/initrd.img-*
Locale 亂碼修復locale-gen zh_TW.UTF-8 && update-locale LANG=zh_TW.UTF-8/etc/locale.gen, /etc/default/locale

現代化替代方案對照

  • Flash → 已淘汰,改用 HTML5/WebRTC
  • ntpdate → systemd-timesyncd / chronyd
  • ifconfig/route → ip addr/route/link
  • netconfig → nmcli / nmtui / systemd-networkd
  • service/restart → systemctl start/stop/restart/enable/disable
  • grub-install (舊) → grub-install --target=x86_64-efi ... (UEFI 標準)

一鍵備份與還原 (Timeshift)

# 安裝
apt install timeshift
# 或 Flatpak
flatpak install flathub com.teejeetech.Timeshift

# 建立快照 (GUI 或 CLI)
timeshift --create --comments "Pre-update" --tags D

# 還原 (需 Live USB/Recovery 模式)
timeshift --restore --snapshot '2024-01-15_10-30-00' --target /dev/sda2

建議:變更前快照、問題時還原、日誌留證、知識入庫。

Copyright © Windows教程網 All Rights Reserved