如何下载和使用除默认安装的内核之外的任何其他内核

假设我使用的是Ubuntu 12.04(LTS),它使用3.5.0-37内核。

如果我想使用3.9.6内核,我该如何使用它? 我不想升级到13.04

我是否必须手动下载此内核,编译它并创建它的initrd,或者我可以通过启用某些存储库使用apt-get install来获取它吗?

请帮忙。

向后移植的内核在12.04中可用,请参阅以下问题以获取有关如何启用它们的说明:

  • Ubuntu点发布会包含一个新的Linux内核吗?
  • 12.04.2中的Quantal backported内核? 那里发生了什么?
  • 如何将12.04.2内核和HWE升级到raring?

另一种方法是构建自己的内核或使用vanilla内核: 如何获取和安装未修改的内核?

如果你知道一些基本的bash脚本,从下面的脚本(即使它们看起来很长很容易理解)你可以看到如何下载和使用任何其他内核。

echo " " && echo "This script will attempt to install Linux Kernel 3.9 on this machine." && echo "Typically, your current version will be kept, and you will be able to ustilise it again later if Kernel 3.9 does not work." && echo " " && read -p "Press Enter to continue, or abort by pressing CTRL+C" nothing && echo " " && echo "Downloading Kernel 3.9 Packages" && echo "3 Files, 55 MB to Download" && echo " " && echo "Creating Kernel Directory in Home folder" && echo " " && mkdir -p $HOME/kernel-htu && cd $HOME/kernel-htu && echo " " && echo "Downloading File 1 of 3, 12 MB" && echo " " && wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9.11-saucy/linux-headers-3.9.11-030911_3.9.11-030911.201307202035_all.deb && echo " " && if [ $(getconf LONG_BIT) = "64" ] then echo "64bit Detected" && echo " " && echo "Downloading File 2 of 3, 1 MB" && echo " " && wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9.11-saucy/linux-headers-3.9.11-030911-generic_3.9.11-030911.201307202035_amd64.deb && echo " " && echo "Downloading File 3 of 3, 43 MB" && wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9.11-saucy/linux-image-3.9.11-030911-generic_3.9.11-030911.201307202035_amd64.deb else echo "32bit Detected" && echo " " && echo "Downloading File 2 of 3, 1 MB" && echo " " && wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9.11-saucy/linux-headers-3.9.11-030911-generic_3.9.11-030911.201307202035_i386.deb && echo " " && echo "Downloading File 3 of 3, 42 MB" && echo " " && wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9.11-saucy/linux-image-3.9.11-030911-generic_3.9.11-030911.201307202035_i386.deb fi && echo " " && echo "Installing Kernel" && echo "This step will require you password." && echo "This is the last step you can safely cancel at." && echo "Use Ctrl+C to cancel." && echo " " && sudo dpkg -i *.deb && echo " " && echo "Installation Complete" && echo " " && read -p "Press Enter to Delete the Downloads, or CTRL+C to keep them." nothing && echo " " && sudo rm -rf $HOME/kernel-htu 

来源: 如何安装Linux内核3.9 – 如何Ubuntu (访问最新版本)。

 echo " " && echo "This script will attempt to install Linux Kernel 3.10 on this machine." && echo "Typically, your current version will be kept, and you will be able to ustilise it again later if Kernel 3.10 does not work." && echo " " && read -p "Press Enter to continue, or abort by pressing CTRL+C" nothing && echo " " && echo "Downloading Kernel 3.10 Packages" && echo "3 Files, 57 MB to Download" && echo " " && echo "Creating Kernel Directory in Home folder" && echo " " && mkdir -p $HOME/kernel-htu && cd $HOME/kernel-htu && echo " " && echo "Downloading File 1 of 3, 12 MB" && echo " " && wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10.6-saucy/linux-headers-3.10.6-031006_3.10.6-031006.201308112316_all.deb && echo " " && if [ $(getconf LONG_BIT) = "64" ] then echo "64bit Detected" && echo " " && echo "Downloading File 2 of 3, 1 MB" && echo " " && wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10.6-saucy/linux-headers-3.10.6-031006-generic_3.10.6-031006.201308112316_amd64.deb && echo " " && echo "Downloading File 3 of 3, 44 MB" && echo " " && wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10.6-saucy/linux-image-3.10.6-031006-generic_3.10.6-031006.201308112316_amd64.deb else echo "32bit Detected" && echo " " && echo "Downloading File 2 of 3, 1 MB" && echo " " && wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10.6-saucy/linux-headers-3.10.6-031006-generic_3.10.6-031006.201308112316_i386.deb && echo " " && echo "Downloading File 3 of 3, 43 MB" && wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10.6-saucy/linux-image-3.10.6-031006-generic_3.10.6-031006.201308112316_i386.deb fi && echo " " && echo "Installing Kernel" && echo "This step will require you password." && echo "This is the last step you can safely cancel at." && echo "Use Ctrl+C to cancel." && echo " " && sudo dpkg -i *.deb && echo " " && echo "Installation Complete" && echo " " && read -p "Press Enter to Delete the Downloads, or CTRL+C to keep them." nothing && echo " " && sudo rm -rf $HOME/kernel-htu 

来源: 如何安装Linux内核3.10 – 如何Ubuntu (访问最新版本)。


您可以从http://kernel.ubuntu.com/~kernel-ppa/mainline下载任何内核。