<%@LANGUAGE="VBSCRIPT" CODEPAGE="950"%> RedHat-up2date

 

RedHat up2date 之使用介紹


作者﹕Huckly <huckly@live.net.tw>

 

如果你在某個網站看到有套件要升級 或是 搞不清楚 現在到底有哪些套件可以升級

RedHat 裡面有個不錯的好工具 up2date

透過 up2date 你可以 無痛 照顧你的 RedHat 只要 記的 沒事 up 一下就好了喔

註冊方式

如果你第一次 執行 up2date

系統會去檢查 設定檔 結果會發現 你在 redhaat 的國安局(Red Hat Network 簡稱 RHN)沒紀錄

 

所以你要執行

# rhn_register

之後會出現這個畫面

請按 NEXT

再出現

在按 NEXT

出現

這個帳號 也就是你在 RHN 的帳號

這也表示 你可以多台機器共用一帳號

我的經驗是 隨便填填

在下來 按 NEXT

 

選擇你想要管理的套件

他告訴你說你 host 所有秘密都會傳回 redhat 喔

傳喔 傳喔

傳完啦 按 FINISH 回到 console

 

註冊完成後

# up2date --configure

會看到

0.  storage Dir /var/spool/up2date
1.   headerCacheSize 40
2. httpProxy  
3.
 debug No
4.   useGPG Yes
5.  networkRetries 5
6.  removeSkipList ['kernel*']
7. retrieveOnly No
8. keepAfterInstall  No
9. enableProxy No
10. gpgKeyRing /etc/sysconfig/rhn/up2date-keyring.gpg
11. proxyUser  
12. proxyPassword  
13. headerFetchCount 10
14. versionOverride  
15. useNoSSLForPackage No
16. enableProxyAuth No
17. noSSLServerURL http://www.rhns.redhat.com/XMLRPC
18. noReplaceConfig Yes
19. sslCACert /usr/share/rhn/RHNS-CA-CERT
20. noBootLoader No
21. systemIdPath /etc/sysconfig/rhn/systemid
22. serverURL https://www.rhns.redhat.com/XMLRPC
23. pkgSkipList ['kernel*']
24. adminAddress ['root@localhost']
25. forceInstall No
26. fileSkipList []
27. retrieveSource No

 

Enter number of item to edit <return to exit, q to quit without saving>:


選擇你想修改項目的號碼 便可修正 相關參數

 

升級方式

第一部 收集 需更新套件資訊

# up2date -u

 

喔喔 出現

Your GPG keyring does not contain the Red Hat, Inc. public key.
Without it, you will be unable to verify that packages Update Agent downloads
are securely signed by Red Hat.

Your Update Agent options specify that you want to use GPG.

To install the key, run the following as root:

/usr/bin/gpg --homedir /root/.gnupg --import /usr/share/rhn/RPM-GPG-KEY

所以 我就執行

# /usr/bin/gpg --homedir /root/.gnupg --import /usr/share/rhn/RPM-GPG-KEY

回應 出

 

gpg: key DB42A60E: public key imported
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: Total number processed: 1
gpg: imported: 1

ok在執行一次吧

 

# up2date -u

-u 表示 --update 跟新系統相關套件的資訊

會看到

 

Retrieving list of all available packages... (接收所有可以更新套件資訊)
########################################
########################################

Removing installed packages from list of updates...(移除已安裝套件資訊)
########################################

Removing packages marked to skip from list...(從清單移除被作註記的套件)
########################################

Getting headers for available packages...(建立可用套件之標題)
########################################

Removing packages with files marked to skip from list...(移除檔案被註記的套件)
########################################

Getting headers for skipped packages...(取得被忽略套件的標題)
########################################
The following Packages were marked to be skipped by your configuration:

Name                Version     Rel        Reason
-------------------------------------------------------------------------------
dhcp                    2.0pl5    4        Config modified
imap                    2001a   1.71.0  Config modified
kernel                 2.4.9     34       Pkg name/pattern
kernel-headers    2.4.9      34     Pkg name/pattern
kernel-source      2.4.9      34    Pkg name/pattern


Testing package set / solving RPM inter-dependencies...
There was a package dependency problem. The message was:

Unresolvable chain of dependencies:
XFree86-4.1.0-25 requires kernel-drm = 4.1.0

如果你想知道 你的系統 有哪些 套件需要跟新

# up2date -l

之後 會 列出 你安裝套件 哪些 有要升級

Retrieving list of all available packages...
########################################
########################################

Removing installed packages from list of updates...
########################################

Removing packages marked to skip from list...
########################################

Getting headers for available packages...
########################################

Removing packages with files marked to skip from list...
########################################

Getting headers for skipped packages...
########################################

Name              Version     Rel
----------------------------------------------------------
LPRng             3.7.4       23.1
Mesa               3.4.2       10
Mesa-devel     3.4.2       10
SysVinit          2.78        17
XFree86          4.1.0       25
XFree86-100dpi-fonts 4.1.0 25
XFree86-75dpi-fonts 4.1.0 25
XFree86-SVGA 3.3.6 38
XFree86-devel 4.1.0 25
XFree86-libs 4.1.0 25
XFree86-tools 4.1.0 25
XFree86-twm 4.1.0 25
pam                0.75      18.7
pam-devel      0.75      18.7

.
.
.
.

 

 

從這裡知道 你哪些套件 需要升級

所以 你就可以

up2date 後面直接加 套件名稱 就可以

如果你的 機器 在網路上 就會直接連線 到 RHN 下載更新

# up2date pam

[root@dns update]# up2date pam

Retrieving list of all available packages...
########################################
########################################

Removing installed packages from list of updates...
########################################

Removing packages with files not specified from list...

Removing packages marked to skip from list...
########################################

Getting headers for available packages...
########################################

Removing packages with files marked to skip from list...
########################################

Testing package set / solving RPM inter-dependencies...
########################################
The following packages were added to your selection to satisfy dependencies:

Name Version Release
--------------------------------------------------------------
pam-devel 0.75 18.7

Retrieving selected packages...
pam-0.75-18.7.i386.rpm: ########################## Done.
pam-devel-0.75-18.7.i386.rp ########################## Done.
Preparing... ########################################### [100%]
1:pam warning: /etc/security/console.perms created as /etc/security/console.perms.rpmnew
warning: /etc/security/limits.conf created as /etc/security/limits.conf.rpmnew
warning: /etc/security/pam_env.conf created as /etc/security/pam_env.conf.rpmnew ########################################### [ 50%]
2:pam-devel ########################################### [100%]

不錯吧 還會自動捉 相依套件 pam-devel 省卻你每次在執行 rpm 一堆 莫名其妙 的 訊息

在這裡 不作 X windows 的 up2date 因為 網路上已經有網友 的相關文章

請參考

Red Hat Network 網路套件更新機制 -- rhn_register 及up2date