銝yum蝘駁方摰鋆
[2 F' h, }8 g4 j; n% E1.亥岷臬行摰鋆yum" _' P9 X n- V- ^+ S
7 E6 x. k% a' B+ d# _- p4 A( _- [root@localhost ~]# rpm -qa | grep yum
6 y% Y; E [9 T% x2 A/ a( n3 e - yum-metadata-parser-1.1.2-3.el5.centos
- G, Q8 \" ]/ [ X1 n5 s. o - yum-3.2.22-33.el5.centos
8 N' J( \8 w8 Z - yum-fastestmirror-1.1.16-14.el5.centos.1
; y' T4 X3 H5 F- u% s2 R* [! x - yum-updatesd-0.9-2.el5
銴鋆賭誨蝣
9 b v4 F E7 O0 n4 N2.蝘駁巾um (蝘駁斤孵拍車銝喳)
- E" Z+ F- g1 U2 \4 F2 @) D0 P, ]; t: P2.1肘um孵蝘駁
1 B5 J) w* X" ~) O1 q' V- [root@localhost ~]# yum remove yum*
銴鋆賭誨蝣
3 O- F. t+ }+ l5 `2.2禿pm -e孵蝘駁1 p+ E, T/ i) i2 M
#亦鈭yum瑼獢閬蝘駁斤7 }/ c4 l; a. S7 h9 {
- [root@localhost ~]# rpm -qa | grep yum
4 k( {* u p7 z0 { - yum-metadata-parser-1.1.2-3.el5.centos& y: i6 _# {4 F
- yum-3.2.22-33.el5.centos+ t8 r/ U: y4 B0 @! O, D4 Q
- yum-fastestmirror-1.1.16-14.el5.centos.13 l) v2 M8 h* f. B
- yum-updatesd-0.9-2.el5
銴鋆賭誨蝣 # k* w+ D4 n) t" ~$ V5 C
#蝘駁巾um憒閬敹賜亦訾抒憿,臭蝙 --nodeps 賊. _8 J4 {$ Z, F m: g- z3 y+ D& E
- [root@localhost ~]# rpm -e yum-metadata-parser-1.1.2-3.el5.centos
+ W, s- \* k* o$ A0 F8 } - [root@localhost ~]# rpm -e yum-3.2.22-33.el5.centos$ ^( w8 y; I0 k3 X0 e9 _# p2 C
- [root@localhost ~]# rpm -e yum-fastestmirror-1.1.16-14.el5.centos.1
* @6 N; o w E- Z - [root@localhost ~]# rpm -e yum-updatesd-0.9-2.el5
銴鋆賭誨蝣
# K; W/ L! n8 @5 p: I' R5 G p0 b$ H鈭摰鋆yum7 A, q4 P, l0 n1 {" C
1.摰鋆皞7 e$ }' X |3 o2 K; y1 U' P
典鋆皞其遢臭誑唬誑銝蝬脣亦
+ n% ?' w, o4 Q& I隢靘芾閬曉啣鋆皞5 U+ ~$ d0 X, `# O7 M6 I1 K
i386 : : Y) r0 U# B" p. Y/ H- i4 E$ X
http://mirrors.sohu.com/centos/5/os/i386/CentOS/
% y5 ^: Y! f6 n: ^5 c) `3 jhttp://mirror.centos.org/centos-5/5/os/i386/CentOS/
( V0 n( E: l8 G( ]& f
' X! _8 [* v; g1 Fx86_64 : 6 t: ^$ @. X4 ?! R5 J
http://mirrors.sohu.com/centos/5/os/x86_64/CentOS/1 g0 v1 T: ^/ E6 ]2 C
http://mirror.centos.org/centos-5/5/os/x86_64/CentOS/
! N& `# a/ a6 n3 s
' U" ]9 B. [8 v7 f2 R4 V8 t$ q7 N
& {2 B$ L, }. z2 g0 O' |7 S( d/ O肘um其遢銝餉臭蝙典唬誑銝4瑼9 X- u: ?6 X0 E* L, g7 n: Y/ s* @
yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
. _( B5 v* l# h( h) }9 Dyum-fastestmirror-1.1.16-16.el5.centos.noarch.rpm
3 {% t) q# w2 y% B3 m) c3 Y" {yum-3.2.22-37.el5.centos.noarch.rpm3 P. U3 a- N; u/ ^/ }/ V+ i$ l+ U
yum-updatesd-0.9-2.el5.noarch.rpm) k2 o- |/ a. U L& I% H
2 F7 F1 C4 Z \- P! Q) }5 P( u5 t7 C
2摰鋆yum
+ l) T& l1 F+ b3 O' mi386: x2 M: u+ ^$ D& u/ w& z" y
- [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% x: j* X# u5 U+ Z
- [root@localhost ~]# rpm -qa |grep yum
. |) k/ _* ]% I- Y3 o7 B; _9 l+ x - yum-updatesd-0.9-2.el5* t7 w: L* i0 w% p8 A! {5 {
- yum-metadata-parser-1.1.2-3.el5.centos I- I# |! ?' x9 @: N! i
- yum-fastestmirror-1.1.16-16.el5.centos* \% W) o" J$ U8 R) R! H" e; s# z
- yum-3.2.22-37.el5.centos
銴鋆賭誨蝣 $ Q0 Y. [; q7 I
x86_64
8 a4 Q( ?9 { U0 Y, p" z- [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
) W% d8 e! a% y' ^: Z# z - [root@localhost ~]# rpm -qa |grep yum' A& [0 M- V( B2 |. s
- yum-updatesd-0.9-2.el5
( U6 Y; `; Z9 u# \3 ~. V& v9 `* a - yum-metadata-parser-1.1.2-3.el5.centos) x9 q3 z9 D: ?% p) j: L7 b
- yum-fastestmirror-1.1.16-16.el5.centos
6 @3 L% T* x+ A% u, V) } - yum-3.2.22-37.el5.centos
銴鋆賭誨蝣
8 _; B$ o7 Y9 l/ O5 y; x2.2湔唳撌脣鋆憟隞(靘鈭粹瘙臬行湔)
9 j( P) w# e& u/ a1 U- [root@localhost ~]# yum -y update
銴鋆賭誨蝣 $ R7 m- k3 ]0 h/ m) _
銝yum隞方牧# e; `, K7 j/ b# f- Z2 b& g v3 y" T
其蝙肘um嚗撠銝頛梯正嚗摮曉/var/cache/yum桅銝
/ Z* p" O$ E7 o* k2 {1.yum湔
/ r* u0 x4 b, ?- t& ]2 jyum check-update
* E: I' F' U2 t- |& y* j: ?% F! X#瑼X亥賣湔啁憟隞嗆鈭0 n/ _ j( _2 q
" o. t0 l' u P' T/ j" cyum update 2 \% ]4 E2 J% F6 p
#湔唳撌脣鋆憟隞塚亙罕pdate敺X乩憟隞嗅蝔梁閰勗舫撠閰脣隞嗆湔7 J1 w0 x* I9 F9 N7 R6 W
憒yum update httpd; j* z. [6 Z9 j6 L+ u! } M5 J
* M* j+ X4 g/ ?0 ~! D0 S- byum upgrade) w a: @! g" _% T9 ?2 h
#質update撌桐憭嚗撌桀亙冽慶um upgrade銝鈭喳瘣格掠憟隞嗡銝韏瑟湔堆憭批雿輻典函砍蝝
+ I, g/ w3 b8 }0 ^4 r% y" }3 ~
7 D1 |( `3 t- |' \; P- i9 B1.1摰鋆.蝘駁文隞
4 [& s1 q$ m X& vyum install
5 f8 X7 x' K% [2 |+ J' f) t+ t#摰鋆憟隞塚install敺X亥摰鋆憟隞嗅蝔梧憒yum install httpd亥賊銝韏瑕鋆閰勗臬冽敺銝*憒yum install httpd*
1 H: R) S5 m/ ~6 F; V5 o! P+ o. T* A1 V- t* z0 `( _6 J" S
yum --enablerepo=(Repository) install 摰鋆芯蝙冽憟隞嗅澈,憒憭,銋臭誑,亦/etc/yum.repos.d/鈭.repo4 y0 d# A# W3 D* v# d
憒yum --enablerepo remi,remi-php55 install php
( X0 e! c: |5 R: A$ M5 k0 N9 f+ I6 O% K5 [; X5 q! Q
yum reinstall啣鋆憟隞
" ~% ?" H3 `8 ^) }- f' |$ f& L, i7 D& z3 i3 T. m
yum remove( u, f( D5 _9 F6 d) n; m
#蝘駁文隞,券桀啁訾抒憿嚗臭誑yum deplist 曉箸訾憟隞,銝銝蝘駁支閬憟隞,頝喲閬靽憟隞,憒祉典隞(蝝憟隞嗅航賣典)
7 v8 l- Y/ W: s) z& t. H! M3 c
4 r( e$ z# c2 m0 L靘憒:
5 u8 G0 @9 O" S9 Eyum deplist httpd | grep -v httpd | grep provider | awk '{print $2}' | sort -u
4 w& v: Q8 }" p9 uremove敺舀亥蝘駁文隞嗅蝔梧憒yum remove httpd亥賊憟隞嗡銝韏瑞宏斤閰勗臬冽敺銝*憒yum remove httpd*
( ?- I/ c/ {8 `* h6 }- h) x8 q4 b4 d
yum clean: t1 K" [. K3 U" \5 z5 N9 q' M
#皜文鋆銝頛怠憟隞嗅憪瑼嚗憭批臬曉/var/cache/yum嚗撣豢銝yum clean packages砰um clean all嚗銝甈∪典芷扎
1 S. H2 o7 @( _2 X+ T/ p: G& s" \3 \/ t
1.2皜怠; u. D( l3 B% F9 ]% C3 [
yum clean, S# h# a' z# ~
#皜文鋆銝頛怠隞嗅憪瑼嚗憭批臬曉/var/cache/yum4 j7 G" ?( S- _6 q F
% }& ?, m2 a! z! D+ t# K$ @( y/ X
yum clean packages' u7 r! z* F/ E- u2 g4 ^3 y
#其皜斗怠(/var/cache/yum)桅銝憟隞0 N5 {$ N+ ~1 [: D
) e+ H& v' n; n* myum clean headers& H! W: f3 k) D8 n/ d
#其皜斗怠(/var/cache/yum)桅銝 headers/ F$ N: e1 {- l
; r5 w7 K! r- k3 g! [( U" ]3 b
yum clean oldheaders
4 u. q7 y& x0 ], A. O: Q#其皜斗怠(/var/cache/yum)桅銝 oldheaders
/ Y5 v3 x+ Y, v6 b7 \! a
# I; w9 P# w$ L1 u. U* _yum clearn all
+ j+ Z8 T$ M( ?% a#湔交怠賭甈⊥扎2 `1 q6 j* x3 h9 e' a
# a$ M/ Q2 v/ j1.3皜
8 A" \8 ^6 o8 o# ^ r# p/ jyum list
' Z1 l. J: K& X8 w; ?5 Y" w#箸Repository摨憟隞塚亙甸ist敺X亙隞嗅蝔梧臬桃典箄府憟隞嗚
9 ^* v0 @0 Y9 ^1 q& R, R/ d; d2 w( g) r. @5 x% l9 j$ B: N
yum list updates
$ G4 A6 _$ \3 J/ M#箸臭誑湔啁憟隞1 U: W, a0 @- x* t3 K
0 p/ I/ f- T$ U- w4 Kyum list installed
" O$ Z Q: {/ i* ~5 Q* R, q#箸撌脩摰鋆憟隞# n6 B2 x2 P0 {1 @, f6 K6 k
6 n L! n b, ~& S `yum list extra
+ u$ h5 Z7 F# ^6 g6 r#箸撌脣鋆雿銝 yum Repository摨 抒憟隞0 W ^0 g- m" S, D- p" Q2 i$ S
* b: E! a! m& _; ^ H1.4箏隞嗥賊鞈閮# e$ D& U7 |* e* T( S- ~, z
yum info ^$ D" J, Z4 v u) z/ V
#箸憟隞嗥賊鞈閮嚗亙甬nfo敺乩憟隞嗅蝔梧臬桃典箄府憟隞嗥賊鞈閮
( A* W% g/ L7 X+ q憒yum info httpd yum info httpd*嚗撌桀亙冽潭*隞去ttpd剔賢箔
7 H' U+ Y, q: `( _. ^) T8 @8 Y# A: P/ P: R+ X2 @, Y9 I
yum info updates
& i: Y5 q' B8 |4 l; z9 d2 ?9 n#箸臭誑湔啁憟隞嗉閮% A7 N5 L3 L8 [2 ?5 X2 G
& _; {, z& Z! B1 g
yum info installed" y6 u* O4 x( q1 c
#箸撌脣鋆憟隞嗉閮
6 F+ y( E1 Y G2 e2 G
7 w9 W3 C; I9 xyum info extras: [8 L: N% j; ]( F
#箸撌脣鋆雿銝 Yum Repository摨 抒憟隞嗉閮$ Q! r5 F+ N; l7 n, `2 Q7 S
! L" k5 s7 @7 w8 N4 P( Z2 e5 D# R
% W' v1 p' R: }: T9 B, k* }, d, e1.5撠
( J% S& [# K. b tyum search1 `- B+ h. I4 [8 B
#撠賊憟隞塚憒yum search httpd嚗典銝剜曉唳閬憟隞嗚憿隡潮萄券3 s( e, L8 ~+ y# x
) e. T+ J r2 E, ^蝝憟隞嗡銝kernel0 X' d! ?! a. J" }9 M$ ^ A5 ]$ A
憒唾肘um靘蝝憟隞塚雿銝喳逃ernel閰晞隢銝W瘜
: n+ u$ g& c9 E; K8 J8 N[root@localhost ~]# vim /etc/yum.conf
* l% R9 Y7 X; {5 D. E+ s#沍main]嗡葉乩W銝. {+ A/ ]7 @" p) i* ^
exclude=kernel kernel-source4 v: U' O0 ]3 V1 ~$ T8 {
6 w, f) O; y* T% c% l1 ?. H
嗉牧yum冽敺憭嚗雿臭砍虜函憭扳撠望臬鋆湔啣蝘駁扎拐蝑典唳亦撠勗臭誑鈭: i; d- u6 b: I' k+ n, s0 n2 U
& N) S; t' `3 Y% ]% k% b' U* X7 _1 e. w7 f5 K- N/ l" N
yum撣貉憿臭誑摰蝬脩閫蝑9 h4 m1 O: a8 h" V
http://yum.baseurl.org/wiki/Faq& N" Y: n1 R0 b6 e% A
( \1 c3 w' `: s+ Z! o: Q2 T
! @% C" s1 `. y/ ~8 E3 s5 }; Q6 {
閮: 甇斤 http://ithelp.ithome.com.tw/question/10077313
6 g6 B r: L5 q% S2 f% j- d( V- N
" }% F0 i" d) ]# M
5 @! D2 M3 e0 ~
5 v A/ u! A7 ^3 B% B k
; c8 I' V0 i& n+ N1 B, d- W
4 _3 e0 H8 [3 T* ~6 D. ^ |
6 U9 d; Z) q- [* C* L. f0 C& _) ]! ?! K# W( w
|
|