Centos 6/7 源碼升級核心

來源:互聯網
上載者:User
centos源碼升級核心方法
最近在研究docker,需要升級核心,下面說一下升級核心的方法。
1.下載核心源碼
下載網址為 https://www.kernel.org/ 我使用的為3.10版本 下載地址為

https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.12.44.tar.xz

下載命令:

# wget  https://www.kernel.org/pub/linux/kernel/v3.x/linux-

3.12.44.tar.xz

2.解壓原始碼

# tar -xvf linux-3.12.44.tar.xz

# cd linux-3.12.44.tar.xz

3.更新系統並安裝依賴軟體
# yum update

# yum upgrade

# yum groupinstall  Development Tools

# yum install ncurses-develqt-develhmaccalc zlib-devel binutils-devel

elfutils-libelf-devel

4.將當前核心設定檔拷貝到目前的目錄
用下面命令查看核心版本

# uname -r

3.10.0-229.1.2.el7.x86_64

將對應核心的設定檔拷貝到目前的目錄

#cp /boot/config-3.10.0-229.1.2.el7.x86_64 .config

其中/boot/config- 後面的核心版本為你剛查詢出來的核心版本

centos6.5 預設版本為2.6 centos7的版本為3.10

5.使用當前核心的配置
# sh -c ' yes “” | make oldconfig'     #centos6中使用這個命令

# sh -c ' y“” | make oldconfig'     #centos7中使用這個命令
6.編譯安裝
# make bzImage

# make modules

# make modules_install

# make install


編譯安裝過程可能比較慢 請耐心等待

7.修改grub修改順序
# vim /etc/grub.conf

找到你新安裝核心的位置,一般都是第一個,如果是第一個的話,設定 default = 0

centos7 不需要修改 預設改為第一啟動項

8.重啟電腦
# reboot










相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.