銝yum蝘駁方摰鋆
& r6 c4 L# K, w1 f0 I1.亥岷臬行摰鋆yum
6 l! ?* v- Y$ ] [2 M+ v1 M2 S' `/ k+ H8 V" M
- [root@localhost ~]# rpm -qa | grep yum3 @8 z$ g* Q1 G/ L
- yum-metadata-parser-1.1.2-3.el5.centos* n( J1 ?2 t' ?1 x. H; B9 d9 ^
- yum-3.2.22-33.el5.centos
% k7 w! N4 b2 u6 g; Z" f8 ]7 i - yum-fastestmirror-1.1.16-14.el5.centos.1
7 l. Q3 Q* G5 x5 \* C - yum-updatesd-0.9-2.el5
銴鋆賭誨蝣 ) L0 U$ ?5 g. @$ c! s' s4 t5 N& Z: X1 D
2.蝘駁巾um (蝘駁斤孵拍車銝喳)
9 x5 P' _7 z* k3 o* @2.1肘um孵蝘駁* g$ ] N+ j+ m8 S) u( L
- [root@localhost ~]# yum remove yum*
銴鋆賭誨蝣 ( j: }" K4 X. }! c1 A* }; o
2.2禿pm -e孵蝘駁
& |9 T% k- p( Z3 _#亦鈭yum瑼獢閬蝘駁斤
4 J8 ~8 S' ~8 o7 |" ]9 J* a% w- [root@localhost ~]# rpm -qa | grep yum
; A1 K3 L+ V b# F: Q: }3 I - yum-metadata-parser-1.1.2-3.el5.centos: i- N$ N7 o7 t; V) ~$ V
- yum-3.2.22-33.el5.centos+ F) H1 p8 v5 o `$ F. P0 {
- yum-fastestmirror-1.1.16-14.el5.centos.11 I7 X% E5 [! m" c2 v& G* x# T
- yum-updatesd-0.9-2.el5
銴鋆賭誨蝣
6 _6 k; h6 q+ m#蝘駁巾um憒閬敹賜亦訾抒憿,臭蝙 --nodeps 賊
/ p q' O! u5 Q9 h8 T: D" Q8 D" N- [root@localhost ~]# rpm -e yum-metadata-parser-1.1.2-3.el5.centos$ U* M5 P2 U- G2 |" |- F# Y
- [root@localhost ~]# rpm -e yum-3.2.22-33.el5.centos
$ h+ l2 L- q4 y& r - [root@localhost ~]# rpm -e yum-fastestmirror-1.1.16-14.el5.centos.13 c4 x& C0 e' l/ R' F5 t7 D# n" b7 r
- [root@localhost ~]# rpm -e yum-updatesd-0.9-2.el5
銴鋆賭誨蝣 / a' z' U9 d; u# ]5 q+ q
鈭摰鋆yum3 g# Y/ d5 ]1 D6 R+ m
1.摰鋆皞( {; @" h$ C3 I2 q
典鋆皞其遢臭誑唬誑銝蝬脣亦
# l5 f# w; c- i5 H隢靘芾閬曉啣鋆皞
- v9 ?6 U' K) s6 r; s$ [i386 : . a) l U9 z4 U- g; T7 T0 H0 e7 n& Z7 [
http://mirrors.sohu.com/centos/5/os/i386/CentOS/
F6 p- n+ M7 Q8 Nhttp://mirror.centos.org/centos-5/5/os/i386/CentOS/7 M* z, C9 \7 w
5 s% V6 g8 B& z5 kx86_64 : V) `4 ?* W; u- ?% i6 F0 h4 W
http://mirrors.sohu.com/centos/5/os/x86_64/CentOS/
4 f/ t0 ]! y* e3 b5 @- shttp://mirror.centos.org/centos-5/5/os/x86_64/CentOS/: T* i* H/ I2 ?
7 k# P! z- u. S% M
: f1 B6 k' H5 ]
肘um其遢銝餉臭蝙典唬誑銝4瑼 J+ K2 E2 l( S# h5 h
yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm + t; o R; I- u# }
yum-fastestmirror-1.1.16-16.el5.centos.noarch.rpm7 s/ `9 v( y" z
yum-3.2.22-37.el5.centos.noarch.rpm
% g# q: o5 S. m4 Zyum-updatesd-0.9-2.el5.noarch.rpm
# O8 t3 e( I! v
9 V: X* b6 R2 j) m1 W$ V( I/ T2摰鋆yum) Z* X- E% w1 ~
i386
7 a7 D, Z, \9 c. P* _( Z! S5 G: a- [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 ]* Q' q/ o2 C) H( s4 O - [root@localhost ~]# rpm -qa |grep yum
$ R! l, Q: C5 q* R+ Z - yum-updatesd-0.9-2.el5
+ r# p( N9 O* f) q - yum-metadata-parser-1.1.2-3.el5.centos
% p4 B( [/ j3 | - yum-fastestmirror-1.1.16-16.el5.centos
c9 J, z1 L: \& S( J* n - yum-3.2.22-37.el5.centos
銴鋆賭誨蝣
% R( O- }: J5 L/ Z3 hx86_643 W1 m+ d8 ~* Z/ m. L! P# c# v# [) ^
- [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 $ J, f, |0 s' z+ t l8 f
- [root@localhost ~]# rpm -qa |grep yum
, J9 h; X. Q" F4 m8 X - yum-updatesd-0.9-2.el5
& {& \0 S4 O6 t - yum-metadata-parser-1.1.2-3.el5.centos
; m" ?7 O: _! [, e2 d - yum-fastestmirror-1.1.16-16.el5.centos5 U4 ^1 I% S# S% c4 _
- yum-3.2.22-37.el5.centos
銴鋆賭誨蝣 , b) {7 }' O. ?3 N" o
2.2湔唳撌脣鋆憟隞(靘鈭粹瘙臬行湔)
& o& }4 ? g3 h: Z0 i- [root@localhost ~]# yum -y update
銴鋆賭誨蝣 $ {! K7 O1 a0 c6 Q* x/ J
銝yum隞方牧' V: }, L% ? P3 }% x6 N' C$ I
其蝙肘um嚗撠銝頛梯正嚗摮曉/var/cache/yum桅銝
. Z5 `7 m9 T, Z' l1.yum湔
& t: h- `9 c) Q8 Y7 |yum check-update
8 q% b( H2 v$ e9 B* c( d#瑼X亥賣湔啁憟隞嗆鈭
; T! }! X: y' A! ^) ]' m0 O- E5 w5 ^
# N% E. d# M8 X# L! m G- [8 C: Dyum update
$ I1 G# t% ]6 a7 a, R! Y#湔唳撌脣鋆憟隞塚亙罕pdate敺X乩憟隞嗅蝔梁閰勗舫撠閰脣隞嗆湔( { Q& x$ D+ w, [/ w
憒yum update httpd
6 s o8 ~+ t: \4 [
8 Q& b0 [ w' X0 Zyum upgrade
5 z& P% y. p/ j. z% y#質update撌桐憭嚗撌桀亙冽慶um upgrade銝鈭喳瘣格掠憟隞嗡銝韏瑟湔堆憭批雿輻典函砍蝝
, ~2 B$ G+ c0 {
1 ^2 t8 `8 W6 L, [& ^1.1摰鋆.蝘駁文隞
# E+ V3 U) i4 T9 A, \2 uyum install
7 A; c9 j& P+ x& u g( `/ K- j#摰鋆憟隞塚install敺X亥摰鋆憟隞嗅蝔梧憒yum install httpd亥賊銝韏瑕鋆閰勗臬冽敺銝*憒yum install httpd*
, Y! m6 h" F9 v( F! J4 o1 W1 M
5 n* H1 M& N& Tyum --enablerepo=(Repository) install 摰鋆芯蝙冽憟隞嗅澈,憒憭,銋臭誑,亦/etc/yum.repos.d/鈭.repo
& u9 C; v' U! D- ~% G) F$ w憒yum --enablerepo remi,remi-php55 install php
' \! w# [' i( y4 Q B7 @% }5 {/ C' F/ s/ |* Y4 Y
yum reinstall啣鋆憟隞
3 @" y4 {2 t* x5 E: W
# H' B+ n0 `3 L0 u. p- d G% Ryum remove
+ [- C5 F B5 ?4 O#蝘駁文隞,券桀啁訾抒憿嚗臭誑yum deplist 曉箸訾憟隞,銝銝蝘駁支閬憟隞,頝喲閬靽憟隞,憒祉典隞(蝝憟隞嗅航賣典) - J8 _: A/ M1 D0 M5 P9 p
3 W* U% o' {" E" [: r# w) f1 ~+ {靘憒:0 K$ ?; ~: a5 W2 A) Q$ C
yum deplist httpd | grep -v httpd | grep provider | awk '{print $2}' | sort -u
+ R) g" b6 s+ f0 X6 H6 k% [remove敺舀亥蝘駁文隞嗅蝔梧憒yum remove httpd亥賊憟隞嗡銝韏瑞宏斤閰勗臬冽敺銝*憒yum remove httpd*
% a6 v; Q" i! j5 j/ W- e S& t1 Q: ?( ^7 T( @
yum clean2 h+ W. G k( _6 q, f6 O
#皜文鋆銝頛怠憟隞嗅憪瑼嚗憭批臬曉/var/cache/yum嚗撣豢銝yum clean packages砰um clean all嚗銝甈∪典芷扎) a! W3 b' [2 t/ x: A. M& s: Q4 W
, U4 [( n5 \. B! w8 @2 W0 F4 U1.2皜怠$ _/ J4 i3 m$ p: \' G2 l
yum clean
* i4 |! O( o2 ?3 G#皜文鋆銝頛怠隞嗅憪瑼嚗憭批臬曉/var/cache/yum
* L& u0 _( D* M) r1 ~" H$ x9 |% ~! ^5 {' B5 o! D
yum clean packages
' |& `9 K6 t& Z- ]" y#其皜斗怠(/var/cache/yum)桅銝憟隞
1 y2 }8 b* ?! h$ R$ c% c, l& E8 l3 }: S0 M) ?! R
yum clean headers* ?6 P9 O% B0 ]$ S- f. R1 Z& o
#其皜斗怠(/var/cache/yum)桅銝 headers
# p+ `$ s# P* o8 {& u
: c* p5 f1 Y1 O$ |yum clean oldheaders0 _9 @' Y1 X3 d/ e* v
#其皜斗怠(/var/cache/yum)桅銝 oldheaders
4 }# }, o4 X0 ]" G" }
! n" g: s r8 D+ qyum clearn all
3 h' {$ \, M7 h& A#湔交怠賭甈⊥扎
6 M' ^5 h0 ^+ E' x9 C. t/ N" Q9 x& C9 a9 I1 t
1.3皜
( h p& [$ Q" w7 {: e/ Wyum list
' |$ x) ~! R: g& v7 Q#箸Repository摨憟隞塚亙甸ist敺X亙隞嗅蝔梧臬桃典箄府憟隞嗚& J& i) h6 Z0 `. ~% [7 w& ?
6 v- `4 k; o9 U9 |2 c
yum list updates
! \3 m+ n p s+ P1 ^3 a#箸臭誑湔啁憟隞" o1 K6 n$ X2 W Y+ D9 ~7 r
$ G; o! h) s: w8 Q/ P6 d8 m
yum list installed
- Q6 m( x! t# Q% l: M#箸撌脩摰鋆憟隞
' V! ]( P1 t s# }# J8 @6 h
8 }) J( ~5 N/ d- u5 k8 nyum list extra
8 l/ |8 e* s) P0 `. u#箸撌脣鋆雿銝 yum Repository摨 抒憟隞
' e0 b* u0 m- S: i r o1 ]7 W/ V1 ]" g4 s
1.4箏隞嗥賊鞈閮% h- a) S$ B9 A" _" r" B' X
yum info
1 u+ _1 G1 ]7 i/ D#箸憟隞嗥賊鞈閮嚗亙甬nfo敺乩憟隞嗅蝔梧臬桃典箄府憟隞嗥賊鞈閮# w( O& V+ U. [7 U8 a
憒yum info httpd yum info httpd*嚗撌桀亙冽潭*隞去ttpd剔賢箔: m. W- ?! ^# l% a6 J
! f% @& t) q9 m3 S* C
yum info updates
" p N, H8 t* W#箸臭誑湔啁憟隞嗉閮# E# m$ i2 K# c8 n" x1 Z
9 ]5 K3 ^. w9 uyum info installed
: t( R9 m2 n2 X9 [. ~#箸撌脣鋆憟隞嗉閮
- }6 r9 X F" h! \( P# D# m* T
1 L$ j) u/ H8 \) c- M/ R/ Hyum info extras
; Z7 a& w+ [: Y- U; o#箸撌脣鋆雿銝 Yum Repository摨 抒憟隞嗉閮6 `9 N7 W: d# X- |8 C
0 \# `4 y4 O. E+ {1 c
$ `# t+ g K2 J7 }/ u" `2 v" `9 ~1.5撠
" {' G4 Z7 V0 m. F" q5 I- \yum search
9 m( j0 ^4 @- X* q$ |0 E/ Z8 f#撠賊憟隞塚憒yum search httpd嚗典銝剜曉唳閬憟隞嗚憿隡潮萄券, M! F( O! O+ b$ B( a i
, ?/ F5 J* A f. ~) H0 M蝝憟隞嗡銝kernel
! \" P/ A% a5 N. A; ?' d憒唾肘um靘蝝憟隞塚雿銝喳逃ernel閰晞隢銝W瘜0 a% z" u v h3 N e+ ]
[root@localhost ~]# vim /etc/yum.conf+ g, ?- h- G& E3 ]# W
#沍main]嗡葉乩W銝9 }4 ]- `, l; R/ c
exclude=kernel kernel-source: n* `* \0 j' {; q+ g9 V7 W) [
7 a$ R; g1 q j8 p7 |嗉牧yum冽敺憭嚗雿臭砍虜函憭扳撠望臬鋆湔啣蝘駁扎拐蝑典唳亦撠勗臭誑鈭 F- W% s$ D- ^! G8 c7 e9 f$ h
. p3 Y1 ~: H3 H) W& {. D6 Y
* h+ b- k* R9 w$ ]+ Vyum撣貉憿臭誑摰蝬脩閫蝑% h4 A. m; f. Y& `
http://yum.baseurl.org/wiki/Faq& H9 v% B" {7 `1 D
- N9 x& x7 r6 @8 F* p/ ^* i0 G5 t8 K/ v! M8 E/ P: f
閮: 甇斤 http://ithelp.ithome.com.tw/question/10077313- j7 c2 v; Q2 |' x* D( C
8 ?' E& U& t0 L1 x i6 v% c% _
- S1 v: @+ M# Z- n( `4 U/ `$ T& f2 s( e# _8 \! F/ z
4 s) d3 C+ x% Q" U. ~# D
0 J7 F9 @4 N. _8 j8 O" o1 N) W0 s; f, @ X' F+ V0 K( d! V2 m+ p) W5 G7 m
$ I: Y; j1 m4 ^9 R& I* V% s
/ J, L, E4 ?$ [/ R3 e4 a8 f |
|