銝yum蝘駁方摰鋆 / J7 F' p/ D- T1 B4 g/ w
1.亥岷臬行摰鋆yum
# _+ @6 s: z3 r9 B8 e! T" u/ A+ I! v
- [root@localhost ~]# rpm -qa | grep yum0 M# Q/ d' `, W& B- F/ \
- yum-metadata-parser-1.1.2-3.el5.centos
6 L8 W- T2 [/ y" r( F9 \ - yum-3.2.22-33.el5.centos
. o) T0 e/ }# J$ a- T% A - yum-fastestmirror-1.1.16-14.el5.centos.1
9 V% E/ p0 C) y: }# \ l1 P - yum-updatesd-0.9-2.el5
銴鋆賭誨蝣
K* D: d2 o/ K/ m+ ^2 e2.蝘駁巾um (蝘駁斤孵拍車銝喳)' v; X4 c) [' W6 F; o
2.1肘um孵蝘駁3 |& ~- P% \. _% i$ T& I& P
- [root@localhost ~]# yum remove yum*
銴鋆賭誨蝣 & G& E: q& c; A4 Q4 B
2.2禿pm -e孵蝘駁9 n+ M) `+ l+ }! l' }3 K
#亦鈭yum瑼獢閬蝘駁斤 i& r2 f3 ]5 u7 s6 | N
- [root@localhost ~]# rpm -qa | grep yum
4 Z5 _1 F$ `2 c* l; a, A6 n [8 Q - yum-metadata-parser-1.1.2-3.el5.centos
! w: c, O: c. E' C - yum-3.2.22-33.el5.centos+ ?# p, |7 n7 V* c4 _
- yum-fastestmirror-1.1.16-14.el5.centos.16 h. m8 `6 c. E- Q, i9 N: d q
- yum-updatesd-0.9-2.el5
銴鋆賭誨蝣 2 ~+ ?: c! V7 m' _
#蝘駁巾um憒閬敹賜亦訾抒憿,臭蝙 --nodeps 賊
f p8 y4 M: U- L8 D- [root@localhost ~]# rpm -e yum-metadata-parser-1.1.2-3.el5.centos) P1 u- Y1 J- G5 b2 l( t9 p
- [root@localhost ~]# rpm -e yum-3.2.22-33.el5.centos
% d" M1 L) _9 A) V4 t$ G - [root@localhost ~]# rpm -e yum-fastestmirror-1.1.16-14.el5.centos.16 E3 ^4 r- _6 L9 d
- [root@localhost ~]# rpm -e yum-updatesd-0.9-2.el5
銴鋆賭誨蝣
9 v7 Q! R9 I" t3 z* `; N鈭摰鋆yum
, H2 _3 E3 y6 U* j1.摰鋆皞0 w' d' D& E: P6 M# k- b+ Z/ y
典鋆皞其遢臭誑唬誑銝蝬脣亦8 x3 a* H1 H+ ]1 i0 J
隢靘芾閬曉啣鋆皞
# @5 G- I! V% D: C" ~" W; V, mi386 :
' ?8 X5 r& v& Ahttp://mirrors.sohu.com/centos/5/os/i386/CentOS/
1 E$ U" ^; ^3 l" phttp://mirror.centos.org/centos-5/5/os/i386/CentOS/
7 D, f) Z! y: F( S8 J+ a' W3 ]( G/ g0 {) G: ?8 U% o
x86_64 :
' d/ N; ~) n hhttp://mirrors.sohu.com/centos/5/os/x86_64/CentOS/
$ V4 ~& g, ~; a: Dhttp://mirror.centos.org/centos-5/5/os/x86_64/CentOS/# ?# {. p6 g; t% H6 O
# T+ q" _) ]! P
* K: E8 V. ^; u3 v, }肘um其遢銝餉臭蝙典唬誑銝4瑼
2 P! o- e* y- s8 O; M7 Byum-metadata-parser-1.1.2-3.el5.centos.i386.rpm / c+ ~" n1 I2 L* V& a, q! C1 S
yum-fastestmirror-1.1.16-16.el5.centos.noarch.rpm
! S4 c# x3 o: l) G0 j5 c% J1 h! X i/ S3 Ayum-3.2.22-37.el5.centos.noarch.rpm
# x3 k0 X1 q6 b' {( Z$ oyum-updatesd-0.9-2.el5.noarch.rpm
, G J w: O5 M2 }
& J# K0 W% P. G9 G. z$ g" _( l7 ^2摰鋆yum3 a- o0 t/ F# D' \
i386
) x$ E! E2 ^1 T; ~% 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
, t8 U& F; P: H# i l; o6 q4 A- b - [root@localhost ~]# rpm -qa |grep yum
, T' W Q- V: z5 r% Y - yum-updatesd-0.9-2.el5
6 [4 z3 c) h+ S: B/ c - yum-metadata-parser-1.1.2-3.el5.centos
: G: J' `2 N: W/ q/ Z1 E - yum-fastestmirror-1.1.16-16.el5.centos
5 m1 C" f) _* d7 Y1 G' Z. K - yum-3.2.22-37.el5.centos
銴鋆賭誨蝣
, Y+ ]* C( V+ N7 K8 {0 { Cx86_64
1 l) F8 {1 G3 ^! c- [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 i* h% u; S/ V
- [root@localhost ~]# rpm -qa |grep yum, h {1 ]6 v {/ p# l5 j/ n
- yum-updatesd-0.9-2.el5
2 U: U6 T! s( r, l# p - yum-metadata-parser-1.1.2-3.el5.centos5 p1 [2 V$ U% T( \" i
- yum-fastestmirror-1.1.16-16.el5.centos
2 K G. y u/ `/ r- B, Y - yum-3.2.22-37.el5.centos
銴鋆賭誨蝣
4 u- h @. Y! ?! K. g& k2.2湔唳撌脣鋆憟隞(靘鈭粹瘙臬行湔)
( W* u6 q0 k6 V2 ?1 ^- [root@localhost ~]# yum -y update
銴鋆賭誨蝣 % x- ]. o r, |! S
銝yum隞方牧' S, r4 N+ g0 E' u% n3 T- v' }
其蝙肘um嚗撠銝頛梯正嚗摮曉/var/cache/yum桅銝
+ H% a T) i7 W6 W1.yum湔
/ A. N' ]5 b3 p$ D8 T( I; d B/ O. @) `yum check-update
, S: v. W+ n, ]. Z9 Y#瑼X亥賣湔啁憟隞嗆鈭3 q8 R1 q- q' w/ W R5 V( E9 r
5 z' x4 H2 I1 V5 {) g" ?7 cyum update ' |1 {% v8 Z. n' E
#湔唳撌脣鋆憟隞塚亙罕pdate敺X乩憟隞嗅蝔梁閰勗舫撠閰脣隞嗆湔
; ]% L9 ~( T* R$ u% R/ U& t憒yum update httpd; q/ _. z; f4 A/ ~; T
+ {# T3 [* N) u
yum upgrade& ^0 O& Z: c- q6 L4 S
#質update撌桐憭嚗撌桀亙冽慶um upgrade銝鈭喳瘣格掠憟隞嗡銝韏瑟湔堆憭批雿輻典函砍蝝
* T. ]6 ]9 L! A' {! |
! T h1 Z0 n$ G7 @: X1.1摰鋆.蝘駁文隞
; ?( C0 z9 M: s' x6 R# ]* h% ayum install
* i4 s e/ U7 F1 R. t#摰鋆憟隞塚install敺X亥摰鋆憟隞嗅蝔梧憒yum install httpd亥賊銝韏瑕鋆閰勗臬冽敺銝*憒yum install httpd*
# [3 f; W; d, z: t* s6 {+ e! F0 g
0 X7 n; f* l' T5 jyum --enablerepo=(Repository) install 摰鋆芯蝙冽憟隞嗅澈,憒憭,銋臭誑,亦/etc/yum.repos.d/鈭.repo4 k8 N# H" L4 n" q( l9 V6 C5 c0 d8 |
憒yum --enablerepo remi,remi-php55 install php
- Z$ `2 _- H* J
7 Q0 ~& Q8 C% B7 k# [yum reinstall啣鋆憟隞
' S5 F! Z5 K- h
; b, L7 f; E c0 s1 U, J/ W& Z" oyum remove7 d, W, a- G: ?- _1 n' |' S3 k3 B
#蝘駁文隞,券桀啁訾抒憿嚗臭誑yum deplist 曉箸訾憟隞,銝銝蝘駁支閬憟隞,頝喲閬靽憟隞,憒祉典隞(蝝憟隞嗅航賣典) " y- B: \5 |6 Z, R) C$ k; ]: a
3 `. Q8 q' q5 u/ _
靘憒:; V; R$ l/ v3 }* I- W9 R# n; {& l# ?
yum deplist httpd | grep -v httpd | grep provider | awk '{print $2}' | sort -u# D' T) t8 a* Z, A% ?: A
remove敺舀亥蝘駁文隞嗅蝔梧憒yum remove httpd亥賊憟隞嗡銝韏瑞宏斤閰勗臬冽敺銝*憒yum remove httpd*) S5 _9 g& k; G( H
. j( ^, r1 e! k' U
yum clean+ P) g$ n: e3 a2 s7 e& \: o! a
#皜文鋆銝頛怠憟隞嗅憪瑼嚗憭批臬曉/var/cache/yum嚗撣豢銝yum clean packages砰um clean all嚗銝甈∪典芷扎
D0 W/ ?4 K" L7 q7 t1 r- D) U& M0 m+ U2 `( O- i: w# M, z
1.2皜怠1 h. _; p6 }6 L* E8 w) g
yum clean
6 |: u9 j- f- s) {- q9 ^ q#皜文鋆銝頛怠隞嗅憪瑼嚗憭批臬曉/var/cache/yum6 h4 ^" D( g. C8 `$ x# v; b
, n1 \, V7 M2 V$ g
yum clean packages
! I3 a3 h9 H: b Q#其皜斗怠(/var/cache/yum)桅銝憟隞" y' h/ U( l3 n5 H
4 A! s- f W- Z5 Y
yum clean headers) e. q0 ^, ?4 b9 k8 m
#其皜斗怠(/var/cache/yum)桅銝 headers' B0 B9 t) F2 B% f2 p0 e* {
0 s! q4 X, Q" Y5 T. Ayum clean oldheaders6 x7 s: y6 R9 V1 b) [) R2 \
#其皜斗怠(/var/cache/yum)桅銝 oldheaders $ @1 O/ e I! B. x7 N
! F6 c7 J a1 O: O" c/ Gyum clearn all
; I+ z8 t' _4 ^# ?+ j#湔交怠賭甈⊥扎# P9 x" t% I: a( Q1 {
" C' Z2 k& _1 [; |! D1.3皜
' E4 q/ k# u! H* @$ J7 Gyum list
( w5 B* l# d; k#箸Repository摨憟隞塚亙甸ist敺X亙隞嗅蝔梧臬桃典箄府憟隞嗚" x ~! V( W( p' e! B7 I$ s1 ~! R
& f' A4 c5 e$ g8 ]& c, w7 Y! K
yum list updates* U, k* o: B+ B" B9 p. B2 u m0 O
#箸臭誑湔啁憟隞
2 }; a/ w8 H* [' J X* r0 l* w I. R) ]8 v: J9 t0 ?
yum list installed
3 i# R m/ R1 J#箸撌脩摰鋆憟隞9 g- x- g8 ]' j+ N# i
8 ]4 z6 B5 V+ w# X* l5 ^ F
yum list extra
- V( m( k, p3 O& W% r) @7 K7 m% ^#箸撌脣鋆雿銝 yum Repository摨 抒憟隞) y S8 ]; r7 O' ]# u
% G8 K$ Z5 G. D
1.4箏隞嗥賊鞈閮" S7 N* ~' X5 I$ ?( S* d0 g; X
yum info' b, }6 h3 Y) g2 _) k% s
#箸憟隞嗥賊鞈閮嚗亙甬nfo敺乩憟隞嗅蝔梧臬桃典箄府憟隞嗥賊鞈閮
& ?9 D! g" O+ a. K" @8 R憒yum info httpd yum info httpd*嚗撌桀亙冽潭*隞去ttpd剔賢箔5 X h% _9 ?% Y1 _; ?
% J# ? P/ S8 ]0 b4 B: ?% r
yum info updates
; ^3 F0 t- ?+ m4 a) T' q/ B4 j#箸臭誑湔啁憟隞嗉閮
% Z3 p& o2 w" q2 _! |
2 X8 E4 q* C& {. J! M l0 n; D' Oyum info installed
/ O* S$ ~- a1 |# s9 O- I#箸撌脣鋆憟隞嗉閮
D' i6 E' e- X+ A3 R0 D- R% d: v6 a8 t3 f& ]% S: |
yum info extras
" i1 K0 l5 X3 o4 I$ M- h, F7 S#箸撌脣鋆雿銝 Yum Repository摨 抒憟隞嗉閮
' |, o" f" Y- L! e2 W$ [ d% Y" ~5 o/ Q) E
7 R5 c# D# N$ O( h' r1 ~# C" b
1.5撠
+ L$ c, m1 k# u) L! {yum search
% u) n% F' p$ ^) t& a+ {#撠賊憟隞塚憒yum search httpd嚗典銝剜曉唳閬憟隞嗚憿隡潮萄券8 X' N7 i6 f9 W' j! [# [, g
, ]. L; X9 J% F$ D- q+ i! N8 s4 j
蝝憟隞嗡銝kernel
; K3 Q% k% _* K2 I- B( z& E憒唾肘um靘蝝憟隞塚雿銝喳逃ernel閰晞隢銝W瘜
4 q, _" y* E) O% d% d1 p8 \[root@localhost ~]# vim /etc/yum.conf
h* m- C. P2 S9 j2 ~#沍main]嗡葉乩W銝 I7 P$ s' e$ t
exclude=kernel kernel-source
- E, [; \# F% {0 |. Q) x
, @; y5 C6 b" j, _# R5 N嗉牧yum冽敺憭嚗雿臭砍虜函憭扳撠望臬鋆湔啣蝘駁扎拐蝑典唳亦撠勗臭誑鈭
* X! r% r" [- ^$ m" X2 ]( Z2 ?1 |; v
/ G$ }1 h5 Z! `7 X& b( u
yum撣貉憿臭誑摰蝬脩閫蝑
% n# I5 J1 s- v$ i ohttp://yum.baseurl.org/wiki/Faq4 u$ O4 Q; |' h. I. a
3 S% B0 ^$ ]4 V
* t1 a {+ N! M& Z' h, ]閮: 甇斤 http://ithelp.ithome.com.tw/question/10077313
3 p: l' _$ g5 ~, M* Z: {/ S; A i9 U; D# O0 R6 H+ U
4 {+ O$ f# b% n/ T& d
" d5 l$ A' |8 ]$ E5 A( m" t/ F
+ @8 T% b- F% o ~
( g6 T' S2 G4 j, ~1 s J% S' n
; y8 z' k Y1 l& t9 W, v" |4 L1 q6 _6 L
% `# }" I5 }. I3 L/ i |
|