歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux管理 >> Linux維護 >> 手動升級Gentoo及其內核的方法

手動升級Gentoo及其內核的方法

日期:2017/3/2 10:30:15   编辑:Linux維護

通常Gentoo系統都有自帶升級的,如果系統不能自動升級,那麼要如何手動升級系統呢?內核又該如何升級呢?下面小編分別給大家介紹下Gentoo升級系統和內核的方法,希望對大家能有所幫助。

一、內核升級

1.#emerge --sync //升級整個portage目錄 也可以寫腳本

2. #emerge -s sources emerge -avq gentoo-sources

[ebuild NS ] sys-kernel/gentoo-sources-3.10.4 [3.9.0] USE=“-build -deblob -symlink”

編譯內核

3.# cd /usr/src/linux-3.10.4-gentoo

#make -j5 menuconfig 編譯內核不再贅述。 make -j5 && make install modules_install

修改grub啟用新內核。

vim /boot/grub/grub.conf

123456 default 1

timeout 5

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title Gentoo 3.10.4

root (hd0,0)

kernel /boot/vmlinuz-3.10.4-gentoo ro root=/dev/sda1 rootfstype=ext4 quiet

二、系統升級。

4.#emerge -avq portage //如果不是最新的portage,需要按提示執行此操作

5.#emerge -avq python //如果不是最新的python,需要按提示執行此操作

6.#/usr/sbin/update-python 或者 python-updater //更新python配置 //執行完emerge python後執行此操作

7.#emerge -avquDN world //按照 /var/lib/portage/world 文件下的包,重新構建整個系統

參數說明: --ask (-a) 控制Portage顯示它要更新的軟件包列表,並讓您決定是否繼續更新

--verbose (-v) 在屏幕上輸出完整的文件列表

--update (-u) 更新包的最佳版本

--deep (-D) 更新系統中的每個軟件包

--newuse (-N) USE標記變更後,要使Portage檢查USE標記的變動是否導致

需要安裝新的軟件包或者將現有的包重新編譯

8.#emerge -av --depclean //清除不需要(孤立)的軟件包

9.#revdep-rebuild //gentoolkit包裡面的一個軟件,用來檢查系統的依賴關系是否都滿足,自動安裝沒有滿足關系的包

10.#perl-cleaner --all -- -avq //把perl相關的模塊和文件都檢查並修正一遍

11.#dispatch-conf //更新系統的配置文件

12.eselect news read all //查看提示消息

#emerge -e world //本地重新編譯整個系統。 暫不需要這一步。

上面就是Gentoo升級系統和內核的方法介紹了,通過本文介紹的方法,您就能夠將Gentoo及其內核升級到最新版本,但最新版本可能存在bug,不可盲目升級。

Copyright © Linux教程網 All Rights Reserved