自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

LKU:一套在Ubuntu/LinuxMint上編譯、安裝和更新最新內核的Shell腳本

系統(tǒng) Linux
Linux Kernel Utilities (LKU)提供一組 shell 腳本(三個 Shell 腳本),可以幫助用戶從 kernel.org 獲取并編譯和安裝最新的 Linux 內核,也可以從 kernel.ubuntu.com 獲取安裝最新的預編譯的 Ubuntu 內核。甚至可以根據需要選擇所需的內核(手動內核選擇)。

[[198834]]

以手動方式安裝和升級***的 Linux 內核對于每個人來說都不是一件小事,甚至包括一些有經驗的人也是如此。它需要對 Linux 內核有深入的了解。過去我們已經介紹了 UKUU(Ubuntu Kernel Upgrade Utility),它可以從 kernel.ubuntu.com 網站上自動檢測***的主線內核,并彈出一個不錯的窗口界面進行安裝。

Linux Kernel Utilities (LKU)提供一組 shell 腳本(三個 Shell 腳本),可以幫助用戶從 kernel.org 獲取并編譯和安裝***的 Linux 內核,也可以從 kernel.ubuntu.com 獲取安裝***的預編譯的 Ubuntu 內核。甚至可以根據需要選擇所需的內核(手動內核選擇)。

該腳本還將根據 PGP 簽名文件檢查下載的歸檔文件,并且可以選擇通用和低延遲版內核。

建議閱讀:ukuu:一種在基于 Ubuntu 的系統(tǒng)上輕松安裝升級 Linux 內核的方式

它可以刪除或清除所有非活動的內核,并且不會為了安全目的留下備份的內核。強烈建議在執(zhí)行此腳本之前重新啟動一次。

  • compile_linux_kernel.sh :用戶可以從 kernel.org 編譯和安裝所需的或***的內核
  • update_ubuntu_kernel.sh :用戶可以從 kernel.ubuntu.com 安裝并更新所需或***的預編譯 Ubuntu 內核
  • remove_old_kernels.sh :這將刪除或清除所有非活動內核,并且只保留當前加載的版本

kernel.org 有固定的發(fā)布周期(每三個月一次),發(fā)布的內核包括了新的功能,改進了硬件和系統(tǒng)性能。由于它具有標準的發(fā)布周期,除了滾動發(fā)布的版本(如 Arch Linux,openSUSE Tumbleweed 等),大多數發(fā)行版都不提供***的內核。

如何安裝 Linux Kernel Utilities (LKU)

正如我們在文章的開頭所說的,它的 shell 腳本集只是克隆開發(fā)人員的 github 倉庫并運行相應的 shell 文件來執(zhí)行這個過程。

  1. $ git clone https://github.com/mtompkins/linux-kernel-utilities.git && cd linux-kernel-utilities 

安裝指定版本內核

為了測試的目的,我們將安裝 Linux v4.4.10-xenial 內核。在安裝新內核之前,我們需要通過 uanme -a 命令檢查當前安裝的內核版本,以便我們可以檢查新內核是否可以安裝。

  1. $ uname -a 
  2. Linux magi-VirtualBox 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux 

根據上面的輸出,我們的系統(tǒng)使用的是 4.4.0-21 通用內核。

只需運行 update_ubuntu_kernel.sh shell 腳本。***次運行腳本時會檢查是否滿足所有的依賴關系,然后自動安裝缺少的依賴項。它會檢測系統(tǒng)使用的發(fā)行版,并檢索 kernel.ubuntu.com 中可用的預編譯內核?,F在,從列表中選擇你需要的內核并輸入序號,然后按回車鍵,它將下載內核映像(linux-headers-4.4.10,linux-headers-4.4.10-xxx-generic 和 linux-image-4.4.10-xxx-generic)。

一旦內核鏡像被下載,它將要求輸入 sudo 密碼來啟動新內核的安裝。

  1. $ ./update_ubuntu_kernel.sh 
  2. [+] Checking Distro 
  3.  \_ Distro identified as LinuxMint. 
  4. [+] Checking Dependencies 
  5.     curl                    Found 
  6.     dkms                    Found 
  7.     git                     Found 
  8.     sudo                    Found 
  9.     wget                    Found 
  10.     whiptail                Found 
  11.     lynx                    Not Found 
  12. -- Installing Dependencies -- 
  13. [!] The first time this script is run missing dependencies will be installed. 
  14.     For compiling a kernel this may take a bit of time. Feedback will be provided. 
  15. [+] Dependencies 
  16.  \_Elevating permissions as necessary . . . 
  17. [%] Elevated 
  18. [+] Testing for previous held packages and trying to correct any found. 
  19.  \_Passed 
  20. [+] Updating package cache . . . 
  21.  \_Complete 
  22. [+] Installing dependencies . . . 
  23.  \_Complete 
  24.     curl                    Found 
  25.     dkms                    Found 
  26.     git                     Found 
  27.     sudo                    Found 
  28.     wget                    Found 
  29.     whiptail                Found 
  30.     lynx                    Found 
  31. [+] Changing to temporary directory to work in . . . 
  32.  \_ Temporary directory access granted: /tmp/tmp.97eHDsmg2K 
  33. [+] Removing any conflicting remnants . . . 
  34.  \_ Done 
  35. [+] Retrieving available kernel choices . . . 
  36.  \_ Precompiled kernels available from kernel.ubuntu.com: 
  37.  1)  Linux v4.11                2)  Linux v4.11.3              3)  Linux v4.11.2              4)  Linux v4.11.1              
  38.  5)  Linux v4.10                6)  Linux v4.10.17             7)  Linux v4.10.16             8)  Linux v4.10.15             
  39.  9)  Linux v4.10.14             10) Linux v4.10.13             11) Linux v4.10.12 
  40. [ 節(jié)略 ……]                      
  41.  249) Linux v4.0.3-wily          250) Linux v4.0.2-wily          251) Linux v4.0.1-wily          252) Linux v4.0-vivid           
  42. Select your desired kernel: 158 
  43. Do you want the lowlatency kernel? (y/[n]): 
  44. [+] Processing selection 
  45.  \_ Determining CPU type: amd64 
  46.  \_ Locating source of v4.4.10-xenial generic kernel packages. 
  47.  \_ Done 
  48. [+] Checking AntiVirus flag and disabling if necessary 
  49. [+] Installing kernel . . . 
  50. [sudo] password for magi: 
  51. Selecting previously unselected package linux-headers-4.4.10-040410. 
  52. (Reading database ... 230647 files and directories currently installed.) 
  53. Preparing to unpack linux-headers-4.4.10-040410_4.4.10-040410.201605110631_all.deb ... 
  54. Unpacking linux-headers-4.4.10-040410 (4.4.10-040410.201605110631) ... 
  55. Selecting previously unselected package linux-headers-4.4.10-040410-generic. 
  56. Preparing to unpack linux-headers-4.4.10-040410-generic_4.4.10-040410.201605110631_amd64.deb ... 
  57. Unpacking linux-headers-4.4.10-040410-generic (4.4.10-040410.201605110631) ... 
  58. Selecting previously unselected package linux-image-4.4.10-040410-generic. 
  59. Preparing to unpack linux-image-4.4.10-040410-generic_4.4.10-040410.201605110631_amd64.deb ... 
  60. Done. 
  61. Unpacking linux-image-4.4.10-040410-generic (4.4.10-040410.201605110631) ... 
  62. Setting up linux-headers-4.4.10-040410 (4.4.10-040410.201605110631) ... 
  63. Setting up linux-headers-4.4.10-040410-generic (4.4.10-040410.201605110631) ... 
  64. Examining /etc/kernel/header_postinst.d. 
  65. run-parts: executing /etc/kernel/header_postinst.d/dkms 4.4.10-040410-generic /boot/vmlinuz-4.4.10-040410-generic 
  66. Setting up linux-image-4.4.10-040410-generic (4.4.10-040410.201605110631) ... 
  67. Running depmod. 
  68. update-initramfs: deferring update (hook will be called later) 
  69. Examining /etc/kernel/postinst.d. 
  70. run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.10-040410-generic /boot/vmlinuz-4.4.10-040410-generic 
  71. run-parts: executing /etc/kernel/postinst.d/dkms 4.4.10-040410-generic /boot/vmlinuz-4.4.10-040410-generic 
  72. run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.10-040410-generic /boot/vmlinuz-4.4.10-040410-generic 
  73. update-initramfs: Generating /boot/initrd.img-4.4.10-040410-generic 
  74. Warning: No support for locale: en_IN 
  75. run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.10-040410-generic /boot/vmlinuz-4.4.10-040410-generic 
  76. run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.10-040410-generic /boot/vmlinuz-4.4.10-040410-generic 
  77. run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.10-040410-generic /boot/vmlinuz-4.4.10-040410-generic 
  78. Generating grub configuration file ... 
  79. Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported. 
  80. Found linux image: /boot/vmlinuz-4.4.10-040410-generic 
  81. Found initrd image: /boot/initrd.img-4.4.10-040410-generic 
  82. Found linux image: /boot/vmlinuz-4.4.9-040409-lowlatency 
  83. Found initrd image: /boot/initrd.img-4.4.9-040409-lowlatency 
  84. Found linux image: /boot/vmlinuz-4.4.0-21-generic 
  85. Found initrd image: /boot/initrd.img-4.4.0-21-generic 
  86. Found memtest86+ image: /boot/memtest86+.elf 
  87. Found memtest86+ image: /boot/memtest86+.bin 
  88. done 
  89.  \_ Done 

安裝后需要重新啟動以使用新安裝的內核。

  1. $ sudo reboot now 

現在,你正在使用的就是新安裝的 4.4.10-040410-generic 版本內核。

  1. $ uname -a 
  2. Linux magi-VirtualBox 4.4.10-040410-generic #201605110631 SMP Wed May 11 10:33:23 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux 

安裝***版本內核

過程與上述相同,它將自動安裝***版本的內核。

  1. $ ./update_ubuntu_kernel.sh --latest 
  2. [+] Checking Distro 
  3.  \_ Distro identified as LinuxMint. 
  4. [+] Checking Dependencies 
  5.     curl                    Found 
  6.     dkms                    Found 
  7.     git                     Found 
  8.     sudo                    Found 
  9.     wget                    Found 
  10.     whiptail                Found 
  11.     lynx                    Found 
  12. [+] Changing to temporary directory to work in . . . 
  13.  \_ Temporary directory access granted: /tmp/tmp.pLPYmCze6S 
  14. [+] Removing any conflicting remnants . . . 
  15.  \_ Done 
  16. [+] Retrieving available kernel choices . . . 
  17.  \_ Precompiled kernels available from kernel.ubuntu.com: 
  18. Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported. 
  19. Found linux image: /boot/vmlinuz-4.11.3-041103-generic 
  20. Found initrd image: /boot/initrd.img-4.11.3-041103-generic 
  21. Found linux image: /boot/vmlinuz-4.4.10-040410-generic 
  22. Found initrd image: /boot/initrd.img-4.4.10-040410-generic 
  23. Found linux image: /boot/vmlinuz-4.4.9-040409-lowlatency 
  24. Found initrd image: /boot/initrd.img-4.4.9-040409-lowlatency 
  25. Found linux image: /boot/vmlinuz-4.4.0-21-generic 
  26. Found initrd image: /boot/initrd.img-4.4.0-21-generic 
  27. Found memtest86+ image: /boot/memtest86+.elf 
  28. Found memtest86+ image: /boot/memtest86+.bin 
  29. done 
  30.  \_ Done 

安裝后需要重新啟動以使用新安裝的內核。

  1. $ sudo reboot now 

現在,你正在使用的就是***版本 4.11.3-041103-generic 的內核。

  1. $ uname -a 
  2. Linux magi-VirtualBox 4.11.3-041103-generic #201705251233 SMP Thu May 25 16:34:52 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux 

刪除或清除舊內核

只需要運行 remove_old_kernels.sh shell 腳本即可刪除或清除所有非活動狀態(tài)的內核。

  1. $ ./remove_old_kernels.sh 
  2.         ++++++++++++++++++++++++++++++++ 
  3.         +++       W A R N I N G      +++ 
  4.         ++++++++++++++++++++++++++++++++ 
  5. A reboot is recommended before running this script to ensure the current kernel tagged 
  6. as the boot kernel is indeed registered and old kernels properly marked for removal. 
  7. If you have just installed or modified your existing kernel and do not reboot before 
  8. running this script it may render you system INOPERABLE and that would indeed suck. 
  9. You have been warned. 
  10. ~the Mgmt 
  11. [?]Continue to automagically remove ALL old kernels? (y/N)y 
  12. \_ Removing ALL old kernels . . . 
  13. [sudo] password for magi: 
  14. Reading package lists... Done 
  15. Building dependency tree        
  16. Reading state information... Done 
  17. The following packages will be REMOVED: 
  18.   linux-headers-4.4.0-21* linux-headers-4.4.0-21-generic* linux-headers-4.4.10-040410* 
  19.   linux-headers-4.4.10-040410-generic* linux-headers-4.4.9-040409* linux-headers-4.4.9-040409-lowlatency* 
  20.   linux-image-4.4.0-21-generic* linux-image-4.4.10-040410-generic* linux-image-4.4.9-040409-lowlatency* 
  21.   linux-image-extra-4.4.0-21-generic* linux-kernel-generic* 
  22. 0 upgraded, 0 newly installed, 11 to remove and 547 not upgraded. 
  23. After this operation, 864 MB disk space will be freed. 
  24. (Reading database ... 296860 files and directories currently installed.) 
  25. Removing linux-kernel-generic (4.4.0-21) ... 
  26. Removing linux-headers-4.4.0-21-generic (4.4.0-21.37) ... 
  27. Removing linux-headers-4.4.0-21 (4.4.0-21.37) ... 
  28. Removing linux-headers-4.4.10-040410-generic (4.4.10-040410.201605110631) ... 
  29. Removing linux-headers-4.4.10-040410 (4.4.10-040410.201605110631) ... 
  30. Removing linux-headers-4.4.9-040409-lowlatency (4.4.9-040409.201605041832) ... 
  31. Removing linux-headers-4.4.9-040409 (4.4.9-040409.201605041832) ... 
  32. Removing linux-image-extra-4.4.0-21-generic (4.4.0-21.37) ... 
  33. done 
  34. Purging configuration files for linux-image-4.4.9-040409-lowlatency (4.4.9-040409.201605041832) ... 
  35. Examining /etc/kernel/postrm.d . 
  36. run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.9-040409-lowlatency /boot/vmlinuz-4.4.9-040409-lowlatency 
  37. run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.9-040409-lowlatency /boot/vmlinuz-4.4.9-040409-lowlatency 

 

責任編輯:龐桂玉 來源: Linux中國
相關推薦

2015-09-15 13:12:35

腳本UbuntuLinux內核

2019-05-10 08:00:00

UKUUUbuntuLinux

2023-11-19 19:01:53

UbuntuCalibre

2010-01-06 16:39:24

Ubuntu內核

2020-12-08 08:12:14

SQL腳本行轉列

2023-05-22 11:26:32

UbuntuQemu

2023-07-25 09:28:24

UbuntuFlatpak

2011-01-10 10:29:27

Ubuntu 10.1Gnome-Shell

2023-11-04 21:40:58

UbuntuLibreOffic

2011-06-07 15:19:19

PuppetUbuntu

2020-06-30 15:33:05

Linux 系統(tǒng) 數據

2020-07-02 08:11:06

Linux技巧語法

2011-05-24 09:33:40

UbuntuOpenStackNova

2023-09-24 19:24:18

UbuntuVSCodium

2021-03-07 11:46:02

UbuntuLinuxErlang

2011-09-07 13:33:51

ubuntuUbuntu Twea

2015-10-23 14:10:38

TerminatorUbuntuLinux

2010-01-07 11:08:56

Ubuntu DB2

2014-05-30 10:08:06

2019-05-31 16:10:42

UbuntuLinuxBudgie桌面
點贊
收藏

51CTO技術棧公眾號