日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

Ubuntu 18.04 进入 Recovery 模式

發(fā)布時間:2023/12/8 Ubuntu 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Ubuntu 18.04 进入 Recovery 模式 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

Ubuntu 18.04 進入 Recovery 模式

  • Ubuntu 18.04 進入 Recovery 模式, 只需要在開機時一直按住 Shift 鍵,就會進入 GNU GRUB 界面
  • 查看磁盤占用情況
  • uname -a (查看當前使用的內(nèi)核版本)
  • 查看已安裝的內(nèi)核版本
  • 刪除多余的內(nèi)核文件
  • 使用du -h再次查看/boot空間
  • sudo apt-get update下載最新的軟件列表。
  • sudo apt-get upgrade 更新系統(tǒng)的更新
  • sudo apt-get autoremove 自動刪除多余的安裝包文件
  • ubuntu卸載軟件命令,apt-get remove

Ubuntu 18.04 進入 Recovery 模式, 只需要在開機時一直按住 Shift 鍵,就會進入 GNU GRUB 界面

如果是雙系統(tǒng)則選擇ubuntu高級選項

然后選擇 Advanced options for Ubuntu,回車:
再選擇一個 (recovery mode) 即可:

最后根據(jù)自己的需求來進行選擇:
resume: 退出 recovery 模式,然后正常啟動;
clean: 嘗試清理垃圾文件,騰出更多的空間;
dpkg: 修復損壞的包;
fsck: 檢查所有文件系統(tǒng);
grub: 更新 grub 的啟動載入器;
network: 啟動網(wǎng)絡;
root: 進入命令行模式; (如果沒有網(wǎng)絡,則要先選擇 network)
system-summary: 系統(tǒng)概覽,查看電腦的基本信息;

查看磁盤占用情況

df -h Filesystem Size Used Avail Use% Mounted on /dev/nvme0n1p5 181M 141M 27M 85% /boot /dev/nvme0n1p8 71G 26G 41G 39% /home /dev/nvme0n1p1 96M 48M 49M 50% /boot/efi tmpfs 1.6G 16K 1.6G 1% /run/user/121 tmpfs 1.6G 44K 1.6G 1% /run/user/1000

發(fā)現(xiàn)/boot確實占用率很高。

uname -a (查看當前使用的內(nèi)核版本)

lenmom@M1701:~$ uname -a Linux M1701 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64

查看已安裝的內(nèi)核版本

lenmom@M1701:~$ dpkg --get-selections |grep linux binutils-x86-64-linux-gnu install console-setup-linux install libselinux1:amd64 install linux-base install linux-firmware install linux-generic install linux-headers-4.15.0-39 install linux-headers-4.15.0-39-generic install linux-headers-4.15.0-43 install linux-headers-4.15.0-43-generic install linux-headers-generic install linux-image-4.15.0-29-generic deinstall linux-image-4.15.0-39-generic install linux-image-4.15.0-43-generic install linux-image-generic install linux-libc-dev:amd64 install linux-modules-4.15.0-29-generic deinstall linux-modules-4.15.0-39-generic install linux-modules-4.15.0-43-generic install linux-modules-extra-4.15.0-29-generic deinstall linux-modules-extra-4.15.0-39-generic install linux-modules-extra-4.15.0-43-generic install linux-signed-generic install linux-sound-base install pptp-linux install syslinux install syslinux-common install syslinux-legacy install util-linux install

能看到已經(jīng)安裝的版本,其中帶image的一般就是舊版本,其中

a)deinstall 代表是已經(jīng)刪除的舊版本
b) install 是還沒有刪除的舊版本內(nèi)核??

刪除多余的內(nèi)核文件

通過uname -a可以查看到當前正在使用的內(nèi)核版本,把不是當前版本的處于install狀態(tài)的image-xxx-generic文件卸載掉,對于本例中l(wèi)inux-modules-extra-4.15.0-39-generic是多余的內(nèi)核文件,正在使用的是linux-modules-extra-4.15.0-43-generic,開始卸載。

卸載命令為sudo apt-get remove linux-modules-xxx-generic,其中xxx為要卸載的內(nèi)核版本號

lenmom@M1701:~$ sudo apt-get remove linux-modules-4.15.0-39-generic Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED:linux-image-4.15.0-39-generic linux-modules-4.15.0-39-generic 0 upgraded, 0 newly installed, 2 to remove and 105 not upgraded. 1 not fully installed or removed. After this operation, 74.6 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 187447 files and directories currently installed.) Removing linux-image-4.15.0-39-generic (4.15.0-39.42) ... I: /vmlinuz.old is now a symlink to boot/vmlinuz-4.15.0-43-generic I: /initrd.img.old is now a symlink to boot/initrd.img-4.15.0-43-generic /etc/kernel/postrm.d/initramfs-tools: update-initramfs: Deleting /boot/initrd.img-4.15.0-39-generic /etc/kernel/postrm.d/zz-update-grub: Generating grub configuration file ... Found linux image: /boot/vmlinuz-4.15.0-43-generic Found initrd image: /boot/initrd.img-4.15.0-43-generic Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi Adding boot menu entry for EFI firmware configuration done Removing linux-modules-4.15.0-39-generic (4.15.0-39.42) ... Setting up initramfs-tools (0.130ubuntu3.5) ... update-initramfs: deferring update (trigger activated) Processing triggers for initramfs-tools (0.130ubuntu3.5) ... update-initramfs: Generating /boot/initrd.img-4.15.0-43-generic W: APT had planned for dpkg to do more than it reported back (6 vs 10).Affected packages: initramfs-tools:amd64u can execute the following command to ensure all useless files are deleted:sudo dpkg -P linux-modules-4.15.0-46-generic -- the kernel name depend to your concret condition

使用du -h再次查看/boot空間

lenmom@M1701:~$ df -h Filesystem Size Used Avail Use% Mounted on /dev/nvme0n1p5 181M 75M 94M 45% /boot /dev/nvme0n1p8 71G 26G 41G 39% /home /dev/nvme0n1p1 96M 48M 49M 50% /boot/efi tmpfs 1.6G 16K 1.6G 1% /run/user/121 tmpfs 1.6G 44K 1.6G 1% /run/user/1000

sudo apt-get update下載最新的軟件列表。

從軟件源(也就是服務器)下載最新的軟件包列表文件,更新本地軟件包緩存信息(包含軟件名,版本,校驗值,依賴關系等)。

sudo apt-get upgrade 更新系統(tǒng)的更新

sudo apt-get autoremove 自動刪除多余的安裝包文件

ubuntu卸載軟件命令,apt-get remove

第一步,apt-get remove xxx ;就是卸載xxx
  或者 apt-get remove --purge xxx ;卸載xxx并清除配置。
  這兩條命令對于依賴則是不管的。因為別的軟件可能和此軟件有相同的依賴,當然對依賴不能管了。
第二步,apt-get autoremove ;就是來對付那些不再被“依賴”的包, 自動檢測并刪除他們(任何時候都可以執(zhí)行此條命令)。
  autoremove: is used to remove packages that were automatically installed to satisfy dependencies for some package and that are no more needed.
  [注釋]: 這條命令不帶任何參數(shù)。另外還有一條命令apt-get autoremove xxx ; 即加上軟件名稱。經(jīng)測試這條命令和apt-get remove xxx相比,會多
 出很多卸載內(nèi)容,apt-get autoremove xxx 可能是 第一步和第二步 命令的綜合寫法,但不確定。慎用,可能會導致其他軟件不可用!

總結(jié)

以上是生活随笔為你收集整理的Ubuntu 18.04 进入 Recovery 模式的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。