RPM是 RedHat 公司开发的软件包工具,本文重点介绍RPM包的使用和管理方法。
rpm -ivh packagename-1.0.0-kll.i386.rpm
rpm -Uvh packagename-1.0.0-kll.i386.rpm
rpm -Fvh packagename-1.0.0-kll.i386.rpm
rpm --replacepkgs -ivh packagename-1.0.0-kll.i386.rpm
rpm -ivh --aid packagename-1.0.0-kll.i386.rpm
Need install package rpmdb-redhat, xsane and sane-backends to use this option.
rpm -ivh --prefix=/opt/usr xxx.rpm
有些软件包还会在/etc目录写文件,也可以将文件改到/usr/etc目录,如下所示:
rpm xxx.rpm --relocate=/usr=/opt/usr --relocate=/etc=/usr/etc
rpm -e packagename rpm -e packagename-version
rpm -q packagename
rpm -qi packagename
rpm -qip packagename-1.0.0-kll.i386.rpm
rpm -qf /path/to/file
rpm -ql packagename
rpm -qlp packagename-1.0.0-i386.rpm
rpm -qa
rpm -qa --queryformat "%-20{name} \t %20{size}\n"
rpm -q --queryformat "%{name} \t %{summary}\n" bash
rpm -V packagename
Report if package contents, time stamps, checksums have changed. Important flags include:
S File Size M Permissions/Filetype 5 MD5 Sum U Ownership T Time stamp
rpm -Va
rpm -qR packagename
rpm -q --provides packagename。
Rebuild the RPM database
rpm --rebuilddb
rpmbuild --rebuild packagename-1.0.0-kll.src.rpm
rpm --rebuild packagename-1.0.0-kll.src.rpm
rpmbuild --rebuild --target=athlon packagename-1.0.0-kll.src.rpm
Target could i686 or ppc and etc.
rpm -i packagename-1.0.0-kll.src.rpm
rpmbuild -ba packagename.spec
rpmbuild -bb packagename.spec
安装源软件包通常用于研究或修改,相关文件安装到/usr/src/redhat的子目录中。
rpm -Uvh packagename-1.0.0-1.src.rpm
直接用SPEC文件编译出新的源软件包。
rpmbuild -bs /usr/src/redhat/SPECS/packagename.spec
再次从源软件包中编译出RPM包。
rpmbuild --rebuild --target i686 /usr/src/redhat/SRPMS/packagename-1.0.0.src.rpm
Comments
There are currently no comments
New Comment