[+] Checking Distro \_ Distro identified as LinuxMint.
[+] Checking Dependencies curl Found dkms Found git Found sudo Found wget Found whiptail Found lynx Not Found
-- Installing Dependencies --
[!] The first time this script is run missing dependencies will be installed. For compiling a kernel this may take a bit of time. Feedback will be provided.
[+] Testing for previous held packages and trying to correct any found. \_Passed
[+] Updating package cache . . . \_Complete
[+] Installing dependencies . . . \_Complete
curl Found dkms Found git Found sudo Found wget Found whiptail Found lynx Found
[+] Changing to temporary directory to work in . . . \_ Temporary directory access granted: /tmp/tmp.97eHDsmg2K
[+] Removing any conflicting remnants . . . \_ Done
[+] Retrieving available kernel choices . . . \_ Precompiled kernels available from kernel.ubuntu.com:
1) Linux v4.11 2) Linux v4.11.3 3) Linux v4.11.2 4) Linux v4.11.1 5) Linux v4.10 6) Linux v4.10.17 7) Linux v4.10.16 8) Linux v4.10.15 9) Linux v4.10.14 10) Linux v4.10.13 11) Linux v4.10.12 [ 节略 ……] 249) Linux v4.0.3-wily 250) Linux v4.0.2-wily 251) Linux v4.0.1-wily 252) Linux v4.0-vivid
Select your desired kernel: 158
Do you want the lowlatency kernel? (y/[n]):
[+] Processing selection \_ Determining CPU type: amd64 \_ Locating source of v4.4.10-xenial generic kernel packages. \_ Done
[+] Checking AntiVirus flag and disabling if necessary [+] Installing kernel . . . [sudo] password for magi: Selecting previously unselected package linux-headers-4.4.10-040410. (Reading database ... 230647 files and directories currently installed.) Preparing to unpack linux-headers-4.4.10-040410_4.4.10-040410.201605110631_all.deb ... Unpacking linux-headers-4.4.10-040410 (4.4.10-040410.201605110631) ... Selecting previously unselected package linux-headers-4.4.10-040410-generic. Preparing to unpack linux-headers-4.4.10-040410-generic_4.4.10-040410.201605110631_amd64.deb ... Unpacking linux-headers-4.4.10-040410-generic (4.4.10-040410.201605110631) ... Selecting previously unselected package linux-image-4.4.10-040410-generic. Preparing to unpack linux-image-4.4.10-040410-generic_4.4.10-040410.201605110631_amd64.deb ... Done. Unpacking linux-image-4.4.10-040410-generic (4.4.10-040410.201605110631) ... Setting up linux-headers-4.4.10-040410 (4.4.10-040410.201605110631) ... Setting up linux-headers-4.4.10-040410-generic (4.4.10-040410.201605110631) ... Examining /etc/kernel/header_postinst.d. run-parts: executing /etc/kernel/header_postinst.d/dkms 4.4.10-040410-generic /boot/vmlinuz-4.4.10-040410-generic Setting up linux-image-4.4.10-040410-generic (4.4.10-040410.201605110631) ... Running depmod. update-initramfs: deferring update (hook will be called later) Examining /etc/kernel/postinst.d. run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.10-040410-generic /boot/vmlinuz-4.4.10-040410-generic run-parts: executing /etc/kernel/postinst.d/dkms 4.4.10-040410-generic /boot/vmlinuz-4.4.10-040410-generic run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.10-040410-generic /boot/vmlinuz-4.4.10-040410-generic update-initramfs: Generating /boot/initrd.img-4.4.10-040410-generic Warning: No support for locale: en_IN run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.10-040410-generic /boot/vmlinuz-4.4.10-040410-generic run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.10-040410-generic /boot/vmlinuz-4.4.10-040410-generic run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.10-040410-generic /boot/vmlinuz-4.4.10-040410-generic Generating grub configuration file ... Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported. Found linux image: /boot/vmlinuz-4.4.10-040410-generic Found initrd image: /boot/initrd.img-4.4.10-040410-generic Found linux image: /boot/vmlinuz-4.4.9-040409-lowlatency Found initrd image: /boot/initrd.img-4.4.9-040409-lowlatency Found linux image: /boot/vmlinuz-4.4.0-21-generic Found initrd image: /boot/initrd.img-4.4.0-21-generic Found memtest86+ image: /boot/memtest86+.elf Found memtest86+ image: /boot/memtest86+.bin done \_ Done
安装后需要重新启动以使用新安装的内核。
1 2
$ sudo reboot now
现在,你正在使用的就是新安装的 4.4.10-040410-generic 版本内核。
1 2 3
$ uname -a Linux magi-VirtualBox 4.4.10-040410-generic #201605110631 SMP Wed May 1110:33:23 UTC 2016x86_64x86_64x86_64 GNU/Linux
[+] Checking Distro \_ Distro identified as LinuxMint.
[+] Checking Dependencies curl Found dkms Found git Found sudo Found wget Found whiptail Found lynx Found
[+] Changing to temporary directory to work in . . . \_ Temporary directory access granted: /tmp/tmp.pLPYmCze6S
[+] Removing any conflicting remnants . . . \_ Done
[+] Retrieving available kernel choices . . . \_ Precompiled kernels available from kernel.ubuntu.com: . . . . Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported. Found linux image: /boot/vmlinuz-4.11.3-041103-generic Found initrd image: /boot/initrd.img-4.11.3-041103-generic Found linux image: /boot/vmlinuz-4.4.10-040410-generic Found initrd image: /boot/initrd.img-4.4.10-040410-generic Found linux image: /boot/vmlinuz-4.4.9-040409-lowlatency Found initrd image: /boot/initrd.img-4.4.9-040409-lowlatency Found linux image: /boot/vmlinuz-4.4.0-21-generic Found initrd image: /boot/initrd.img-4.4.0-21-generic Found memtest86+ image: /boot/memtest86+.elf Found memtest86+ image: /boot/memtest86+.bin done \_ Done
安装后需要重新启动以使用新安装的内核。
1 2
$ sudo reboot now
现在,你正在使用的就是最新版本 4.11.3-041103-generic 的内核。
1 2 3
$ uname -a Linux magi-VirtualBox 4.11.3-041103-generic #201705251233 SMP Thu May 2516:34:52 UTC 2017x86_64x86_64x86_64 GNU/Linux
++++++++++++++++++++++++++++++++ +++ W A R N I N G +++ ++++++++++++++++++++++++++++++++
A reboot is recommended before running this script to ensure the current kernel tagged as the boot kernel is indeed registered and old kernels properly marked for removal. If you have just installed or modified your existing kernel and do not reboot before running this script it may render you system INOPERABLE and that would indeed suck.
You have been warned. ~the Mgmt
[?]Continue to automagically remove ALL old kernels? (y/N)y \_ Removing ALL old kernels . . . [sudo] password for magi: Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: linux-headers-4.4.0-21* linux-headers-4.4.0-21-generic* linux-headers-4.4.10-040410* linux-headers-4.4.10-040410-generic* linux-headers-4.4.9-040409* linux-headers-4.4.9-040409-lowlatency* linux-image-4.4.0-21-generic* linux-image-4.4.10-040410-generic* linux-image-4.4.9-040409-lowlatency* linux-image-extra-4.4.0-21-generic* linux-kernel-generic* 0 upgraded, 0 newly installed, 11 to remove and 547 not upgraded. After this operation, 864 MB disk space will be freed. (Reading database ... 296860 files and directories currently installed.) Removing linux-kernel-generic (4.4.0-21) ... Removing linux-headers-4.4.0-21-generic (4.4.0-21.37) ... Removing linux-headers-4.4.0-21 (4.4.0-21.37) ... Removing linux-headers-4.4.10-040410-generic (4.4.10-040410.201605110631) ... Removing linux-headers-4.4.10-040410 (4.4.10-040410.201605110631) ... Removing linux-headers-4.4.9-040409-lowlatency (4.4.9-040409.201605041832) ... Removing linux-headers-4.4.9-040409 (4.4.9-040409.201605041832) ... Removing linux-image-extra-4.4.0-21-generic (4.4.0-21.37) ... . . . done Purging configuration files for linux-image-4.4.9-040409-lowlatency (4.4.9-040409.201605041832) ... Examining /etc/kernel/postrm.d . run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.9-040409-lowlatency /boot/vmlinuz-4.4.9-040409-lowlatency run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.9-040409-lowlatency /boot/vmlinuz-4.4.9-040409-lowlatency