銝yum蝘駁方摰鋆
/ b( ?. e3 W& D: X7 g! Y1.亥岷臬行摰鋆yum7 ~0 J8 i. U9 U7 @' D' z( ]
1 w8 g9 O( a+ I2 f7 _! ^- [root@localhost ~]# rpm -qa | grep yum0 Q! n% a4 v- U ]8 @
- yum-metadata-parser-1.1.2-3.el5.centos
" G) M8 E1 D$ O9 v0 U) h2 q0 H6 I7 Z - yum-3.2.22-33.el5.centos
' R, d2 @+ A5 A* G3 F+ m; e - yum-fastestmirror-1.1.16-14.el5.centos.1
/ c' I# Y A( A9 l" z' v" {+ r; t - yum-updatesd-0.9-2.el5
銴鋆賭誨蝣 ( ~& h" }! ^5 { I
2.蝘駁巾um (蝘駁斤孵拍車銝喳)8 k! f1 u1 O T6 b+ t& \: f6 c
2.1肘um孵蝘駁
+ {1 @2 B. ?% u2 i$ h! H8 `8 x- [root@localhost ~]# yum remove yum*
銴鋆賭誨蝣
! m2 K: E9 ^4 J- K' A2.2禿pm -e孵蝘駁
4 B. K2 R( U2 }#亦鈭yum瑼獢閬蝘駁斤
Z8 y* c% ]7 J, L- [root@localhost ~]# rpm -qa | grep yum( I. b; u. Y9 b7 k6 s, ^' y9 r% i
- yum-metadata-parser-1.1.2-3.el5.centos& a4 j4 I4 ?" ]2 k$ P. h8 _; S( F
- yum-3.2.22-33.el5.centos
: f& E9 [% }1 g' n* m+ G' `# M - yum-fastestmirror-1.1.16-14.el5.centos.12 w/ C" v" R. Y, F
- yum-updatesd-0.9-2.el5
銴鋆賭誨蝣
, W/ A8 G; q7 d2 N#蝘駁巾um憒閬敹賜亦訾抒憿,臭蝙 --nodeps 賊
/ ?# e9 \' a3 W3 k- _% o j- [root@localhost ~]# rpm -e yum-metadata-parser-1.1.2-3.el5.centos
9 p; \) S% J1 l8 r$ j - [root@localhost ~]# rpm -e yum-3.2.22-33.el5.centos
# m3 x/ K/ i7 Z) y/ Y, m - [root@localhost ~]# rpm -e yum-fastestmirror-1.1.16-14.el5.centos.10 X8 E3 u; d& D. f d2 [
- [root@localhost ~]# rpm -e yum-updatesd-0.9-2.el5
銴鋆賭誨蝣
R/ a0 P/ W9 q( q, p鈭摰鋆yum
: T0 W% @" z6 s2 P! [, M5 ?1.摰鋆皞/ W7 t1 I$ e9 R2 e
典鋆皞其遢臭誑唬誑銝蝬脣亦
" u0 J# Z4 H: V隢靘芾閬曉啣鋆皞
/ e# Q- Z% F# j4 M' u- X+ Pi386 : ' d" E/ H0 y" N( z- N+ i& e
http://mirrors.sohu.com/centos/5/os/i386/CentOS/& t g2 X( s6 o! A
http://mirror.centos.org/centos-5/5/os/i386/CentOS/
. b6 f7 j( d3 u2 J# c9 ] m7 G1 S
7 l; q! ~ D4 ~2 Ax86_64 : " W0 A' d- H2 o
http://mirrors.sohu.com/centos/5/os/x86_64/CentOS/
7 ^& a4 Z0 {) Khttp://mirror.centos.org/centos-5/5/os/x86_64/CentOS/9 }) ]8 A9 ]& U
- z$ q9 J0 {, Y$ w# c' i0 X5 p
% y- v/ g. J3 k3 S肘um其遢銝餉臭蝙典唬誑銝4瑼
, R1 {7 ]6 J8 {) \yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
8 }- U$ W$ o# `! u4 X$ Q7 nyum-fastestmirror-1.1.16-16.el5.centos.noarch.rpm
$ L9 e0 G' d* b: \( B: ayum-3.2.22-37.el5.centos.noarch.rpm
1 U7 F1 m$ o: H a0 Kyum-updatesd-0.9-2.el5.noarch.rpm% m/ Y* l. \( I
. E x W: U6 _$ {" B- _2摰鋆yum
Z/ A7 v/ D/ J8 z' j5 z: H8 \2 ci3862 y# r8 F4 E4 w8 d. e
- [root@localhost ~]# rpm -ivh http://mirror.centos.org/centos-5/5/os/i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm http://mirror.centos.org/centos-5/5/os/i386/CentOS/yum-fastestmirror-1.1.16-16.el5.centos.noarch.rpm http://mirror.centos.org/centos-5/5/os/i386/CentOS/yum-3.2.22-37.el5.centos.noarch.rpm http://mirror.centos.org/centos-5/5/os/i386/CentOS/yum-updatesd-0.9-2.el5.noarch.rpm% ?7 M3 y5 b/ ^2 m" W
- [root@localhost ~]# rpm -qa |grep yum8 C3 L }# P& M8 \% L8 D; p
- yum-updatesd-0.9-2.el5: E8 g" ?# |8 u8 T' j; N4 F
- yum-metadata-parser-1.1.2-3.el5.centos
: N: i+ Z- f. v2 ?* Q9 d - yum-fastestmirror-1.1.16-16.el5.centos, [3 }; g9 K$ E, b$ H2 I9 r
- yum-3.2.22-37.el5.centos
銴鋆賭誨蝣 5 M c2 ~; _4 c9 g$ c5 ]3 ?
x86_64
( j7 \0 P2 t/ K3 [# B% _- [root@localhost ~]# rpm -ivh http://mirror.centos.org/centos-5/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm http://mirror.centos.org/centos-5/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-16.el5.centos.noarch.rpm http://mirror.centos.org/centos-5/5/os/x86_64/CentOS/yum-3.2.22-37.el5.centos.noarch.rpm http://mirror.centos.org/centos-5/5/os/x86_64/CentOS/yum-updatesd-0.9-2.el5.noarch.rpm
7 J& R* m& t# [ - [root@localhost ~]# rpm -qa |grep yum
/ ]. c- A4 t) M/ c - yum-updatesd-0.9-2.el5
& W; h2 A0 }4 ]# i' }9 R$ ] - yum-metadata-parser-1.1.2-3.el5.centos
2 V$ Y% Z! r; j: j7 H9 o - yum-fastestmirror-1.1.16-16.el5.centos& w) M! Y3 Y2 Q- o* i) A$ e0 A
- yum-3.2.22-37.el5.centos
銴鋆賭誨蝣
: x5 i, z7 S, h# I- ~2.2湔唳撌脣鋆憟隞(靘鈭粹瘙臬行湔)
/ O; a* Q2 K; L6 }& k- [root@localhost ~]# yum -y update
銴鋆賭誨蝣
7 J1 N' | f# n, l# j. M銝yum隞方牧
5 y; j3 M$ O2 R# r& G+ ~其蝙肘um嚗撠銝頛梯正嚗摮曉/var/cache/yum桅銝
4 q4 a9 F$ M* W0 k( N. S. C9 x1.yum湔" h/ `3 Z# Z/ V, `+ R+ Y- z
yum check-update
! x3 }1 i* I. j: H' z#瑼X亥賣湔啁憟隞嗆鈭
' D q6 ?% Z+ e1 n( m9 p( e. m% _+ `
yum update 0 L4 ]5 f: ~. ], W0 n0 {2 g
#湔唳撌脣鋆憟隞塚亙罕pdate敺X乩憟隞嗅蝔梁閰勗舫撠閰脣隞嗆湔5 V! V5 r |" k; }8 q
憒yum update httpd
: A- i. q$ H; b! P* p- A
0 b# ~% [# K Y$ P& h; {yum upgrade
9 w8 q* y3 o+ w#質update撌桐憭嚗撌桀亙冽慶um upgrade銝鈭喳瘣格掠憟隞嗡銝韏瑟湔堆憭批雿輻典函砍蝝
' ~" Q$ [; C4 v$ S* t5 D
c- s+ `+ V4 t% V1.1摰鋆.蝘駁文隞
2 [) j0 `, d, u8 a4 h1 r2 i9 H* Zyum install % O1 U3 b" J4 z+ x- W+ R
#摰鋆憟隞塚install敺X亥摰鋆憟隞嗅蝔梧憒yum install httpd亥賊銝韏瑕鋆閰勗臬冽敺銝*憒yum install httpd*- P B! T7 @ n; g( I+ w! Z
6 K0 F2 z$ S- fyum --enablerepo=(Repository) install 摰鋆芯蝙冽憟隞嗅澈,憒憭,銋臭誑,亦/etc/yum.repos.d/鈭.repo- h x- U: v* I2 V: w. |# S& {
憒yum --enablerepo remi,remi-php55 install php b2 A& F( [7 y. [ ^* c
; o5 T! J+ T, l0 p
yum reinstall啣鋆憟隞; w+ v! t1 P% L! y& Y
4 a8 Y J# e2 |, `# g3 e: @
yum remove
3 H) A1 N4 S5 c \. V#蝘駁文隞,券桀啁訾抒憿嚗臭誑yum deplist 曉箸訾憟隞,銝銝蝘駁支閬憟隞,頝喲閬靽憟隞,憒祉典隞(蝝憟隞嗅航賣典) , g# L. h: v% w& i( G' }
" l) [% ?: S" k: P& ]& l
靘憒:
, }( f1 [1 @5 H0 F1 w% f# P3 h! Q3 oyum deplist httpd | grep -v httpd | grep provider | awk '{print $2}' | sort -u$ A! D& r5 ?; X( j
remove敺舀亥蝘駁文隞嗅蝔梧憒yum remove httpd亥賊憟隞嗡銝韏瑞宏斤閰勗臬冽敺銝*憒yum remove httpd*
0 O6 \( i, L' J) Q$ u" [
* ?4 P. O3 E* G6 N4 w& Q" @yum clean6 o, L2 E9 h$ _! f* _. j' w7 a+ F
#皜文鋆銝頛怠憟隞嗅憪瑼嚗憭批臬曉/var/cache/yum嚗撣豢銝yum clean packages砰um clean all嚗銝甈∪典芷扎6 K% p: M+ Q7 G6 r$ z$ a
1 v" _# ~# {! m" f. _1.2皜怠
: ^7 Y2 t1 S- m% r' T0 f% M" Xyum clean
/ L* u% }& t, D- X8 \8 ^. Z4 q#皜文鋆銝頛怠隞嗅憪瑼嚗憭批臬曉/var/cache/yum; H) n& I ?6 P& f, L5 D
* J+ c0 Z+ B/ _: W: U
yum clean packages
& R- c! H' F' S# ~5 ]8 X#其皜斗怠(/var/cache/yum)桅銝憟隞
4 _9 x5 _4 @7 h- ^3 [; b" u! g" L& N9 k; v* x1 D8 J
yum clean headers
/ c( f2 S. Z2 R: i2 K#其皜斗怠(/var/cache/yum)桅銝 headers) X9 R! b6 `* H0 m& C" C
2 y, j, i3 s) ?. A: Zyum clean oldheaders
1 ?* \7 C6 ~" c R) P4 |#其皜斗怠(/var/cache/yum)桅銝 oldheaders - ]* ~! j1 j$ `% ?5 b) o. V' o
+ E& L, M) D- ]8 v5 D- Z% F. ^yum clearn all
7 c, k3 ^! K+ m5 @: p#湔交怠賭甈⊥扎
) N0 W) n# Q- R. D! q6 i
% T: c5 ?- t) U! T1.3皜4 L/ ?" ]0 j$ y+ w, _" ?, O
yum list+ j( O* A/ Q1 ~' A
#箸Repository摨憟隞塚亙甸ist敺X亙隞嗅蝔梧臬桃典箄府憟隞嗚
5 @% a* z" f; j# `8 B; U3 \. a& B" @. h8 _! e! W* K
yum list updates
$ C$ [2 s8 b7 g+ j* e, v! `! z#箸臭誑湔啁憟隞: {* b; q- e- P' x
8 [3 L5 Q1 R( i& W$ j% D$ Eyum list installed
1 S/ a3 Q+ [1 o- A& o: R" l#箸撌脩摰鋆憟隞
% p7 L! \0 l! g0 ~: C' }6 S7 d- a" \4 G, \+ Q+ \5 `" s% p/ B1 y
yum list extra
5 }- u9 I/ ?& b& r u#箸撌脣鋆雿銝 yum Repository摨 抒憟隞# {# U( i$ k" a4 x3 B& g
' X7 h* ]+ U; ]6 q! f, n3 y4 c
1.4箏隞嗥賊鞈閮. a# @. }! T. I8 Z
yum info
8 e0 W1 U' a {9 k#箸憟隞嗥賊鞈閮嚗亙甬nfo敺乩憟隞嗅蝔梧臬桃典箄府憟隞嗥賊鞈閮
" Y" i( r P* q. S憒yum info httpd yum info httpd*嚗撌桀亙冽潭*隞去ttpd剔賢箔
# C* t6 u, Y2 X8 \% W( {9 c! O {- [( z# |; A9 {) _8 X& `/ ~$ v
yum info updates& w; q3 E: ]- ^
#箸臭誑湔啁憟隞嗉閮: m* r0 K- l/ e
, e% y9 N4 h0 k- J+ N) Nyum info installed0 o7 G: X. r( S4 n& b5 s
#箸撌脣鋆憟隞嗉閮$ _9 I, M$ Q4 x
- R C3 y; x& B. X
yum info extras
/ S6 ^( ?; c; {* e#箸撌脣鋆雿銝 Yum Repository摨 抒憟隞嗉閮
) x: F6 ~ Z& ~ h( b! m p+ K) K4 F
& k; v% d8 T9 I" e5 b9 q$ k& l0 c9 n4 |+ p
1.5撠
8 i, {# x, |' o6 |yum search! S) D* H0 p' e) ?) { C0 l; t
#撠賊憟隞塚憒yum search httpd嚗典銝剜曉唳閬憟隞嗚憿隡潮萄券
0 n, u* W( k3 w$ u% Q6 m0 y# k3 Q9 y3 L4 q, P& r3 X: r2 U# Q
蝝憟隞嗡銝kernel
2 C; [; ^1 |9 c5 K- f$ h# i, W0 `憒唾肘um靘蝝憟隞塚雿銝喳逃ernel閰晞隢銝W瘜0 c4 t, c4 E% \
[root@localhost ~]# vim /etc/yum.conf ]6 d5 E$ {* T
#沍main]嗡葉乩W銝
( i% w& F/ p6 U: Vexclude=kernel kernel-source ^0 J# @, ^% R% G: Z, N
# b$ S V" D+ Y嗉牧yum冽敺憭嚗雿臭砍虜函憭扳撠望臬鋆湔啣蝘駁扎拐蝑典唳亦撠勗臭誑鈭
9 D& r' {0 J2 t' [5 \
4 P* r+ X- G" s
0 u4 }. f8 n0 y, G# a1 oyum撣貉憿臭誑摰蝬脩閫蝑
9 ~9 i, |2 x6 F- P* p: @http://yum.baseurl.org/wiki/Faq3 K- Y- Q/ W& F3 X
* \- ?) {, P! r, I: q+ x$ h. u
& [7 ~! t3 ^+ O9 W9 C" M4 p7 o: y9 E閮: 甇斤 http://ithelp.ithome.com.tw/question/10077313/ ~! D# `2 f( M# K+ y2 M, g
& I0 p- O9 u2 A' e8 t4 n( v% Q! U3 x( t
. L% T8 i, S. z# V9 r4 |
! W, v; G \: f" R- F- ^) G( ]9 s7 T
( z# p9 k. B, E* f1 ^1 q9 }
1 D: R+ ]1 _' b3 t
4 p' T: G0 H4 d5 ^/ S |
|