銝yum蝘駁方摰鋆
3 L$ K2 D, N, T2 F' @- a0 s1 \1.亥岷臬行摰鋆yum' Z9 w. X7 U* X( P2 Q
/ m, ~7 F6 ^% y# P' N
- [root@localhost ~]# rpm -qa | grep yum
+ x" B; w# Z3 j9 s - yum-metadata-parser-1.1.2-3.el5.centos
# j4 b% {4 T1 A$ a - yum-3.2.22-33.el5.centos" x9 ~' D2 P& y% Q
- yum-fastestmirror-1.1.16-14.el5.centos.1
) j2 }5 @* g1 }+ O4 C' z - yum-updatesd-0.9-2.el5
銴鋆賭誨蝣 % E) x: ?1 q; `1 d/ @5 z
2.蝘駁巾um (蝘駁斤孵拍車銝喳)! I: D$ g( t7 j. g
2.1肘um孵蝘駁- h+ r% v1 T: P4 c) z
- [root@localhost ~]# yum remove yum*
銴鋆賭誨蝣 : s+ w) {- P9 t
2.2禿pm -e孵蝘駁
/ H/ l+ F" R1 v- [! x/ A! u#亦鈭yum瑼獢閬蝘駁斤
: f! R, h7 [1 Y1 C) @% y- [root@localhost ~]# rpm -qa | grep yum
5 Z& `9 t2 t% a3 S- G" C( y* M I - yum-metadata-parser-1.1.2-3.el5.centos! u8 k7 p( M, C# D# K
- yum-3.2.22-33.el5.centos5 Z# W0 }) |- ^. i3 q5 ?" [
- yum-fastestmirror-1.1.16-14.el5.centos.1
l5 C9 y. O$ Z9 E - yum-updatesd-0.9-2.el5
銴鋆賭誨蝣
! o7 i1 h& C" q+ a$ |#蝘駁巾um憒閬敹賜亦訾抒憿,臭蝙 --nodeps 賊; d/ P1 O% [ @4 @3 U/ X
- [root@localhost ~]# rpm -e yum-metadata-parser-1.1.2-3.el5.centos
, h, f* j( W) T7 I - [root@localhost ~]# rpm -e yum-3.2.22-33.el5.centos3 m( z( M8 Z$ L8 Q5 S' {
- [root@localhost ~]# rpm -e yum-fastestmirror-1.1.16-14.el5.centos.1
0 v- ` \! F6 _+ m) r - [root@localhost ~]# rpm -e yum-updatesd-0.9-2.el5
銴鋆賭誨蝣 # b) }; l( l* y) O& i, P' i6 L
鈭摰鋆yum
& w0 Q Z8 z$ @, w/ E/ Z8 z1.摰鋆皞8 r7 j s- X. ?! Y- y
典鋆皞其遢臭誑唬誑銝蝬脣亦
) W1 J E6 u" Y7 D& X隢靘芾閬曉啣鋆皞' P+ ?* M# J6 e8 M1 s* Q
i386 :
: W. G- t. Y9 F2 Fhttp://mirrors.sohu.com/centos/5/os/i386/CentOS/2 G8 D/ _" [& E
http://mirror.centos.org/centos-5/5/os/i386/CentOS/- ^5 j5 c& L# A* ^6 n4 I# X$ T2 u: A
9 V9 H4 _5 ^/ a+ ox86_64 :
6 |- G1 N; C) c) u& |1 ohttp://mirrors.sohu.com/centos/5/os/x86_64/CentOS/0 t! d0 w2 b3 I
http://mirror.centos.org/centos-5/5/os/x86_64/CentOS/
) u4 E/ j6 G7 L0 o
8 u+ Q. K) Q3 y0 ?) f
0 h- w/ |" N* Z! N4 w3 E/ M1 \肘um其遢銝餉臭蝙典唬誑銝4瑼
/ ?7 j1 K: C" T- xyum-metadata-parser-1.1.2-3.el5.centos.i386.rpm + K* B, `7 Z. }: {: z/ J; X
yum-fastestmirror-1.1.16-16.el5.centos.noarch.rpm
* a5 q" W! A8 c5 q2 f; e/ Lyum-3.2.22-37.el5.centos.noarch.rpm& g5 K& M7 L, \' {+ k& A
yum-updatesd-0.9-2.el5.noarch.rpm9 H1 Z6 N% e2 Y$ ? I6 r
: j( U7 V2 e& T
2摰鋆yum
6 m0 w% H3 S6 J$ zi386
' s5 T: D* \, _1 T$ W- [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.rpm8 L: ~- j* e8 @3 q+ w' C
- [root@localhost ~]# rpm -qa |grep yum# B, \1 v0 w1 |; r' ^( a
- yum-updatesd-0.9-2.el52 U+ e( w2 ^ s6 D- S( w" w/ J5 Z
- yum-metadata-parser-1.1.2-3.el5.centos# Y& Z, x1 z8 f6 J8 C
- yum-fastestmirror-1.1.16-16.el5.centos
- C* a6 u/ e% a$ b* d - yum-3.2.22-37.el5.centos
銴鋆賭誨蝣 9 \5 ~) I- K8 E j5 m9 W
x86_64
- g3 o: W* P! b0 _- [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
* L& L, S) F' R0 e m/ Z) t% x - [root@localhost ~]# rpm -qa |grep yum
0 [! e- t) j1 x# ^7 m) n - yum-updatesd-0.9-2.el5
8 i g9 l( y+ i% d+ A! j' ] - yum-metadata-parser-1.1.2-3.el5.centos- v* z. x4 C4 j B- T/ P
- yum-fastestmirror-1.1.16-16.el5.centos' t1 u- {3 b& }( \' B; r; X* t5 L
- yum-3.2.22-37.el5.centos
銴鋆賭誨蝣
' J9 K1 l/ r9 }1 o' [$ B8 m# `. B2.2湔唳撌脣鋆憟隞(靘鈭粹瘙臬行湔)
5 a3 `' D' A/ B# j, c: d: ?- [root@localhost ~]# yum -y update
銴鋆賭誨蝣 ; Y5 Z/ d1 Y; _5 {3 z
銝yum隞方牧
! B5 g' E+ O6 L( U5 I3 w其蝙肘um嚗撠銝頛梯正嚗摮曉/var/cache/yum桅銝
# \0 A; |# }6 ^1 y: s1 S K1.yum湔6 p0 I1 p' [$ l4 j) b5 M
yum check-update
# k6 O$ {. w) c! _ u1 \#瑼X亥賣湔啁憟隞嗆鈭) f( p+ }# B. b" e" A) d
- R" ?, o& k. ^: r6 r p5 Zyum update 2 N; Z& {$ R" C I' b" K t
#湔唳撌脣鋆憟隞塚亙罕pdate敺X乩憟隞嗅蝔梁閰勗舫撠閰脣隞嗆湔& c$ c. E2 }& v F) B4 t
憒yum update httpd8 z: n1 h6 k. O& E5 S7 A5 I
( _$ |4 \( i2 g$ I5 j* R5 m
yum upgrade
. o2 l/ T8 y4 }# c1 l#質update撌桐憭嚗撌桀亙冽慶um upgrade銝鈭喳瘣格掠憟隞嗡銝韏瑟湔堆憭批雿輻典函砍蝝* {; k2 }, b1 G) r0 R3 x
4 h7 z5 Q0 v7 e i$ D& m a- g. O1.1摰鋆.蝘駁文隞
* K/ q {' r! A: C7 j. T; C( f" N& Byum install
; G; t: W! s+ W, F( I3 `9 |4 k#摰鋆憟隞塚install敺X亥摰鋆憟隞嗅蝔梧憒yum install httpd亥賊銝韏瑕鋆閰勗臬冽敺銝*憒yum install httpd*
# [) Y, _" I, S' ^9 t* K! N" X- C7 r1 Z8 g& L7 P6 e/ H
yum --enablerepo=(Repository) install 摰鋆芯蝙冽憟隞嗅澈,憒憭,銋臭誑,亦/etc/yum.repos.d/鈭.repo/ E" Z4 ~: S" I) J
憒yum --enablerepo remi,remi-php55 install php
5 K6 a" t3 R/ Y6 |
4 ~( a a3 M! J! Vyum reinstall啣鋆憟隞! e0 P3 M, L3 o7 R4 F' s
1 U7 X1 l+ S* k
yum remove0 p4 Y" `1 Z5 e# k; x0 y
#蝘駁文隞,券桀啁訾抒憿嚗臭誑yum deplist 曉箸訾憟隞,銝銝蝘駁支閬憟隞,頝喲閬靽憟隞,憒祉典隞(蝝憟隞嗅航賣典) ! H2 f4 y- U C0 ?) x6 n: M; U
/ {4 z! W6 a _) R! T
靘憒:
; o7 `1 r; H8 qyum deplist httpd | grep -v httpd | grep provider | awk '{print $2}' | sort -u5 o0 k N- R% r5 w( v( c
remove敺舀亥蝘駁文隞嗅蝔梧憒yum remove httpd亥賊憟隞嗡銝韏瑞宏斤閰勗臬冽敺銝*憒yum remove httpd*
9 {+ m R$ J( [( V: u
) N1 E7 }: h; W- ryum clean
# ~! e! e( s0 v; A8 [3 Z#皜文鋆銝頛怠憟隞嗅憪瑼嚗憭批臬曉/var/cache/yum嚗撣豢銝yum clean packages砰um clean all嚗銝甈∪典芷扎
& {# w. `' A" k! f' T" [, i& e' h& k4 @3 V7 v/ \5 ~/ P0 r, x& Y+ I
1.2皜怠
" f! i9 e, E* x; D, iyum clean; Y% d- p8 Q. Y
#皜文鋆銝頛怠隞嗅憪瑼嚗憭批臬曉/var/cache/yum
1 d! P" G) A7 Z7 ?4 G4 V7 U' M: e" ]0 r6 A/ P7 S% Y
yum clean packages
1 ~0 l Z% w" h3 O2 t( e#其皜斗怠(/var/cache/yum)桅銝憟隞
+ V" C' O" t$ X: b: ^+ j' E0 \2 v$ c. V8 {1 u7 d
yum clean headers
) E8 v8 d2 P: G$ L#其皜斗怠(/var/cache/yum)桅銝 headers
9 O* x+ f% ?2 ]; w5 \
( o9 z t1 w2 E) @yum clean oldheaders
, u2 O: i' Q: r& o$ N9 a: a#其皜斗怠(/var/cache/yum)桅銝 oldheaders 7 z# T2 D: J* a: E
5 h4 p I' ]$ m$ q7 y$ Ryum clearn all
$ t- j1 }2 i8 n, w2 l+ X# a#湔交怠賭甈⊥扎
5 y: ]3 @: _! U" f% j2 r
) k4 P8 ` J; Q( h+ @1.3皜! B% K, W1 e. k! v( L$ L
yum list
% n4 ]3 Z5 W% p#箸Repository摨憟隞塚亙甸ist敺X亙隞嗅蝔梧臬桃典箄府憟隞嗚
1 |( T& J- M7 F# ]8 R G8 \# h* y! ^6 J7 u$ q! ?9 W: B
yum list updates
) k% r- l" s8 U$ C4 `- p* A#箸臭誑湔啁憟隞
3 k' E; p+ S% l; }# Q7 u* E" [# T8 h, g0 N- }' Z1 S$ R: E
yum list installed
5 m2 d0 x( S+ ~, I3 X) T4 \& u#箸撌脩摰鋆憟隞
0 n1 G6 N9 ^( c1 v' y8 Z) h P& c, J% C
yum list extra
4 c# {/ Q1 v8 x#箸撌脣鋆雿銝 yum Repository摨 抒憟隞
7 D5 y5 [8 U& O) Y" M- o2 w6 D8 |# D( }/ A- Q
1.4箏隞嗥賊鞈閮' X3 p3 @ i4 z- k% N4 d
yum info2 v) S- s# u) \, G2 i
#箸憟隞嗥賊鞈閮嚗亙甬nfo敺乩憟隞嗅蝔梧臬桃典箄府憟隞嗥賊鞈閮$ F _: n* @% B8 T$ E3 X6 _" T
憒yum info httpd yum info httpd*嚗撌桀亙冽潭*隞去ttpd剔賢箔
% S0 S! T$ J6 x: [5 Y2 m2 B5 }
$ W( I, F$ Z/ o" a2 R- Uyum info updates
, U) H4 \5 h0 G8 j0 p Z# b#箸臭誑湔啁憟隞嗉閮
& L. p* G8 c; J z! a3 v' ]
6 P, b6 J( A) \yum info installed
: W2 b! g$ p0 w' U: |#箸撌脣鋆憟隞嗉閮
( e% B% S$ c& C
0 O, w9 J- b# Y. E- yyum info extras
$ q4 S Q) K4 W8 v#箸撌脣鋆雿銝 Yum Repository摨 抒憟隞嗉閮
: U1 N5 l9 Y5 V p
' X! ` f: u+ a8 m; y7 X4 i: O6 i
1.5撠# h4 K( `, {$ t
yum search
% T- o! r1 a* K$ o& J% t#撠賊憟隞塚憒yum search httpd嚗典銝剜曉唳閬憟隞嗚憿隡潮萄券, }7 K7 A, S+ E; R- l* Q
& }/ {' r" X7 x$ O5 l3 ]7 N( |
蝝憟隞嗡銝kernel
' d) B( z( C& i憒唾肘um靘蝝憟隞塚雿銝喳逃ernel閰晞隢銝W瘜, O4 [7 \7 |7 {; N. x6 f) q
[root@localhost ~]# vim /etc/yum.conf* n; y7 Z* n% x3 @) z5 P2 ?
#沍main]嗡葉乩W銝
& C) T6 F* y m- l) E# a _exclude=kernel kernel-source
% \9 i* l) Y; q2 ]4 \* K
" c( U! h7 m. g" e3 O6 B" D! F4 W嗉牧yum冽敺憭嚗雿臭砍虜函憭扳撠望臬鋆湔啣蝘駁扎拐蝑典唳亦撠勗臭誑鈭% n7 R; ]! X: Q( h7 M( T
6 g9 ^+ V/ `- I9 c4 h: s ^& }7 K, a
! K! v$ t! Y; c e3 eyum撣貉憿臭誑摰蝬脩閫蝑' n% {: }0 n# d- d
http://yum.baseurl.org/wiki/Faq
* U o. J* X, B: ]! i( d8 t8 \
, u* `! U) d6 u3 u' f, h# p7 [3 M$ C6 K7 w% l4 F, ]& A% Z: b- x j5 F
閮: 甇斤 http://ithelp.ithome.com.tw/question/10077313
) o! i: i" l$ `5 i" d. q) S0 E6 I2 z6 a' a- s9 z
: _0 v/ v* x& N" }( P
, e" Q& ?, l- a6 f3 d8 N
) w2 o0 N8 F$ N' Z' F
3 L4 c+ b" J1 d6 @+ \9 ^6 i0 {
9 C0 n& u3 W/ F8 `/ t# s2 M5 p' G2 r' I1 u. h& ~6 R$ ^% I& V
$ M' D) E3 ]) r3 F2 s |
|