銝yum蝘駁方摰鋆
& s5 w% {- S/ v9 f7 }" @4 ?6 a$ d1.亥岷臬行摰鋆yum
8 H3 ^8 j* i. U1 n: \7 W, B- g0 G
, O/ ?8 y$ I6 {. w0 B* U- [root@localhost ~]# rpm -qa | grep yum7 Z# l9 q$ C% D2 X, t. j9 d8 Z
- yum-metadata-parser-1.1.2-3.el5.centos
) \! k' e; e6 e: V - yum-3.2.22-33.el5.centos
1 d* s5 I. x. z: V5 Z - yum-fastestmirror-1.1.16-14.el5.centos.1' {! Y( m, p0 C4 U6 G0 R l
- yum-updatesd-0.9-2.el5
銴鋆賭誨蝣
( ]- h; Q: ^- g7 k2.蝘駁巾um (蝘駁斤孵拍車銝喳)
3 B9 K4 j8 L. ^: z) P7 I Q4 D3 b2.1肘um孵蝘駁5 v( y% N. t6 s% c
- [root@localhost ~]# yum remove yum*
銴鋆賭誨蝣 ! q- t+ h$ [2 Q+ K5 }# K0 K; W
2.2禿pm -e孵蝘駁8 b9 _* M9 O& r% ?1 l' g
#亦鈭yum瑼獢閬蝘駁斤- c$ T k @- Y4 I
- [root@localhost ~]# rpm -qa | grep yum
) v# ^/ F+ R8 X$ y: X - yum-metadata-parser-1.1.2-3.el5.centos( T! k* A" }) e Z! v' K
- yum-3.2.22-33.el5.centos) Q2 @# o" ^7 ?
- yum-fastestmirror-1.1.16-14.el5.centos.1
- n5 m4 i6 j7 t9 t& D7 Q! G2 ] - yum-updatesd-0.9-2.el5
銴鋆賭誨蝣
$ j+ m: _5 p5 ] h#蝘駁巾um憒閬敹賜亦訾抒憿,臭蝙 --nodeps 賊
6 s: h2 e9 G" M' ]# Z- [root@localhost ~]# rpm -e yum-metadata-parser-1.1.2-3.el5.centos
Q* X5 p) K1 h0 [ - [root@localhost ~]# rpm -e yum-3.2.22-33.el5.centos
. ~2 @9 J2 X, }- V - [root@localhost ~]# rpm -e yum-fastestmirror-1.1.16-14.el5.centos.1
0 M! q$ Y; t7 T/ a; e/ H$ M) A6 \! `% @ - [root@localhost ~]# rpm -e yum-updatesd-0.9-2.el5
銴鋆賭誨蝣
/ y/ P# J; M, x鈭摰鋆yum
. b. P. _. X7 b4 G8 o6 c* P1.摰鋆皞
( r2 \4 g# ^( a典鋆皞其遢臭誑唬誑銝蝬脣亦
+ {0 s0 X/ a9 X) L+ K隢靘芾閬曉啣鋆皞
3 f. k/ o4 c7 A* J4 m f. S* @* Ai386 : ( z1 z. f4 y8 ~2 G% ^3 H+ i
http://mirrors.sohu.com/centos/5/os/i386/CentOS/
K5 V+ G) p3 C. Ahttp://mirror.centos.org/centos-5/5/os/i386/CentOS/
% b( D5 W3 d2 [+ I) z* b" X$ y& S2 a3 X0 j! Y3 E! z( {+ @
x86_64 : & t5 y |" l! x' f/ o& K: h
http://mirrors.sohu.com/centos/5/os/x86_64/CentOS/, U7 x6 l: s" j* d T6 D4 g I; d
http://mirror.centos.org/centos-5/5/os/x86_64/CentOS/
; Z1 O$ C0 @8 G. s5 }! v5 @
. I; f3 V- E: k5 R8 ^; Y! R% a% Y$ m. t( v9 L$ n9 K
肘um其遢銝餉臭蝙典唬誑銝4瑼; m, T; T7 G" [
yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
& Y$ [) Z( ?6 t0 B3 n" jyum-fastestmirror-1.1.16-16.el5.centos.noarch.rpm
$ p: \7 O9 ]( K- @1 Gyum-3.2.22-37.el5.centos.noarch.rpm
4 ^9 A0 z7 ]* q9 c$ `8 ?yum-updatesd-0.9-2.el5.noarch.rpm7 V6 D8 r" ]' y% V& S2 d% q! `
* J% e: h9 u; D* l7 F% `2摰鋆yum
* i3 z v; c g% Si386
# I+ @4 c: w& b- [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
" V: }' u" |) R6 ?/ v9 ` - [root@localhost ~]# rpm -qa |grep yum/ w4 G$ _" M1 u1 V! c% T, s9 c
- yum-updatesd-0.9-2.el5
' ~4 B3 U# p( S: H - yum-metadata-parser-1.1.2-3.el5.centos0 n# ?3 y; }# I# W* _* |
- yum-fastestmirror-1.1.16-16.el5.centos
* v6 `3 z3 |( ~, {( Y; n2 k5 O% j' i - yum-3.2.22-37.el5.centos
銴鋆賭誨蝣
9 U' l0 c7 s d3 G& X- mx86_64
$ R* n- u4 k) Q- [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( C; J% Q; Q# v F% A
- [root@localhost ~]# rpm -qa |grep yum% T I4 K- T1 x5 l
- yum-updatesd-0.9-2.el5
; z9 U1 v' X' M9 p& @: w, ~ - yum-metadata-parser-1.1.2-3.el5.centos
6 ]% I4 \" c: q/ m - yum-fastestmirror-1.1.16-16.el5.centos4 n2 s3 \/ `% G% h4 i
- yum-3.2.22-37.el5.centos
銴鋆賭誨蝣 $ { F4 W" x1 G$ {" b: W" W
2.2湔唳撌脣鋆憟隞(靘鈭粹瘙臬行湔)
& |5 E6 l- u( V5 W- [root@localhost ~]# yum -y update
銴鋆賭誨蝣
8 S) I0 Q, X7 m5 a# t& @* H& u銝yum隞方牧
1 H4 b% g. ?8 ?$ v' j* w" T; D其蝙肘um嚗撠銝頛梯正嚗摮曉/var/cache/yum桅銝
6 E9 ?, b+ K- R* O1.yum湔
9 L+ N) T# R. C& g" Jyum check-update
4 M8 c" u9 l5 u% R#瑼X亥賣湔啁憟隞嗆鈭/ G& m( @$ t, {5 [
# S, |0 z5 z3 Y* Q6 qyum update 3 |% c4 _4 h6 Y: }) O& d
#湔唳撌脣鋆憟隞塚亙罕pdate敺X乩憟隞嗅蝔梁閰勗舫撠閰脣隞嗆湔
, Q% e* p" E1 V2 e+ W* g% F. o憒yum update httpd! c+ A& L& T7 J: S0 u
# O: `" J$ r( u# O% {yum upgrade$ \" ?6 S- z1 l, Z; j* y
#質update撌桐憭嚗撌桀亙冽慶um upgrade銝鈭喳瘣格掠憟隞嗡銝韏瑟湔堆憭批雿輻典函砍蝝
3 |' L9 Q5 D$ V9 Y5 c t6 L! V3 L; X" ~% o& w/ u0 l- `$ U' s
1.1摰鋆.蝘駁文隞
1 q! ^: Z8 E( s: y3 v( i# Ryum install ' \. H- S X+ ]
#摰鋆憟隞塚install敺X亥摰鋆憟隞嗅蝔梧憒yum install httpd亥賊銝韏瑕鋆閰勗臬冽敺銝*憒yum install httpd*( z6 N% n7 n; W4 y& X
4 w" }7 J. I$ B
yum --enablerepo=(Repository) install 摰鋆芯蝙冽憟隞嗅澈,憒憭,銋臭誑,亦/etc/yum.repos.d/鈭.repo/ ^2 W# Z' m2 I3 E- }
憒yum --enablerepo remi,remi-php55 install php) `. f) ^4 x3 V2 O6 {2 p y0 z
) Q/ c! l; m! w; f1 p" g# jyum reinstall啣鋆憟隞
" c4 J4 Q! u/ B0 ?0 g; T3 h: O7 o2 C7 w' k9 K1 E% \) w
yum remove
8 n3 m8 L% d* b6 R0 \#蝘駁文隞,券桀啁訾抒憿嚗臭誑yum deplist 曉箸訾憟隞,銝銝蝘駁支閬憟隞,頝喲閬靽憟隞,憒祉典隞(蝝憟隞嗅航賣典) 6 ]2 J, S4 l5 x- \
5 F3 B. r2 e9 |0 N6 J
靘憒:
& R9 W2 t% \+ k. F, K/ ]/ R: eyum deplist httpd | grep -v httpd | grep provider | awk '{print $2}' | sort -u) E9 f X2 o( N; x; E6 s6 E8 }
remove敺舀亥蝘駁文隞嗅蝔梧憒yum remove httpd亥賊憟隞嗡銝韏瑞宏斤閰勗臬冽敺銝*憒yum remove httpd*) t! e- o/ k; Y0 V! G& U) y7 Z" D! d
( H4 k8 g' n+ b/ |" U' I7 `$ A7 M" Iyum clean
) p/ y# y0 e# l#皜文鋆銝頛怠憟隞嗅憪瑼嚗憭批臬曉/var/cache/yum嚗撣豢銝yum clean packages砰um clean all嚗銝甈∪典芷扎 D- N d$ T2 Q
* @9 R2 f# R5 ]1.2皜怠& t8 w! A- J& y' A/ C
yum clean- T# y; S! ^1 l+ @# C
#皜文鋆銝頛怠隞嗅憪瑼嚗憭批臬曉/var/cache/yum
1 U M6 d% v6 B9 u: v# ^* o! i8 l4 I, h) p
yum clean packages) [% j- f' u! M& ^" |. w6 O- h8 m
#其皜斗怠(/var/cache/yum)桅銝憟隞
. y5 J' Y3 `' V9 X7 g! z6 W3 P% W6 W# L6 F3 P( X
yum clean headers4 v. V' V7 N. K+ q
#其皜斗怠(/var/cache/yum)桅銝 headers
* L, u, c5 l% A2 { h8 s
4 Y( u* a1 T2 lyum clean oldheaders
, z) C/ M8 V8 Q#其皜斗怠(/var/cache/yum)桅銝 oldheaders
% N. ^/ j$ r' l5 {7 X; ^1 H0 s: R3 \
$ N; A* M3 _; Z; H& }yum clearn all2 d) @8 m( U% g7 N0 W. c) y7 O
#湔交怠賭甈⊥扎+ E. c/ ~0 b ~$ U
1 i) z* K# T8 V2 F1.3皜
& E, r M: _7 K) g3 E$ Ayum list/ k9 z2 t1 v% a
#箸Repository摨憟隞塚亙甸ist敺X亙隞嗅蝔梧臬桃典箄府憟隞嗚6 s. ?4 U5 T5 T, z
/ q+ o3 [. d- s$ u7 Y, r4 f* _yum list updates
' `( O+ L x6 [7 h3 } I0 b% a#箸臭誑湔啁憟隞/ E [ {% C+ ^, m( b& ]) R
: n& h0 j- I1 V/ E9 K% x1 z# h; I; K
yum list installed
8 [, G# E$ J5 }6 ^+ [2 A& d6 }#箸撌脩摰鋆憟隞; v- W k |8 W$ K0 Q9 ^* X
3 n# ^6 L" ]# M. O8 t
yum list extra
# R T {4 G u# l& J4 g#箸撌脣鋆雿銝 yum Repository摨 抒憟隞) Z4 O6 ]# I: T7 }/ Y0 f% P
. v% v3 S7 p# B+ ~6 V- C1.4箏隞嗥賊鞈閮( g& Z0 J6 k% K) X; w @: J! m5 q
yum info/ B2 J. w# D, d4 L; Q6 ~; G
#箸憟隞嗥賊鞈閮嚗亙甬nfo敺乩憟隞嗅蝔梧臬桃典箄府憟隞嗥賊鞈閮3 g3 c* f. `) J7 g0 ?! f! ?, G
憒yum info httpd yum info httpd*嚗撌桀亙冽潭*隞去ttpd剔賢箔7 c$ X: g. W% b+ H! t1 d
, b) P& h, Q8 r7 x6 p, v3 P
yum info updates) n) i$ f4 n' w: d
#箸臭誑湔啁憟隞嗉閮
6 F- }5 X- A" ?/ p% t. ~/ m
2 N; B; h$ r& s. Q4 M0 F: Gyum info installed4 c) z/ l; `# t
#箸撌脣鋆憟隞嗉閮
. n; @! C# L4 p/ @# c1 i/ _; @* L) x+ g3 |; g9 _# M1 K( N
yum info extras8 t' e( v( G* r! t
#箸撌脣鋆雿銝 Yum Repository摨 抒憟隞嗉閮# s) O0 n" B7 M2 o; h9 F
8 o f/ h. m( n2 K
% l; ^4 l( m; w6 U9 Y4 R1.5撠& q% z$ ~$ W* d% w
yum search: [5 _- ~) e$ F) ] T
#撠賊憟隞塚憒yum search httpd嚗典銝剜曉唳閬憟隞嗚憿隡潮萄券3 c& x( ~7 o3 h% r
5 z% p6 _5 G2 x2 M& l蝝憟隞嗡銝kernel
+ ?" D; }' k0 ^! y5 q% o8 j3 R. {憒唾肘um靘蝝憟隞塚雿銝喳逃ernel閰晞隢銝W瘜
% b% E; G- d5 X[root@localhost ~]# vim /etc/yum.conf
6 I* J# q) a3 ?) F$ |* N#沍main]嗡葉乩W銝
5 {( [6 U8 ^& \, i3 X, V' C! Aexclude=kernel kernel-source- `3 O. ]0 G& @- |, ~4 \& ~
% t( H0 K* X( v. |- a+ Z嗉牧yum冽敺憭嚗雿臭砍虜函憭扳撠望臬鋆湔啣蝘駁扎拐蝑典唳亦撠勗臭誑鈭% f7 u+ P' w, m8 R; P. b3 K
U. ~, [- A) |/ {/ M
* k3 e. z) w& T# g `! nyum撣貉憿臭誑摰蝬脩閫蝑5 O/ I8 N* Y6 z1 j: K# F G1 O; G
http://yum.baseurl.org/wiki/Faq
; N6 D! r& B- l1 p
- T2 K8 I2 f( R6 _6 `2 Q% d
0 L* p. x" ^% E' P" v1 o閮: 甇斤 http://ithelp.ithome.com.tw/question/10077313
* i2 `% j9 j9 K
" Y9 u ]2 H; z9 G6 ?$ t! B* ^* }0 h5 I* o7 f2 `2 @4 O
$ ?' ^5 ?4 d. O& e+ W* l
7 o2 a2 k* `3 y( L# K* z
; @* U& Z1 p5 u) Y0 x; c5 v' Q/ [& T8 L8 A- c5 d3 I
* B; p' L, L, T6 {& \+ D `5 l% ?
' T- @! n- l. V
|
|