新聞中心
, sudo reboot, “準(zhǔn)備工作
在升級Linux Kernel之前,我們需要確保已經(jīng)完成了以下準(zhǔn)備工作:

泰州網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián)公司,泰州網(wǎng)站設(shè)計制作,有大型網(wǎng)站制作公司豐富經(jīng)驗。已為泰州近1000家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\成都外貿(mào)網(wǎng)站建設(shè)要多少錢,請找那個售后服務(wù)好的泰州做網(wǎng)站的公司定做!
1、確保系統(tǒng)已經(jīng)更新到最新版本,可以使用以下命令進(jìn)行更新:
sudo apt-get update sudo apt-get upgrade
2、備份重要的數(shù)據(jù)和配置文件,以防止升級過程中出現(xiàn)問題導(dǎo)致數(shù)據(jù)丟失,可以使用以下命令進(jìn)行備份:
sudo mv /home/用戶名 /home/備份用戶名 sudo cp /etc/skel /etc/skel_backup sudo cp /etc/passwd /etc/passwd_backup sudo cp /etc/shadow /etc/shadow_backup sudo cp /etc/gshadow /etc/gshadow_backup sudo cp /etc/group /etc/group_backup sudo cp /etc/sudoers /etc/sudoers_backup
3、安裝必要的軟件包,以便在升級過程中使用,可以使用以下命令進(jìn)行安裝:
sudo apt-get install wget build-essential libssl-dev libffi-dev python3-setuptools xz-utils proot
4、添加Ubuntu官方的PPA源,以便獲取最新的內(nèi)核源碼,可以使用以下命令添加:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update
下載內(nèi)核源碼
在完成以上準(zhǔn)備工作后,我們可以開始下載Linux Kernel 4.2的源碼,使用以下命令添加內(nèi)核4.2的PPA源:
sudo add-apt-repository ppa:kernelppa/ppa sudo apt-get update
接下來,選擇要下載的內(nèi)核版本,這里以4.2版本為例:
wget https://kernel.org/pub/linux/kernel/v4.x/linux-4.2.tar.xz
解壓并編譯內(nèi)核源碼
下載完成后,我們需要解壓內(nèi)核源碼并編譯,進(jìn)入到下載目錄:
cd linux-4.2
解壓內(nèi)核源碼:
tar xf linux-4.2.tar.xz
接下來,進(jìn)入解壓后的目錄:
cd linux-4.2.0.1675708955-fasrc01~xenial1_64bit/arch/x86_64/boot/bzImage
由于我們只需要升級內(nèi)核,所以不需要重新編譯整個內(nèi)核,只需將當(dāng)前目錄下的bzImage復(fù)制到原來的內(nèi)核目錄下即可,假設(shè)原來的內(nèi)核目錄為/usr/lib/linux,可以使用以下命令完成復(fù)制:
sudo cp arch/x86_64/boot/bzImage /usr/lib/linux/modules/$(uname -r)/kernel/bzImage sudo cp arch/x86_64/boot/System.map /usr/lib/linux/modules/$(uname -r)/kernel/System.map-$(uname -r)
更新引導(dǎo)加載器(GRUB)配置文件并重啟系統(tǒng)
完成內(nèi)核源碼的復(fù)制后,我們需要更新GRUB引導(dǎo)加載器的配置文件,以便在下次啟動時使用新的內(nèi)核,可以使用以下命令打開GRUB配置文件:
sudo nano /etc/default/grub
在配置文件中,找到以下行:
GRUB_CMDLINE_LINUX="debian-installer=en_US"
"quiet"
"--no-floppy"
"--boot-directory=/boot"
"--recheck"
"--backtrack=20"
"--debug"
"--target=x86_64-pc"
"--LXC_CPUMASK=0x1fffffff"
"--force-confold"
"--netboot"
"--inst.repo=http://mirrors.ustc.edu.cn/ubuntu//pools"
"--extra-args=console=ttyS0 console=ttyAMA0,115200n8 serial"
"--initrd=initrd.img-4.2.0-amd64"
"--bootloader-id=grub_uefi.mod"
"--systemd.unit=multi-user.target"
"--" $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grub; " $@ > ~/.config/grub; chmod +x ~/.config/grub; update-grldinfo && reboot now"
"GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_sleep_override=0 acpi_screen_wakeup delay=3 quiet splash"
"GRUB_TERMINAL="console serial"
"GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=none --stop=1""
"GRUB_SERIAL_DISABLE_HIDING=true"
"GRUB_DEFAULT="saved default"
"GRUB_TIMEOUT=300"
"GRUB_DISTRIBUTOR=“Debian”"
"GRUB_CODENAME=“jessie”"
"GRUB_DISTRIBUTION="Ubuntu”"
"GRUB_DESCRIPTION="Ubuntu $(lsb_release –rs)” (on x86_64)”"
"GRUB_HOMEDIR=("/boot")
"GRUB_CONFIGURATION="/boot/*cfg*” (in response to configuration)”"
"GRUB_ARGS=(“normal”) (in response to command line)”
exit“ >> $HOMEPATH ~ “AppData” ~ “Local” ~ “Software” ~ “CanonicalGroupings” ~ “Ubuntu” ~ “update-rc” ~ “runscripts” ~ “initctlfile ”
echo “Done! Please reboot your system and enjoy the new kernel!”
分享文章:怎么將Ubuntu升級到LinuxKernel4.2
文章地址:http://fisionsoft.com.cn/article/dpgojgs.html


咨詢
建站咨詢
