銝yum蝘駁方摰鋆
9 K/ E* J+ Q% U% o5 D7 R0 n1.亥岷臬行摰鋆yum
5 P+ F4 _; b L0 y5 V3 a) y6 s# d/ J5 S w. F5 B
- [root@localhost ~]# rpm -qa | grep yum3 a; @8 ]" X; g+ c( P4 s
- yum-metadata-parser-1.1.2-3.el5.centos- ^' D9 r' k5 Y0 m, N) t; D7 U4 Y
- yum-3.2.22-33.el5.centos
, b5 x! l9 J8 ]6 T) o - yum-fastestmirror-1.1.16-14.el5.centos.10 C& f5 @+ m1 [( D) F2 N
- yum-updatesd-0.9-2.el5
銴鋆賭誨蝣
+ D0 n; T- b) E: k) y# G0 h# A' Y2.蝘駁巾um (蝘駁斤孵拍車銝喳)
7 S6 f* {. E- L. ?* _6 L2.1肘um孵蝘駁: d, i3 l% m% G1 v- j$ d; B Z
- [root@localhost ~]# yum remove yum*
銴鋆賭誨蝣 : |2 X0 D/ Z; b6 O+ b/ e5 K5 C
2.2禿pm -e孵蝘駁
0 ]7 Y& ]- y3 {#亦鈭yum瑼獢閬蝘駁斤
' [8 c1 l" y9 @, S. \6 `8 w- [root@localhost ~]# rpm -qa | grep yum' d1 A; G% w# [- n
- yum-metadata-parser-1.1.2-3.el5.centos
" z' q, }8 t( a. J6 Y - yum-3.2.22-33.el5.centos
0 y, M9 {! ^' S+ \! T7 q - yum-fastestmirror-1.1.16-14.el5.centos.1
4 p8 H; W8 o3 c1 ~% g - yum-updatesd-0.9-2.el5
銴鋆賭誨蝣
7 x2 ~5 i: X H# y- `. K9 G#蝘駁巾um憒閬敹賜亦訾抒憿,臭蝙 --nodeps 賊0 g0 `$ V$ z r
- [root@localhost ~]# rpm -e yum-metadata-parser-1.1.2-3.el5.centos
1 Y. a& d3 c6 m - [root@localhost ~]# rpm -e yum-3.2.22-33.el5.centos* m% E5 x" J$ h! J7 U& k* C6 R" Y$ l
- [root@localhost ~]# rpm -e yum-fastestmirror-1.1.16-14.el5.centos.1# T% C% ] z5 `$ Z
- [root@localhost ~]# rpm -e yum-updatesd-0.9-2.el5
銴鋆賭誨蝣
( j8 M, T% r0 `& \鈭摰鋆yum
6 k7 ]& M! ~- ?1.摰鋆皞5 V8 z% a" p' }1 q! D0 ~! j) L
典鋆皞其遢臭誑唬誑銝蝬脣亦
0 |7 {) ?5 u' |) d7 P隢靘芾閬曉啣鋆皞2 ~! t0 n2 t, ^1 c$ {( x# k; A
i386 :
) u. y5 @+ U3 X5 `9 Fhttp://mirrors.sohu.com/centos/5/os/i386/CentOS/- I" V7 z' G; m6 u6 G
http://mirror.centos.org/centos-5/5/os/i386/CentOS/
2 t$ }* |: P# y' |9 D8 r
5 p T, f! K1 V3 t7 ]. hx86_64 :
8 h- v$ F$ j( Qhttp://mirrors.sohu.com/centos/5/os/x86_64/CentOS/8 c. G2 l' F) f3 r. r5 G2 U
http://mirror.centos.org/centos-5/5/os/x86_64/CentOS/7 U* \# |9 H+ T, Z; W0 d
, P ^1 a" a# t& P# V0 S. H0 W
0 a# C- m6 D, C8 L# I; Z& r0 O2 R肘um其遢銝餉臭蝙典唬誑銝4瑼+ ?7 f* j t. R& }8 i& m; |; D
yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
3 ^& q" Z% |* E9 f; myum-fastestmirror-1.1.16-16.el5.centos.noarch.rpm
/ S- ^, z9 T) y0 s6 u: byum-3.2.22-37.el5.centos.noarch.rpm
* F0 T3 Q- e3 a8 ~ D2 J- d7 Xyum-updatesd-0.9-2.el5.noarch.rpm
* F0 O& @7 ]+ Y( f1 X, f$ S: Z/ I; _' i, ~5 R
2摰鋆yum1 x# ?* @1 h4 x9 U$ l
i3868 I6 i0 o$ z7 q3 j8 H
- [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
! J5 N! }: N) j1 U+ t - [root@localhost ~]# rpm -qa |grep yum/ l! l+ h# L. t" y. I7 n; _
- yum-updatesd-0.9-2.el5
% X- v* P0 H3 w5 t% n, [ - yum-metadata-parser-1.1.2-3.el5.centos
4 p3 Y+ d% @" p$ |6 v9 }5 \" ] - yum-fastestmirror-1.1.16-16.el5.centos) ^" I) n. a4 f0 I7 f" s
- yum-3.2.22-37.el5.centos
銴鋆賭誨蝣 * {+ c) `1 A7 w& B4 q, x
x86_64. N9 \9 E6 e* x* J Q8 v2 ^, [7 i
- [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$ d* y* T% Z6 {
- [root@localhost ~]# rpm -qa |grep yum
0 p+ }" f( t" L# B1 _9 G2 Z6 y) v - yum-updatesd-0.9-2.el5) T9 W$ K6 e& C$ s
- yum-metadata-parser-1.1.2-3.el5.centos9 [# Y/ w6 ~4 S: n+ \' M
- yum-fastestmirror-1.1.16-16.el5.centos, u9 I$ E% B! b, n$ e+ P( I7 r0 U5 ]# F
- yum-3.2.22-37.el5.centos
銴鋆賭誨蝣
+ o1 A5 w, c1 ?+ e2.2湔唳撌脣鋆憟隞(靘鈭粹瘙臬行湔)
0 W/ w/ Y& p' W @+ c! C- [root@localhost ~]# yum -y update
銴鋆賭誨蝣
9 `$ G- \4 ~; V4 J8 v銝yum隞方牧
4 H2 t& W1 R; F# r# q0 {其蝙肘um嚗撠銝頛梯正嚗摮曉/var/cache/yum桅銝# a; D% U: \# O9 x1 M6 R' k8 K/ |
1.yum湔
! U* y+ }0 Q+ E: @yum check-update 1 D& a% Q5 @6 _5 n+ t q% e
#瑼X亥賣湔啁憟隞嗆鈭* b8 e* N) v- I* E+ b/ a4 c* ~
- a+ }; `% t# U+ |/ M- l0 P
yum update 2 }# u% q/ }0 @& d
#湔唳撌脣鋆憟隞塚亙罕pdate敺X乩憟隞嗅蝔梁閰勗舫撠閰脣隞嗆湔9 ~) N+ T- j, h- [) E7 i9 F: ^& U
憒yum update httpd1 W8 O1 R [) n0 k. q. R& j
9 }: P! m( f# |& ?
yum upgrade
! I( Z2 F9 k' t& n& N3 A#質update撌桐憭嚗撌桀亙冽慶um upgrade銝鈭喳瘣格掠憟隞嗡銝韏瑟湔堆憭批雿輻典函砍蝝
0 c4 `/ h6 p- C+ l3 ~
1 P, C, f3 |+ f) [5 |9 H1.1摰鋆.蝘駁文隞
; @2 H/ F6 O! I4 D$ n% c uyum install 2 ?8 t* M8 y" F% y0 a
#摰鋆憟隞塚install敺X亥摰鋆憟隞嗅蝔梧憒yum install httpd亥賊銝韏瑕鋆閰勗臬冽敺銝*憒yum install httpd*# [7 `0 C7 c/ D- c; Y
6 {" S1 u7 g7 X) ]
yum --enablerepo=(Repository) install 摰鋆芯蝙冽憟隞嗅澈,憒憭,銋臭誑,亦/etc/yum.repos.d/鈭.repo
% R6 A u9 R# b# C0 h, U; e, r憒yum --enablerepo remi,remi-php55 install php( a$ [6 ?) i9 F9 }: i
: H& g. ~/ Z. [1 i! Byum reinstall啣鋆憟隞8 v( x3 ^1 l5 S9 L2 L
: t# N2 g" Y6 G& ]/ [/ m# ]3 Z
yum remove
! b! B7 B$ H( ^7 h#蝘駁文隞,券桀啁訾抒憿嚗臭誑yum deplist 曉箸訾憟隞,銝銝蝘駁支閬憟隞,頝喲閬靽憟隞,憒祉典隞(蝝憟隞嗅航賣典)
" u5 z7 h0 A: f ~ c5 o- n
8 ? q# |+ a; r3 @; M靘憒:) x1 q9 T7 K8 o$ u9 c
yum deplist httpd | grep -v httpd | grep provider | awk '{print $2}' | sort -u
^0 ^, y9 U7 G* F! [# v. ]' kremove敺舀亥蝘駁文隞嗅蝔梧憒yum remove httpd亥賊憟隞嗡銝韏瑞宏斤閰勗臬冽敺銝*憒yum remove httpd*
. Z7 ?' o" c& c4 j; @: Z2 Q, t, I: Z( o% ~% g5 }9 g. O5 {" E! t& l
yum clean5 x% G% h( Y9 ~- t/ M) Q# q
#皜文鋆銝頛怠憟隞嗅憪瑼嚗憭批臬曉/var/cache/yum嚗撣豢銝yum clean packages砰um clean all嚗銝甈∪典芷扎
7 m/ x2 e: i# q. ?6 q8 d) n; u2 i
. L8 n1 B' {" e. y) \/ e1.2皜怠: z7 ~7 ]% y* V# f/ k
yum clean4 M/ s3 l2 t) M0 q8 u) E
#皜文鋆銝頛怠隞嗅憪瑼嚗憭批臬曉/var/cache/yum- r( V5 ~) ` [ H4 |
- `/ I% E" i- @2 G$ g" t1 N+ s
yum clean packages
* f' R& f: y' e9 U! E" x#其皜斗怠(/var/cache/yum)桅銝憟隞& u8 t W; G& {9 Y$ n0 E1 D
; `2 e/ i# P) h% i# P: jyum clean headers$ W) B0 J% d% N- C0 V+ W
#其皜斗怠(/var/cache/yum)桅銝 headers" S8 f) X' ?9 N7 _
" M1 v- E0 b' b7 D' R
yum clean oldheaders
, Z( }- D# f6 B3 u#其皜斗怠(/var/cache/yum)桅銝 oldheaders
% W: L: T! v* ~3 l( q3 s2 m
# r6 O# ^1 g( n' F3 k; vyum clearn all, i' V! _) G% [- K5 l* f# ~
#湔交怠賭甈⊥扎! m% \1 X' N( I9 B0 y! ]
/ C( _5 F- S. I2 J4 j1 j7 [1.3皜
; y [( ^3 J8 H/ s9 Hyum list
R5 s0 `5 n; J9 u+ [; a0 }5 q#箸Repository摨憟隞塚亙甸ist敺X亙隞嗅蝔梧臬桃典箄府憟隞嗚
7 w3 l8 O, m# Y- b; |
. @& ~9 |' Q# F' u+ \- Byum list updates+ g# w4 m6 L0 j8 a- x9 }
#箸臭誑湔啁憟隞, s( r g: F" s. H1 C+ k
2 V) [7 u" F" {0 y: ]: S
yum list installed
( {" r" l L( n' Q#箸撌脩摰鋆憟隞
2 q. d9 C0 M0 p' p9 v% f r3 ^* m0 H0 G2 F2 _; U8 m
yum list extra
9 r H: N2 q% E' _9 x+ U! n#箸撌脣鋆雿銝 yum Repository摨 抒憟隞
: _+ h" v& W8 m6 ]+ L) ^* |$ E- x8 `( s, d2 Z3 j% Y
1.4箏隞嗥賊鞈閮2 j5 F, {& n, K( ?" D
yum info9 R( H# f' r0 O3 `
#箸憟隞嗥賊鞈閮嚗亙甬nfo敺乩憟隞嗅蝔梧臬桃典箄府憟隞嗥賊鞈閮
/ V) }9 H0 j% i- \7 t: J憒yum info httpd yum info httpd*嚗撌桀亙冽潭*隞去ttpd剔賢箔
, j& u2 e+ G! s# p% v' c& H5 o1 d& a k5 y$ e: R
yum info updates+ n6 T+ N8 \, o4 ?3 n# Z% w+ T) B
#箸臭誑湔啁憟隞嗉閮
9 x" g+ m. T: _6 {, }: K" e% D, r. n- I
yum info installed& U1 H! n' Z. T* l; w9 h
#箸撌脣鋆憟隞嗉閮
* q3 N/ ?) j& f, ^3 }1 @9 P, c, ?7 T0 a; L( c" l
yum info extras3 R! j8 T) Q9 C$ y+ W& I' P
#箸撌脣鋆雿銝 Yum Repository摨 抒憟隞嗉閮' M: \" g- d! C- i9 s
" b, M+ I/ E7 W2 Q7 n
5 [3 N. [ A. ~4 g, j3 p1.5撠7 \+ P; I2 `) ~
yum search3 T6 N% _8 ]! u1 l7 H5 g* a
#撠賊憟隞塚憒yum search httpd嚗典銝剜曉唳閬憟隞嗚憿隡潮萄券
8 g# F1 `% g! T# [( h
2 H5 X% R0 q. ~8 p& y蝝憟隞嗡銝kernel
# a# i9 t3 f. z* o2 x- n* Q憒唾肘um靘蝝憟隞塚雿銝喳逃ernel閰晞隢銝W瘜
|1 j0 n# O( P[root@localhost ~]# vim /etc/yum.conf$ V! b1 V& G4 `# ?; q
#沍main]嗡葉乩W銝6 |6 T" I/ O# A2 x) j# g2 ^/ r) f
exclude=kernel kernel-source5 ]9 f6 S2 |4 E9 o( d% O4 E' n
' M! v# s" k, [
嗉牧yum冽敺憭嚗雿臭砍虜函憭扳撠望臬鋆湔啣蝘駁扎拐蝑典唳亦撠勗臭誑鈭9 l$ O; ?0 i5 W
; R1 L# z/ z1 D! _; q+ ~: i
4 U6 `- x2 U' V nyum撣貉憿臭誑摰蝬脩閫蝑
9 C( a: P+ G: U4 h2 `/ h( @) uhttp://yum.baseurl.org/wiki/Faq: n; w' G! @; q, G& I
9 H! M5 K0 o; S; U* b
7 ]8 u# e' n2 f! E
閮: 甇斤 http://ithelp.ithome.com.tw/question/10077313
8 B5 b" c. _( t
% U1 H8 R" U+ I3 c6 Y' p% n$ X0 v: J* P2 c+ F
" f5 Y" C$ E: j, h
E6 Q5 o' R# }: E
/ L2 q3 ~/ J' [% B" t- @
4 A. L% ~4 n- b
) U( K \2 S( A( M( D* b, q# F# K2 a2 e
|
|