《LINUX教程:在CentOS和Ubuntu 16.04 中安裝 Linux Kernel 4.12》要點:
本文介紹了LINUX教程:在CentOS和Ubuntu 16.04 中安裝 Linux Kernel 4.12,希望對您有用。如果有疑問,可以聯系我們。
Linus Torvalds在7月2日星期天宣布了Linux Kernel 4.12的最終穩定發布.在發行說明中,他提到4.12是歷史上較大的版本之一. 在本指南中,我們將看到如安在CentOS和Ubuntu操作系統中安裝Linux Kernel 4.12. 然而,這里提供的步驟將適用于其他基于YUM和基于APT的系統.
Linux Kernel 4.12 正式宣布,支持 AMD Vega?
以下步調在CentOS 7 64位最低版本中進行了測試. 但是,它可能適用于其他RPM發行版,如RHEL,Fedora和Scientific Linux.
最新的內核在官方存儲庫中不可用. 所以,我們必要添加ELRepo存儲庫來安裝這個最新的內核.
以下步調應以root用戶身份運行.
起首,添加ELRepo GPG密鑰,如下所示:
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
然后,使用敕令在CentOS 7 / RHEL 7 / Scientific Linux 7中添加ELRepo:
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
為CentOS 6 / RHEL 6 / Scientific Linux 6安裝ELRepo:
rpm -Uvh http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm
經由過程安裝以下軟件包啟用ELRepo最快的鏡像:
yum install yum-plugin-fastestmirror
我們添加了ELRepo. 如今是安裝Linux kernel 4.12的時候了.
以防萬一,您想要查看當前安裝的內核版本,請運行以下敕令:
uname -r
輸出如下內容:
3.10.0-514.16.1.el7.x86_64
正如上面的輸出,我的CentOS 7測試情況正在運行Linux內核版本3.10.0-514.16.1.el7.x86_64.
接下來,啟用ELRepo并使用敕令安裝Linux Kernel 4.12版本:
yum --enablerepo=elrepo-kernel install kernel-ml
安裝內核后,重新啟動體系并從Grub啟動菜單中選擇最新的內核.
登錄體系后,可以驗證新安裝的內核版本,如下所示.
uname -r
將會輸出以下示例:
4.12.0-1.el7.elrepo.x86_64
恭喜! 您已經勝利更新了Linux內核. 現在,您的系統由最近穩定的Linux Kernel 4.12版本驅動.
如果在安裝新的Linux內核后遇到任何問題? 沒問題,重啟系統. 從領導菜單中選擇先前安裝的內核.
然后,使用敕令刪除新安裝的內核:
yum remove kernel-ml
便是這樣.
更多詳情見請繼續閱讀下一頁的出色內容:
_baidu_page_break_tag_在Ubuntu 16.04 LTS服務器中測試以下步調. 但是,本指南應該可以使用其他的Ubuntu版本,還有Debian,Linux Mint.
要查看當前安裝的內核,請運行:
uname -r
示例輸出:
4.4.0-34-generic
如您所見,我的Ubuntu 16.04體系正在運行4.4.0-34-generic內核版本.
如今,我們將安裝Linux Kernel 4.12. 您可以從以下鏈接下載最新的內核.
對付64位Ubuntu系統:
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.12/linux-headers-4.12.0-041200_4.12.0-041200.201707022031_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.12/linux-headers-4.12.0-041200-generic_4.12.0-041200.201707022031_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.12/linux-image-4.12.0-041200-generic_4.12.0-041200.201707022031_amd64.deb
對付32位Ubuntu系統:
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.12/linux-headers-4.12.0-041200_4.12.0-041200.201707022031_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.12/linux-headers-4.12.0-041200-generic_4.12.0-041200.201707022031_i386.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.12/linux-image-4.12.0-041200-generic_4.12.0-041200.201707022031_i386.deb
接下來,使用敕令安裝Linux Kernel 4.12:
sudo dpkg -i *.deb
樣例輸出:
Selecting previously unselected package linux-headers-4.12.0-041200. (Reading database ... 91595 files and directories currently installed.) Preparing to unpack linux-headers-4.12.0-041200_4.12.0-041200.201707022031_all.deb ... Unpacking linux-headers-4.12.0-041200 (4.12.0-041200.201707022031) ... Selecting previously unselected package linux-headers-4.12.0-041200-generic. Preparing to unpack linux-headers-4.12.0-041200-generic_4.12.0-041200.201707022031_amd64.deb ... Unpacking linux-headers-4.12.0-041200-generic (4.12.0-041200.201707022031) ... Selecting previously unselected package linux-image-4.12.0-041200-generic. Preparing to unpack linux-image-4.12.0-041200-generic_4.12.0-041200.201707022031_amd64.deb ... Done. Unpacking linux-image-4.12.0-041200-generic (4.12.0-041200.201707022031) ... Setting up linux-headers-4.12.0-041200 (4.12.0-041200.201707022031) ... Setting up linux-headers-4.12.0-041200-generic (4.12.0-041200.201707022031) ... Setting up linux-image-4.12.0-041200-generic (4.12.0-041200.201707022031) ... 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.12.0-041200-generic /boot/vmlinuz-4.12.0-041200-generic run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.12.0-041200-generic /boot/vmlinuz-4.12.0-041200-generic update-initramfs: Generating /boot/initrd.img-4.12.0-041200-generic W: mdadm: /etc/mdadm/mdadm.conf defines no arrays. run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.12.0-041200-generic /boot/vmlinuz-4.12.0-041200-generic run-parts: executing /etc/kernel/postinst.d/update-notifier 4.12.0-041200-generic /boot/vmlinuz-4.12.0-041200-generic run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.12.0-041200-generic /boot/vmlinuz-4.12.0-041200-generic Generating grub configuration file ... Found linux image: /boot/vmlinuz-4.12.0-041200-generic Found initrd image: /boot/initrd.img-4.12.0-041200-generic Found linux image: /boot/vmlinuz-4.4.0-34-generic Found initrd image: /boot/initrd.img-4.4.0-34-generic Found linux image: /boot/vmlinuz-4.4.0-22-generic Found initrd image: /boot/initrd.img-4.4.0-22-generic done
最后,使用命令更新Grub引導加載法式:
sudo update-grub
樣例輸出:
Generating grub configuration file ... Found linux image: /boot/vmlinuz-4.12.0-041200-generic Found initrd image: /boot/initrd.img-4.12.0-041200-generic Found linux image: /boot/vmlinuz-4.4.0-34-generic Found initrd image: /boot/initrd.img-4.4.0-34-generic Found linux image: /boot/vmlinuz-4.4.0-22-generic Found initrd image: /boot/initrd.img-4.4.0-22-generic done
sudo update-burg
重新啟動系統并登錄到新安裝的內核.
反省新的內核是否安裝了命令:
uname -r
我的Ubuntu體系的輸出示例:
4.12.0-041200-generic
If you have any problems after upgrading to the latest Kernel, force reboot your system, and login to the old Kernel by selecting the?‘Advanced options for Ubuntu’?option from the Boot menu.
假如在升級到最新的內核后遇到任何問題,請強制重新啟動系統,并通過從“啟動”菜單中選擇“Advanced options for Ubuntu’?”選項登錄舊的內核.
選擇沒有任何問題的舊內核.
然后使用敕令卸載新的內核:
sudo apt-get remove linux-headers-4.12* linux-image-4.12*
末了,重新啟動系統再次登錄到舊的內核.
另外,有一個最簡單的方式可以升級到類似Ubuntu的系統中最新的內核. 如果您不喜歡命令行方式,您可以使用Ubuntu內核升級實用法式輕松升級Ubuntu Linux Mint中的Linux內核.
今朝為止就這樣了.如果您發現本教程有用,請在您的網絡上分享,并支持Linuxidc.com.
Ubuntu 上安裝 Linux Kernel 4.9.26 內核?
Ubuntu 16.04.2 安裝Linux kernel 4.10 內核并辦理 VMware 問題?
Linux Kernel 4.2.2 編譯安裝教程?
Ubuntu 15.10 將使用 Linux Kernel 4.2 內核?
怎樣在 CentOS 7 上安裝 Kernel 4.0.2?
怎樣在 CentOS 7 體系上安裝Linux Kernel 4.0?
如安在Ubuntu/CentOS上安裝Linux內核4.0?
Ubuntu、Linuxmint 及衍生版本安裝Linux Kernel 4.10.1?
如安在Ubuntu 14.10,Ubuntu 14.04及其衍生版本安裝 3.16.7 CKT2內核 ?
Linux Kernel 的詳細先容:請點這里
Linux Kernel 的下載地址:請點這里
本文永遠更新鏈接地址:
學習更多LINUX教程,請查看站內專欄,如果有LINUX疑問,可以加QQ交流《LINUX教程:在CentOS和Ubuntu 16.04 中安裝 Linux Kernel 4.12》。
轉載請注明本頁網址:
http://www.snjht.com/jiaocheng/9779.html