Rpm: Difference between revisions

From DWIKI
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{| style="width:600px;" border="0"
=Links=
| colspan="2" | '''Usefull links'''
*[http://www.rpm.org/ rpm.org] The RPM Homepage]
|-
*[http://www.rpm.org/max-rpm/ Maximum RPM -- Taking the Red Hat Package Manager to the Limit]
| [http://www.rpm.org/ rpm.org] || The RPM Homepage
*https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch04s04.html
|-
 
| [http://www.rpm.org/max-rpm/ http://www.rpm.org/max-rpm/] || Maximum RPM -- Taking the Red Hat Package Manager to the Limit
 
|}
 
= command line tips =
== building RPMs ==
get the total size used by rpm packages:
 
When you want to build rpm's make sure you '''~/.rpmmacros''' file is more or less sane:
 
'''Example'''
  %packager      J Doe <johndoe@example.tv>
  %vendor        HomeMade
  %_topdir        /home/jdoe/rpmbuild
  %_tmppath      /home/jdoe/rpmbuild/tmp
  %debug_package  %{nil}
 
And the correct directories have to exist:
 
  ${HOME}/rpmbuild/
  ${HOME}/rpmbuild/RPMS
  ${HOME}/rpmbuild/RPMS/i686
  ${HOME}/rpmbuild/RPMS/i586
  ${HOME}/rpmbuild/RPMS/athlon
  ${HOME}/rpmbuild/RPMS/i486
  ${HOME}/rpmbuild/RPMS/i386
  ${HOME}/rpmbuild/RPMS/noarch
  ${HOME}/rpmbuild/tmp
  ${HOME}/rpmbuild/BUILD
  ${HOME}/rpmbuild/SPECS
  ${HOME}/rpmbuild/SRPMS
  ${HOME}/rpmbuild/SOURCES
 
[[Category:rpm]]
 
=FAQ=
==List installed packages names only==
rpm -qa --qf "%{NAME}\n"
 
 
==Extract files from rpm file==
rpm2cpio file.rpm | cpio -idmv
 
==List files in package==
rpm -ql packagename
 
==What packages depend on this one?==
rpm -q --whatrequires packagename
 
==What dependencies does this package have?==
yum deplist packagename
 
==get the total size used by rpm packages:==
   rpm -qa --queryformat "%{SIZE}\n" | awk '{arg += $1} END{ printf "%d Mb\n", arg / 1048576 }'
   rpm -qa --queryformat "%{SIZE}\n" | awk '{arg += $1} END{ printf "%d Mb\n", arg / 1048576 }'


verify all the installed packages:
==verify all the installed packages==
   rpm -Va
   rpm -Va


what package does (e.g.) the '''nslookup''' command belong to?
==what package does (e.g.) the '''nslookup''' command belong to?==
   rpm -qf `which nslookup`
   rpm -qf `which nslookup`
[[Category:rpm]]

Latest revision as of 14:44, 20 March 2023

Links


building RPMs

When you want to build rpm's make sure you ~/.rpmmacros file is more or less sane:

Example

 %packager       J Doe <johndoe@example.tv>
 %vendor         HomeMade
 %_topdir        /home/jdoe/rpmbuild
 %_tmppath       /home/jdoe/rpmbuild/tmp
 %debug_package  %{nil}

And the correct directories have to exist:

 ${HOME}/rpmbuild/
 ${HOME}/rpmbuild/RPMS
 ${HOME}/rpmbuild/RPMS/i686
 ${HOME}/rpmbuild/RPMS/i586
 ${HOME}/rpmbuild/RPMS/athlon
 ${HOME}/rpmbuild/RPMS/i486
 ${HOME}/rpmbuild/RPMS/i386
 ${HOME}/rpmbuild/RPMS/noarch
 ${HOME}/rpmbuild/tmp
 ${HOME}/rpmbuild/BUILD
 ${HOME}/rpmbuild/SPECS
 ${HOME}/rpmbuild/SRPMS
 ${HOME}/rpmbuild/SOURCES

FAQ

List installed packages names only

rpm -qa --qf "%{NAME}\n"


Extract files from rpm file

rpm2cpio file.rpm | cpio -idmv

List files in package

rpm -ql packagename

What packages depend on this one?

rpm -q --whatrequires packagename

What dependencies does this package have?

yum deplist packagename

get the total size used by rpm packages:

 rpm -qa --queryformat "%{SIZE}\n" | awk '{arg += $1} END{ printf "%d Mb\n", arg / 1048576 }'

verify all the installed packages

 rpm -Va

what package does (e.g.) the nslookup command belong to?

 rpm -qf `which nslookup`