ubuntu更換linux內核

所有操作全在root下進行,因此要先su一下

1.下載linux 4.4.1內核

下載地址http://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-4.4.1.tar.gz

2.安裝必備軟件編譯工具:

apt-get install libncurses5-dev build-essential kernel-package

3.解壓下載好的內核

tar -zxf linux-4.4.1.tar.gz /usr/src

4.配置內核

清除以前曾經編譯過的舊文件

make mrproper

把當前系統的config拷貝過來

cd /usr/src/linux-4.4.1
cp /boot/config-XX ./.config
make menuconfig

進入圖形界面後,先選擇load,再選擇save,然後退出。

5.編譯內核

make

6.加入模塊

make modules_install

7.生成可執行的內核引導文件

make bzImage
cp arch/x86/boot/bzImage /boot/vmlinuz-4.4.1

make的時候可能會報錯scripts/sign-file.c:23:30: fatal error: openssl/opensslv.h: No such file or directory。
這時只要安裝一個包即可。

apt-get install libssl-dev

8.將System.map複製到/boot下:

cp System.map /boot/System.map-4.4.1

9.生成initrd.img文件

cd /lib/modules/4.4.1
update-initramfs –c –k 4.4.1

10.更新grub引導列表

update-grub
gedit /boot/grub/grub.cfg

到該文件的最下面,找到4.4.1的menuentry,把它複製到export linux_gfx_mode後面。然後重啓就可以了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章