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

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

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

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

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

请帮忙。

答案1

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

另一种选择是构建自己的内核或使用原始内核:如何获取并安装未修改的内核?

答案2

如果您了解一些基本的 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

相关内容