銝yum蝘駁方摰鋆 ( w3 P7 e! w( f9 ~/ a
1.亥岷臬行摰鋆yum Q' e1 `( j r; x& V; I+ y: C
' X0 F% \3 O+ i, y! w7 V9 x
- [root@localhost ~]# rpm -qa | grep yum; T4 P/ h/ A2 I( G
- yum-metadata-parser-1.1.2-3.el5.centos
3 \6 n+ f/ T9 ~7 f - yum-3.2.22-33.el5.centos1 F6 J; o/ d4 @/ P: u
- yum-fastestmirror-1.1.16-14.el5.centos.1! Q- g' |# @6 N/ X. W+ @+ J
- yum-updatesd-0.9-2.el5
銴鋆賭誨蝣 : o( p$ U0 \# l- r9 `! Z- g
2.蝘駁巾um (蝘駁斤孵拍車銝喳)' C2 c' i9 f% N/ a/ E0 c% a
2.1肘um孵蝘駁
1 L J @* r+ y) M8 T$ G- [root@localhost ~]# yum remove yum*
銴鋆賭誨蝣
. ` a4 \+ H# l1 Z2.2禿pm -e孵蝘駁" I; T# _1 h' C! U4 C3 z$ w
#亦鈭yum瑼獢閬蝘駁斤
4 d& W/ _, I0 `3 n3 X. L5 k2 c- [root@localhost ~]# rpm -qa | grep yum
# Z. p& d+ e, B - yum-metadata-parser-1.1.2-3.el5.centos
% a+ P- K9 A# Q3 H/ r - yum-3.2.22-33.el5.centos( l, `) G; i) s' ^9 p3 p; O
- yum-fastestmirror-1.1.16-14.el5.centos.14 ? U$ M, h$ c. B8 H; |
- yum-updatesd-0.9-2.el5
銴鋆賭誨蝣 8 a# h% ~; o) j( q/ u
#蝘駁巾um憒閬敹賜亦訾抒憿,臭蝙 --nodeps 賊% c( Q) X4 f/ ~$ ~& i* ^3 E l0 M' n
- [root@localhost ~]# rpm -e yum-metadata-parser-1.1.2-3.el5.centos
, c, _5 m& U, B& Q' p+ A0 }+ t - [root@localhost ~]# rpm -e yum-3.2.22-33.el5.centos
' D$ } n/ ]$ |2 P; i4 f( \/ [& M - [root@localhost ~]# rpm -e yum-fastestmirror-1.1.16-14.el5.centos.1& ?& |: t& Q( ]6 h
- [root@localhost ~]# rpm -e yum-updatesd-0.9-2.el5
銴鋆賭誨蝣
) d P8 p! E9 Q& q鈭摰鋆yum
7 ~% Y1 ]: G/ t. U" Q, Y1.摰鋆皞2 i! C9 W& M9 p1 K3 q+ D# r3 M
典鋆皞其遢臭誑唬誑銝蝬脣亦- h& ~9 V$ ]8 S ?
隢靘芾閬曉啣鋆皞( D. B3 }% w2 E' m/ F: D$ c, w
i386 : 4 O7 i- o+ j8 @2 \4 S0 f1 I
http://mirrors.sohu.com/centos/5/os/i386/CentOS/
% {9 o3 _4 r# _http://mirror.centos.org/centos-5/5/os/i386/CentOS/4 L4 K( E( t* ^$ Z7 [$ t
0 b& G( i. c; y9 X; jx86_64 :
7 r# D1 j' R, k# d4 T' g" A Xhttp://mirrors.sohu.com/centos/5/os/x86_64/CentOS/
" E; K( V ]) a8 vhttp://mirror.centos.org/centos-5/5/os/x86_64/CentOS/
$ {0 U( g3 C# \4 b" c% O. l$ p0 k+ ]# c0 ?5 L+ U
' L0 k$ V9 Z; y7 f# K肘um其遢銝餉臭蝙典唬誑銝4瑼
) K$ q5 U6 V) byum-metadata-parser-1.1.2-3.el5.centos.i386.rpm $ V# O) w% D- W$ q3 M N
yum-fastestmirror-1.1.16-16.el5.centos.noarch.rpm
0 \: [- k8 A5 O0 b* v% @yum-3.2.22-37.el5.centos.noarch.rpm
- j6 K( f% s3 l0 {# e! @+ ~- v4 ]yum-updatesd-0.9-2.el5.noarch.rpm# C0 x7 v* V/ C6 G* q
8 o" K0 R2 E( K* T+ o/ K' j
2摰鋆yum+ d k& |- H& Y/ A! _! @, i7 w" H
i3865 Q- Q1 T; f8 a/ o/ o, {
- [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
; M- U/ a. K. o% Q5 S - [root@localhost ~]# rpm -qa |grep yum, T$ i1 N$ g: c+ B7 p& x
- yum-updatesd-0.9-2.el59 W: E2 U, Q8 \0 n2 ?3 W4 k
- yum-metadata-parser-1.1.2-3.el5.centos
! S7 D- l; ~% _8 Z* N6 n - yum-fastestmirror-1.1.16-16.el5.centos
+ [% q9 Z# V, P2 i; Z& n: B! @7 } - yum-3.2.22-37.el5.centos
銴鋆賭誨蝣
# \" I7 {5 g" Q* k2 l$ x( C% S1 Sx86_64
: }' q8 R8 F- H" \- [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 6 d1 W( ^/ \0 U. Y1 [
- [root@localhost ~]# rpm -qa |grep yum3 W2 L( t# g+ X9 P9 J" @
- yum-updatesd-0.9-2.el5
; r9 ~. ]* [3 i' N$ J( M2 L - yum-metadata-parser-1.1.2-3.el5.centos. G# a3 K: W% I2 s5 Q
- yum-fastestmirror-1.1.16-16.el5.centos
) Q) n" E& ~) \6 W) y. c - yum-3.2.22-37.el5.centos
銴鋆賭誨蝣 ]6 [6 x, N, X1 q$ s: Y' ?
2.2湔唳撌脣鋆憟隞(靘鈭粹瘙臬行湔)
/ ?( R3 G H/ Q( n" R& Y- [root@localhost ~]# yum -y update
銴鋆賭誨蝣 & \. R# {2 t: | P8 l# }2 {% ~
銝yum隞方牧
4 n$ O$ {- O4 o: U% u( A6 V* i其蝙肘um嚗撠銝頛梯正嚗摮曉/var/cache/yum桅銝
, s K6 I5 V( z" Z, R5 j% c9 \1.yum湔* U. a1 s2 |. F& X. h0 z; Y5 k
yum check-update : U* p3 ^$ l6 \! D
#瑼X亥賣湔啁憟隞嗆鈭0 V; B d: T/ a% B- _; j' o
% D7 H8 Z" C( r( a: i6 e) J
yum update 8 Z3 E' S1 P" W2 N( `- ]
#湔唳撌脣鋆憟隞塚亙罕pdate敺X乩憟隞嗅蝔梁閰勗舫撠閰脣隞嗆湔& m7 w3 H/ a9 |! z3 H7 O- D
憒yum update httpd9 U. y+ s: @0 G1 J3 [
% W3 T+ r! l3 Z7 [) k: H+ Hyum upgrade, i; s0 `. u/ O% N" H" E% D
#質update撌桐憭嚗撌桀亙冽慶um upgrade銝鈭喳瘣格掠憟隞嗡銝韏瑟湔堆憭批雿輻典函砍蝝
; G# `3 r* p& g. Z0 {* @; C& Y8 E2 T! R, \! G0 b% J: r2 _$ ?, X
1.1摰鋆.蝘駁文隞; z1 k/ @: a2 w/ t! B
yum install
; y. |- t2 u8 U: M9 S#摰鋆憟隞塚install敺X亥摰鋆憟隞嗅蝔梧憒yum install httpd亥賊銝韏瑕鋆閰勗臬冽敺銝*憒yum install httpd*
) c2 j5 `4 E# [5 q" D; e
, c6 h% G& w9 {+ {: t7 b6 z6 Vyum --enablerepo=(Repository) install 摰鋆芯蝙冽憟隞嗅澈,憒憭,銋臭誑,亦/etc/yum.repos.d/鈭.repo& R6 y9 @' s9 M' |9 ^( `, i
憒yum --enablerepo remi,remi-php55 install php
+ a0 x4 x' ^% g5 G) P7 x
) k; l$ P R7 Gyum reinstall啣鋆憟隞
& c: a% c) ?6 v, h1 ~ e
/ O# i' n. P2 R, u3 X* T4 w0 Xyum remove; \5 E1 o' _2 h; @. n
#蝘駁文隞,券桀啁訾抒憿嚗臭誑yum deplist 曉箸訾憟隞,銝銝蝘駁支閬憟隞,頝喲閬靽憟隞,憒祉典隞(蝝憟隞嗅航賣典)
+ f0 ?' y9 A9 s6 e! q
% V7 R3 o) D3 L* v+ \! {靘憒:: @4 L7 L9 T& R& c
yum deplist httpd | grep -v httpd | grep provider | awk '{print $2}' | sort -u6 @1 V" t2 U) }# @& O
remove敺舀亥蝘駁文隞嗅蝔梧憒yum remove httpd亥賊憟隞嗡銝韏瑞宏斤閰勗臬冽敺銝*憒yum remove httpd*
: D4 {9 f, v* y$ H x
0 B, e: F5 g: N5 ]0 z9 D) jyum clean
/ C, ?* o8 N$ F4 y! P4 P0 H0 p#皜文鋆銝頛怠憟隞嗅憪瑼嚗憭批臬曉/var/cache/yum嚗撣豢銝yum clean packages砰um clean all嚗銝甈∪典芷扎/ i/ [1 T% v4 G- {' r9 w+ m# g" C
4 t4 ~! X" h: o+ X. T) f$ G1.2皜怠
! e" z, d/ t8 |7 g ?. N' v: cyum clean
& j" E l7 v3 `, `2 m. ?4 w: A#皜文鋆銝頛怠隞嗅憪瑼嚗憭批臬曉/var/cache/yum
4 f O2 @; K& y+ N* f! s" [) i# P
) H0 {' u+ A) J) Oyum clean packages
+ Z) Z e9 X- U) e9 y6 m; W% D ?# y#其皜斗怠(/var/cache/yum)桅銝憟隞
& U. a) y) n, x4 f2 V! M/ G1 a z
: L" E: r; m# [$ X6 Z: Vyum clean headers D6 J) ? Z. ?! `5 |5 T
#其皜斗怠(/var/cache/yum)桅銝 headers
' F" ?$ _7 v+ ]* b( e" L( u) K; ~. j. ~9 O
yum clean oldheaders
, W1 K l8 h* {1 K" f#其皜斗怠(/var/cache/yum)桅銝 oldheaders
$ z; m0 B9 P1 r% `! n( c) a: n# p% y/ }, m: ^6 y+ L
yum clearn all3 R' w; u( \. R2 C' {9 ?9 J5 i
#湔交怠賭甈⊥扎
1 a) ^+ d& O5 { I. ]6 H1 `1 R2 K& i: V$ m8 n" S
1.3皜; i. z0 {3 J' o+ r. ^" ~; [5 B/ I. _
yum list6 A; l$ @/ n. R
#箸Repository摨憟隞塚亙甸ist敺X亙隞嗅蝔梧臬桃典箄府憟隞嗚7 B% j/ `+ |# j( [
9 l. f+ R( N# X2 y3 [2 P8 w* {yum list updates
7 [3 A/ x2 O* Y4 C" a#箸臭誑湔啁憟隞
- ^ M# k: l7 G- A7 M) _ J
, P" W; d' o Syum list installed1 y$ f& y4 M( k9 o, s
#箸撌脩摰鋆憟隞7 i7 v* K0 L, H* W5 T
, A( b0 I* g) J& r; x) @; Wyum list extra
1 J1 x) o- M, [9 p- i% F7 d& Y#箸撌脣鋆雿銝 yum Repository摨 抒憟隞7 F. j2 z+ c: u
$ a: F' Y9 x2 H4 A9 a$ o% J
1.4箏隞嗥賊鞈閮$ e p! h' R) m2 B2 ~
yum info
' r& ?) N6 i; ~, @3 Z#箸憟隞嗥賊鞈閮嚗亙甬nfo敺乩憟隞嗅蝔梧臬桃典箄府憟隞嗥賊鞈閮9 ^; @7 V4 q: b
憒yum info httpd yum info httpd*嚗撌桀亙冽潭*隞去ttpd剔賢箔- f) S/ R: f. a- a+ t
- D& q* A3 D' c Fyum info updates7 L5 @$ h$ k- a' B6 X2 @3 i
#箸臭誑湔啁憟隞嗉閮
1 u4 j, F9 s% b, T4 t2 }2 y" y, j% K* {& W( o
yum info installed
! k5 j, N8 G5 N. Y" @#箸撌脣鋆憟隞嗉閮* P$ ^: S" A, C
4 {6 l4 X, F7 S5 tyum info extras h5 O$ c; |: Q, f" `/ ^
#箸撌脣鋆雿銝 Yum Repository摨 抒憟隞嗉閮2 w" G% c# {" n2 d
, O0 [6 p6 I. ~4 X
& T% S0 y+ F" ?; D# J6 _# \8 R1.5撠
0 |* |' S, [7 K* P; Q ^* hyum search/ q% {6 B6 ?+ k. i; z5 b
#撠賊憟隞塚憒yum search httpd嚗典銝剜曉唳閬憟隞嗚憿隡潮萄券' `+ N, a3 ?) H% _
% S4 X+ J, b5 P" b
蝝憟隞嗡銝kernel
/ F! c% _5 N) `6 {. C! `憒唾肘um靘蝝憟隞塚雿銝喳逃ernel閰晞隢銝W瘜
4 ~; _9 q! v+ {! D, ^8 z[root@localhost ~]# vim /etc/yum.conf
# }9 X8 Z7 B1 ^. c#沍main]嗡葉乩W銝 m: F" N: ]- j
exclude=kernel kernel-source- A1 n1 _/ K* o% s N% X
* a( n ^ R+ C" ^嗉牧yum冽敺憭嚗雿臭砍虜函憭扳撠望臬鋆湔啣蝘駁扎拐蝑典唳亦撠勗臭誑鈭3 ` z# Q" n% d
5 U- K2 c B5 X: K6 m, y, x1 W/ J$ G* m5 j- _1 t* U
yum撣貉憿臭誑摰蝬脩閫蝑
5 @& {& U' |0 V" Q( ?# ?' phttp://yum.baseurl.org/wiki/Faq
C5 m# d1 n; U8 b* `% V) g: G4 K- M( r- H
+ N s9 @3 \. `2 H2 T
閮: 甇斤 http://ithelp.ithome.com.tw/question/10077313
8 {( \ t( t2 k& a1 \) V$ X
: n0 k; E8 i) R" z1 p
( s+ _9 f* V8 A6 g$ D7 z9 V7 \' [0 _! Q9 R! J7 O( y
, o+ _8 M1 d; w6 G% I r) F! H' S" M. j5 @+ v. l9 Y* Q
! i. z1 o# s0 I# B# f: K
8 M: F8 G, u) O' w0 [3 x1 }# k7 o- g; A/ B! z
|
|