linux - chuleta comandos rpm

Upload: locuto

Post on 14-Apr-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/30/2019 Linux - Chuleta Comandos RPM

    1/1

    stall an RPM Package

    p a c k a g e s h a v e f i l e n a m i n g c o n v e n t i o n s l i k e f o o - 2 . 0 - 4 . i 3 8 6 . r p m , w h i c h i n c l u d e

    p a c k a g e n a m e ( f o o ) , v e r s i o n ( 2 . 0 ) , r e l e a s e ( 4 ) , a n d a r c h i t e c t u r e ( i 3 8 6 ) . A l s o n o t i c e

    R P M u n d e r s t a n d s F T P a n d H T T P p r o t o c o l s f o r i n s t a l l i n g a n d q u e r y i n g r e m o t e

    f i l e s .

    - i v h f o o - 2 . 0 - 4 . i 3 8 6 . r p m

    - i f t p : / / f t p . r e d h a t . c o m / p u b / r e d h a t / R P M S / f o o - 1 . 0 - 1 . i 3 8 6 . r p m

    - i h t t p : / / o s s . o r a c l e . c o m / p r o j e c t s / f i r e w i r e / d i s t / f i l e s / k e r n e l - 2 . 4 . 2 0 - 1 8 . 1 0 . 1 . i 6 8 6 . r p m

    n-install an RPM Package

    n - i n s t a l l a n R P M p a c k a g e , w e u s e t h e p a c k a g e n a m e f o o , n o t t h e n a m e o f t h e

    i n a l p a c k a g e f i l e f o o - 2 . 0 - 4 . i 3 8 6 . r p m a b o v e .

    - e f o o

    pgrade an RPM Package

    p g r a d e a n R P M p a c k a g e , R P M a u t o m a t i c a l l y u n - i n s t a l l s t h e o l d v e r s i o n o f t h e f o o

    k a g e a n d i n s t a l l s t h e n e w p a c k a g e . I t i s s a f e t o a l w a y s u s e r p m - U v h t o i n s t a l l a n d

    r a d e p a c k a g e s , s i n c e i t w o r k s f i n e e v e n w h e n t h e r e a r e n o p r e v i o u s v e r s i o n s o f

    p a c k a g e i n s t a l l e d ! A l s o n o t i c e t h a t R P M u n d e r s t a n d s F T P a n d H T T P p r o t o c o l s f o r

    r a d i n g f r o m r e m o t e R P M f i l e s .

    - U v h f o o - 1 . 0 - 2 . i 3 8 6 . r p m

    - U v h f t p : / / f t p . r e d h a t . c o m / p u b / r e d h a t / R P M S / f o o - 1 . 0 - 1 . i 3 8 6 . r p m

    - U v h h t t p : / / o s s . o r a c l e . c o m / p r o j e c t s / f i r e w i r e / d i s t / f i l e s / k e r n e l - 2 . 4 . 2 0 -

    0 . 1 . i 6 8 6 . r p m

    uery all Installed Packages

    R P M t o p r i n t t h e n a m e s o f a l l i n s t a l l e d p a c k a g e s i n s t a l l e d o n y o u r L i n u x s y s t e m .

    - q a

    uery an RPM Package

    r y i n g a n R P M p a c k a g e w i l l p r i n t t h e p a c k a g e n a m e , v e r s i o n , a n d r e l e a s e n u m b e r

    e p a c k a g e f o o o n l y i f i t i s i n s t a l l e d . U s e t h i s c o m m a n d t o v e r i f y t h a t a p a c k a g e i s

    n o t i n s t a l l e d o n y o u r L i n u x s y s t e m .

    - q f o o

    splay Package Information

    c a n d i s p l a y p a c k a g e i n f o r m a t i o n i n c l u d i n g t h e p a c k a g e n a m e , v e r s i o n , a n d

    c r i p t i o n o f t h e i n s t a l l e d p r o g r a m . U s e t h i s c o m m a n d t o g e t d e t a i l e d i n f o r m a t i o n

    u t t h e i n s t a l l e d p a c k a g e .

    - q i f o o

    st Files in Installed Package

    f o l l o w i n g c o m m a n d w i l l l i s t a l l o f f i l e s i n a n i n s t a l l e d R P M p a c k a g e . I t w o r k s o n l y

    n t h e p a c k a g e i s a l r e a d y i n s t a l l e d o n y o u r L i n u x s y s t e m .

    - q l f o o

    hich package owns a file?

    t h e f o l l o w i n g c o m m a n d t o d e t e r m i n e w h i c h i n s t a l l e d p a c k a g e a p a r t i c u l a r f i l e

    n g s t o .

    - q f / u s r / b i n / m y s q l

    e x a m p l e :

    m - q f / u s r / b i n / m y s q l

    q l - 3 . 2 3 . 5 2 - 3

    st Files in RPM File

    R P M t o q u e r y a ( p o s s i b l y ) u n - i n s t a l l e d R P M f i l e w i t h t h e u s e o f t h e t h e " - p " o p t i o n .

    Y o u c a n u s e t h e " - p " o p t i o n t o o p e r a t e o n a n R P M f i l e w i t h o u t a c t u a l l y

    i n s t a l l i n g a n y t h i n g . T h i s c o m m a n d l i s t s a l l f i l e s i n a n R P M f i l e y o u h a v e i n

    t h e c u r r e n t d i r e c t o r y . A l s o n o t e t h a t R P M c a n q u e r y r e m o t e f i l e s t h r o u g h t h e

    F T P a n d H T T P p r o t o c o l s .

    r p m - q p l k e r n e l - 2 . 4 . 2 0 - 1 8 . 1 0 . 1 . i 6 8 6 . r p m

    r p m - q p l f t p : / / f t p . r e d h a t . c o m / p u b / r e d h a t / R P M S / f o o - 1 . 0 - 1 . i 3 8 6 . r p m

    r p m - q p l h t t p : / / o s s . o r a c l e . c o m / p r o j e c t s / f i r e w i r e / d i s t / f i l e s / k e r n e l - 2 . 4 . 2 0 -

    1 8 . 1 0 . 1 . i 6 8 6 . r p m

    Verify an Installed Package

    U s e R P M t o l i s t a l l f i l e s t h a t d o N O T p a s s t h e v e r i f y t e s t s ( d o n e o n s i z e ,

    M D 5 s i g n a t u r e , e t c ) .

    r p m - - v e r i f y m y s q l

    W h e r e a f i l e d o e s N O T p a s s , t h e o u t p u t i s l i s t e d u s i n g t h e f o l l o w i n g c o d e s

    t h a t s i g n i f y w h a t f a i l e d :

    S F i l e s i z e

    M M o d e ( i n c l u d e s p e r m i s s i o n s a n d f i l e t y p e )

    5 M D 5 s u m

    L S y m l i n k

    D D e v i c e

    U U s e r

    G G r o u p

    T M t i m e

    T a k e f o r e x a m p l e t h e f o l l o w i n g :

    # r p m - - v e r i f y m y s q l

    S . 5 . . . . T c / e t c / m y . c n f

    T h i s e x a m p l e i n d i c a t e s t h a t f i l e / e t c / m y . c n f f a i l e d o n :

    F i l e s i z e

    M D 5 S u m

    M o d i f i e d T i m e

    H o w e v e r , t h e " c " t e l l s u s t h i s i s a c o n f i g u r a t i o n f i l e s o t h a t e x p l a i n s t h e

    c h a n g e s . I t s h o u l d s t i l l b e l o o k e d a t t o d e t e r m i n e w h a t t h e c h a n g e s w e r e .

    C h e c k a n R P M S i g n a t u r e P a c k a g e

    R P M c a n b e u s e d t o c h e c k t h e P G P s i g n a t u r e o f s p e c i f i e d p a c k a g e s t o

    e n s u r e i t s i n t e g r i t y a n d o r i g i n . A l w a y s u s e t h i s c o m m a n d f i r s t b e f o r e

    i n s t a l l i n g a n e w R P M p a c k a g e o n y o u r s y s t e m . A l s o , G n u P G o r P g p

    s o f t w a r e m u s t b e a l r e a d y i n s t a l l e d o n y o u r s y s t e m b e f o r e y o u c a n u s e t h i s

    c o m m a n d .

    r p m - - c h e c k s i g f o o