Repositories
-----------------------------

1. file in /etc/yum.repos.d/*.repo

2. server1.repo

[Server1]
name=Red Hat Enterprise Linux 5Server - Server1
baseurl=ftp://192.168.0.254/pub/RHEL5/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release


[repo-name]
name = a nice description
baseurl = [http, ftp] 不支援nfs
enabled = [0, 1] 1: 表示啟用 0: 關閉, 若此行不寫, 預設: 1
gpgcheck =1 檢查rpm的gpg


3. cached in /var/cache/yum/*

#yum clean [dbcache| all]
清除暫存檔案

[root@server1 yum]# yum clean all
Loading "security" plugin
Loading "rhnplugin" plugin
Cleaning up Everything

#yum list
重新下載放在/var/cache/yum/*
[root@server1 yum]# ll *

Server1:
total 6376
-rw-r--r-- 1 root root 0 Jul 10 00:26 cachecookie
drwxr-xr-x 2 root root 4096 Jul 10 00:26 packages
-rw-r--r-- 1 root root 725830 Jul 10 00:26 primary.xml.gz
-rw-r--r-- 1 root root 5753856 Jul 10 00:26 primary.xml.gz.sqlite
-rw-r--r-- 1 root root 1314 Jul 10 00:26 repomd.xml
---略---

4. rpm in /var/lib/rpm/*

[root@server1 rpm]# ll
total 31956
-rw-r--r-- 1 rpm rpm 2777088 Jul 8 20:45 Basenames
-rw-r--r-- 1 rpm rpm 12288 Jul 8 20:45 Conflictname
-rw-r--r-- 1 root root 24576 Jul 9 23:57 __db.001
-rw-r--r-- 1 root root 1318912 Jul 9 23:57 __db.002
-rw-r--r-- 1 root root 450560 Jul 9 23:57 __db.003
-rw-r--r-- 1 rpm rpm 1171456 Jul 8 20:45 Dirnames
-rw-r--r-- 1 rpm rpm 5160960 Jul 8 20:45 Filemd5s
-rw-r--r-- 1 rpm rpm 24576 Jul 8 20:45 Group
-rw-r--r-- 1 rpm rpm 20480 Jul 8 20:45 Installtid
-rw-r--r-- 1 rpm rpm 40960 Jul 8 20:45 Name
-rw-r--r-- 1 rpm rpm 22953984 Jul 8 20:45 Packages
-rw-r--r-- 1 rpm rpm 167936 Jul 8 20:45 Providename
-rw-r--r-- 1 rpm rpm 90112 Jul 8 20:45 Provideversion
-rw-r--r-- 1 rpm rpm 12288 Jul 6 23:17 Pubkeys
-rw-r--r-- 1 rpm rpm 233472 Jul 8 20:45 Requirename
-rw-r--r-- 1 rpm rpm 163840 Jul 8 20:45 Requireversion
-rw-r--r-- 1 rpm rpm 90112 Jul 8 20:45 Sha1header
-rw-r--r-- 1 rpm rpm 45056 Jul 8 20:45 Sigmd5
-rw-r--r-- 1 rpm rpm 12288 Jul 8 20:45 Triggername

A-B-C.D.E
zsh-4.2.6-1.i386.rpm

A:套件名稱
B:版本
C:發行次數
D:平台(i386, noarch(不分平台), x86, ppc....., etc)
E: rpm

%安裝套件以yum進行安裝, 會主動安裝相依套件, 若用rpm安裝, 則要自行將相依套件先裝好(要拜訪各山頭去下載rpm)


5. rpm

#rpm -qa

[root@server1 Server]# rpm -qa|grep dhcp
dhcpv6-client-1.0.10-4.el5
dhcp-3.0.5-13.el5

#rpm -q [package]

[root@server1 Server]# rpm -q dhcp
dhcp-3.0.5-13.el5

#rpm -qf file_path_name(絕對路徑)

[root@server1 Server]# rpm -qf /etc/dhcpd.conf
dhcp-3.0.5-13.el5

#rpm -qp rpmfile(不常使用, 因為要打rpm的全部名稱..)

#rpm -ql [package] ----list of files in package

[root@server1 Server]# rpm -ql dhcp
/etc/dhcpd.conf
/etc/rc.d/init.d/dhcpd
/etc/rc.d/init.d/dhcrelay
/etc/sysconfig/dhcpd
/etc/sysconfig/dhcrelay
/usr/bin/omshell
---略---

#rpm -V [package]

[root@server1 Server]# rpm -V dhcp
S.5....T c /etc/dhcpd.conf


from the package header, followed by the file name. Each of the 8
characters denotes the result of a comparison of attribute(s) of the
file to the value of those attribute(s) recorded in the database. A
single "." (period) means the test passed, while a single "?" (question
mark) indicates the test could not be performed (e.g. file permissions
prevent reading). Otherwise, the (mnemonically emBoldened) character
denotes failure of the corresponding --verify test:

S file Size differs
M Mode differs (includes permissions and file type)
5 MD5 sum differs
D Device major/minor number mismatch
L readLink(2) path mismatch
U User ownership differs
G Group ownership differs
T mTime differs

6. Kernel rpm

% Do not user rpm -U or rpm -F!!!!
% Use rpm -i

change default
# vi /boot/grub/grup.conf

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-92.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-92.el5
module /vmlinuz-2.6.18-92.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
module /initrd-2.6.18-92.el5xen.img
title Red Hat Enterprise Linux Server (2.6.18-92.el5PAE)
root (hd0,0)
kernel /vmlinuz-2.6.18-92.el5PAE ro root=/dev/VolGroup00/LogVol00 rhgb quiet
---略---


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 aquatower 的頭像
    aquatower

    2006隨手札記

    aquatower 發表在 痞客邦 留言(0) 人氣()