[[email protected]~]#rpm-ivh/mnt/cdroin/Packages/rpm-build-4.8.0-27.el6.i686.rpm
Preparing...
###################
[100%]
1:rpm-build
###################
[100%]
[[email protected] ~]# rpmbuild [選項] 包全名
選項:
[[email protected] ~]# rpmbuild - rebuild httpd-2.2.15-5.el6.src.rpm
warning: InstallSourcePackage at: psm.c:244: Header V3 RSA/SHA256 Signature, key
ID fd431d51: NOKEY
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
#警告為mockbuild使用者不存在,使用root代替。這裡不是報錯,不用緊張
…省略部分輸出…
Wrote: /root/rpmbuild/RPMS/i386/ httpd-2.2.15-5.el6.i386.rpm
Wrote: /root/rpmbuild/RPMS/i386/httpd-devel-2.2.15-5.el6.i386.rpm
Wrote: /root/rpmbuild/RPMS/noarch/httpd-manual-2.2.15-5.el6.noarch.rpm
Wrote: /root/rpmbuild/RPMS/i386/httpd-tools-2.2.15-5.el6.i386.rpm
Wrote: /root/rpmbuild/RPMS/i386/ mod_ssl-2.2.15-5.el6.i386.rpm
#寫入RPM包的位置,只要看到,就說明編譯成功
Executing(%clean): /bin/sh -e/var/tmp/rpm-tmp.Wb8TKa
+ umask 022
+ cd/root/rpmbuild/BUILD
+ cd httpd-2.2.15
+ rm -rf /root/rpmbuild/BUILDROOT/httpd-2.2.15-5.el6.i386
+ exit 0
Executing(-clean): /bin/sh -e/var/tmp/rpm-tmp.3UBWql
+ umask 022
+ cd/root/rpmbuild/BUILD
+ rm-rf httpd-2.2.15
+ exit 0
[[email protected] ~]# ls /root/rpmbuild/
BUILD RPMS SOURCES SPECS SRPMS
檔名 | 檔案內容 |
---|---|
BUILD | 編譯過程中產生的資料儲存位置 |
RPMS | 編譯成功後,生成的RPM包儲存位置 |
SOURCES | 從SRPM包中解壓出來的原始碼包(*.tar.gz)儲存位置 |
SPECS | 生成的設定檔案的安裝位置。第二種安裝方法就是利用這個檔案進行安裝的 |
SRPMS | 放置SRPM包的位置 |
[[email protected] ~]#ll /root/rpmbuild/RPMS/i386/ 總用量3620
-rw--r--r-- 1 root root 3039035 11月19 06:30 httpd-2.2.15-5.el6.i386.rpm
-rw--r--r-- 1 root root 154371 11月19 06:30 httpd-devel-2.2.15-5.el6.i386.rpm
-rw--r--r-- 1 root root 124403 11月19 06:30 httpd-tools-2.2.15-5.el6.i386.rpm
-rw--r--r-- 1 root root 383539 11月19 06:30 mod_ssl-2.2.15-5.el6.i386.rpm
[[email protected] ~]# rpm -i httpd-2.2.15-5.el6.src.rpm
選項:[[email protected] ~]# rpmbuild -ba/root/rpmbuild/SPECS/httpd.spec
選項:
[[email protected] ~]# vi /etc/inittab
Error detected while processing /root/.vimrc: line 1:
E488: Trailing characters: # set nu
[[email protected] ~]# rpm -qa|grep vim
vim-minimal-7.0.109-3 vim-common-7.0.109-3 vim-enhanced-7.0.109-3
[[email protected] ~]# rpm -ql vim-common|grep example
/usr/share/vim/vim70/gvimrc_example.vim
/usr/share/vim/vim70/macros/urm/examples
/usr/share/vim/vim70/vimrc_example.vim
[[email protected] ~]# head -4 /usr/share/vim/vim70/ vimrc_example.vim
"An example for a vimrc file.
"
"Maintainer:
Bram Moolenaar <[email protected]>
"Last change:
2006 Aug 12
[[email protected] ~]# rm -f/var/lib/rpm/_db.*
其次,重建資料庫。[[email protected] -]# rpm -rebuilddb
這一步需要花費一定的時間來完成。
[[email protected] ~]# rpm -qf/etc/rc.d/init.d/smb
samba-3.0.23c-2
[[email protected] ~]# rpm -ql -dump samba|grep /etc/rc.d/init.d/smb
/etc/rc.d/init.d/smb 2087 1157165946 b1c26e5292157a83cadabe851bf9b2f9 0100755 root root 1 0 0X
[[email protected] ~]# ls -l /etc/rc.d/init.d/smb -rwxr-xr-x 1 root root 2087 Sep 2 2006/etc/rc.d/init.d/smb
[[email protected] ~]# md5sum /etc/rc.d/init.d/smb
b1c26e5292157a83cadabe851bf9b2f9 /etc/rc.d/init.d/smb
[[email protected]~]# rpm -ql --dump -p /mnt/cdrom/Fedora/RPMS/samba-3.0.23c-2.i386.rpm | grep /etc/rc.d/init.d/smb
warning: samba-3.0.23c-2.i386.rpm: Header V3 DSA signature: NOKEY, key ID 412a&62
/etc/rc.d/init.d/smb 2087 1157165946 b1c26e5292157a83cadabe851 bf9b2f9 0100755 root root 1 0 0 X