SlideShare uma empresa Scribd logo
1 de 2
RPM Cheat Sheet

Installation: rpm -ihv <package name>          rpmbuild -ba - build binary and source rpms
Upgrade: rpm -Uhv <package name>               rpmbuild -bb - build binary rpm
Freshen: rpm -Fhv <package names>              rpmbuild -bs - build source rpm
Erase: rpm -e <package name>                   rpmbuild --rebuild package.src.rpm - binary package 4m src

Query: rpm -q[option] <package name>                       RPM Divided into sections
        -qi = Query Package Information                    %description
        -ql = List Package Files                           %prep
        -qf = Query which package a file belongs           %build
to.                                                        %install
                                                           %files

.deb: Debian, Ubuntu and derived                   .rpm: RedHat, Fedora, SuSE, Mandriva
rpm -V[option] <package name> : Compare information about installed package files with information
stored in rpm database and note any discrepancies.
Example

%define name nano
%define version 2.0.9
%define release 1
Summary : Pico editor clone with enhancements
Name : %{name}
Version : %{version}
Release : %{release}
License : GPL
Group : Applications/Editors
URL : http://www.nano-editor.org/
Source : http://www.nano-editor.org/dist/v2.0/%{name}-%
{version}.tar.gz
BuildRoot : %{_tmppath}/%{name}-%{version}-root
BuildRequires : autoconf, automake, gettext-devel, ncursesdevel
%description
GNU nano is a small and friendly text editor. It aims to
emulate the Pico text editor while also offering a few
enhancements.
%prep
%setup -q
%build
%configure --enable-all
make
%install
rm -rf %{buildroot}
make DESTDIR="%{buildroot}" install
%files
%defattr(-,root,root)
%doc AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README THANKS
Stage      Reads             Writes                                Action
%prep    %_sourcedir      %_builddir       This reads the sources and patches in the source
                                           directory %_sourcedir (usually ~/rpmbuild/SOURCES).
                                           It unpackages the sources to a subdirectory underneath
                                           the build directory %_builddir (usually
                                           ~/rpmbuild/BUILD/) and applies the patches.
%build   %_builddir       %_builddir       This compiles the files underneath the build
                                           directory %_builddir (usually ~/rpmbuild/BUILD/). This
                                           is often implemented by running some variation of
                                           "./configure ; make".
%check   %_builddir       %_builddir       Check that the software works properly. This is often
                                           implemented by running some variation of "make test".
                                           Many packages don't implement this stage.
%install %_builddir       %_buildrootdir   This reads the files underneath the build
                                           directory %_builddir (usually ~/rpmbuild/BUILD/) and
                                           writes to a directory underneath the build root
                                           directory %_buildrootdir (usually
                                           ~/rpmbuild/BUILDROOT). The files that are written are
                                           the files that are supposed to be installed when the binary
                                           package is installed by an end-user. Beware of the weird
                                           terminology: The build root directory is not the same as
                                           the build directory. This is often implemented by running
                                           "make install".
bin      %_buildrootdir   %_rpmdir         This reads the files underneath the build root
                                           directory %_buildrootdir (usually
                                           ~/rpmbuild/BUILDROOT/) to create binary RPM
                                           packages underneath the RPM directory %_rpmdir
                                           (usually ~/rpmbuild/RPMS/). Inside the RPM directory is
                                           a directory for each architecture, and a "noarch" directory
                                           for packages that apply to any architecture. These RPM
                                           files are the packages for users to install.
src      %_sourcedir      %_srcrpmdir      This creates a source RPM package (.src.rpm) inside the
                                           source RPM directory %_srcrpmdir (usually
                                           ~/rpmbuild/SRPMS). These files are needed for
                                           reviewing and updating packages.
Macro Name          Name                 Usually                        Purpose
%_specdir      Specification     ~/rpmbuild/SPECS             RPM specifications (.spec) files
               directory
%_sourcedir    Source            ~/rpmbuild/SOURCES   Pristine source package (e.g.,
               directory                              tarballs) and patches
%_builddir     Build directory   ~/rpmbuild/BUILD     Source files are unpacked and
                                                      compiled in a subdirectory
                                                      underneath this.
%_buildrootdir Build root        ~/rpmbuild/BUILDROOT Files are installed under here
               directory                              during the %install stage.
%_rpmdir       Binary RPM        ~/rpmbuild/RPMS      Binary RPMs are created stored
               directory                              under here.
%_srcrpmdir    Source RPM        ~/rpmbuild/SRPMS     Source RPMs are created and
               directory                              stored here.

Mais conteúdo relacionado

Mais procurados

Hadoop single node setup
Hadoop single node setupHadoop single node setup
Hadoop single node setupMohammad_Tariq
 
General apache command for hadoop
General apache  command for hadoop  General apache  command for hadoop
General apache command for hadoop Saum
 
TP2 Big Data HBase
TP2 Big Data HBaseTP2 Big Data HBase
TP2 Big Data HBaseAmal Abid
 
Thijs Feryn - Leverage HTTP to deliver cacheable websites - Codemotion Milan ...
Thijs Feryn - Leverage HTTP to deliver cacheable websites - Codemotion Milan ...Thijs Feryn - Leverage HTTP to deliver cacheable websites - Codemotion Milan ...
Thijs Feryn - Leverage HTTP to deliver cacheable websites - Codemotion Milan ...Codemotion
 
Asian Spirit 3 Day Dba On Ubl
Asian Spirit 3 Day Dba On UblAsian Spirit 3 Day Dba On Ubl
Asian Spirit 3 Day Dba On Ublnewrforce
 
Normal File Permissions
Normal File PermissionsNormal File Permissions
Normal File PermissionsRon Bandes
 
Apache2 BootCamp : Getting Started With Apache
Apache2 BootCamp : Getting Started With ApacheApache2 BootCamp : Getting Started With Apache
Apache2 BootCamp : Getting Started With ApacheWildan Maulana
 
Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011
Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011
Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011camp_drupal_ua
 

Mais procurados (16)

Run wordcount job (hadoop)
Run wordcount job (hadoop)Run wordcount job (hadoop)
Run wordcount job (hadoop)
 
Hadoop single node setup
Hadoop single node setupHadoop single node setup
Hadoop single node setup
 
General apache command for hadoop
General apache  command for hadoop  General apache  command for hadoop
General apache command for hadoop
 
TP2 Big Data HBase
TP2 Big Data HBaseTP2 Big Data HBase
TP2 Big Data HBase
 
Thijs Feryn - Leverage HTTP to deliver cacheable websites - Codemotion Milan ...
Thijs Feryn - Leverage HTTP to deliver cacheable websites - Codemotion Milan ...Thijs Feryn - Leverage HTTP to deliver cacheable websites - Codemotion Milan ...
Thijs Feryn - Leverage HTTP to deliver cacheable websites - Codemotion Milan ...
 
Ppt
PptPpt
Ppt
 
Asian Spirit 3 Day Dba On Ubl
Asian Spirit 3 Day Dba On UblAsian Spirit 3 Day Dba On Ubl
Asian Spirit 3 Day Dba On Ubl
 
Normal File Permissions
Normal File PermissionsNormal File Permissions
Normal File Permissions
 
Distribuido
DistribuidoDistribuido
Distribuido
 
Chef
ChefChef
Chef
 
Hadoop 2.4 installing on ubuntu 14.04
Hadoop 2.4 installing on ubuntu 14.04Hadoop 2.4 installing on ubuntu 14.04
Hadoop 2.4 installing on ubuntu 14.04
 
2 db2 instance creation
2 db2 instance creation2 db2 instance creation
2 db2 instance creation
 
Refcard en-a4
Refcard en-a4Refcard en-a4
Refcard en-a4
 
Apache2 BootCamp : Getting Started With Apache
Apache2 BootCamp : Getting Started With ApacheApache2 BootCamp : Getting Started With Apache
Apache2 BootCamp : Getting Started With Apache
 
Shark - Lab Assignment
Shark - Lab AssignmentShark - Lab Assignment
Shark - Lab Assignment
 
Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011
Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011
Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011
 

Semelhante a RPM Cheat Sheet: A Concise Guide to Red Hat Package Manager Commands and Concepts

Bundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPMBundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPMAlexander Shopov
 
OpenWRT guide and memo
OpenWRT guide and memoOpenWRT guide and memo
OpenWRT guide and memo家榮 吳
 
Linux basic for CADD biologist
Linux basic for CADD biologistLinux basic for CADD biologist
Linux basic for CADD biologistAjay Murali
 
Software management in linux
Software management in linuxSoftware management in linux
Software management in linuxnejadmand
 
RPM packaging @OSCAL2014
RPM packaging @OSCAL2014RPM packaging @OSCAL2014
RPM packaging @OSCAL2014floriantani
 
Bringing-it-all-together-overview-of-rpm-packaging-in-fedora
Bringing-it-all-together-overview-of-rpm-packaging-in-fedoraBringing-it-all-together-overview-of-rpm-packaging-in-fedora
Bringing-it-all-together-overview-of-rpm-packaging-in-fedoraLalatendu Mohanty
 
How to make debian package from scratch (linux)
How to make debian package from scratch (linux)How to make debian package from scratch (linux)
How to make debian package from scratch (linux)Thierry Gayet
 
Building a linux kernel
Building a linux kernelBuilding a linux kernel
Building a linux kernelRaghu nath
 
Steps to create an RPM package in Linux
Steps to create an RPM package in LinuxSteps to create an RPM package in Linux
Steps to create an RPM package in LinuxManish Chopra
 
101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package managementAcácio Oliveira
 
Packaging for the Maemo Platform
Packaging for the Maemo PlatformPackaging for the Maemo Platform
Packaging for the Maemo PlatformJeremiah Foster
 
XPDDS18: A dive into kbuild - Cao jin, Fujitsu
XPDDS18: A dive into kbuild - Cao jin, FujitsuXPDDS18: A dive into kbuild - Cao jin, Fujitsu
XPDDS18: A dive into kbuild - Cao jin, FujitsuThe Linux Foundation
 

Semelhante a RPM Cheat Sheet: A Concise Guide to Red Hat Package Manager Commands and Concepts (20)

Bundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPMBundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPM
 
OpenWRT guide and memo
OpenWRT guide and memoOpenWRT guide and memo
OpenWRT guide and memo
 
Linux basic for CADD biologist
Linux basic for CADD biologistLinux basic for CADD biologist
Linux basic for CADD biologist
 
Software management in linux
Software management in linuxSoftware management in linux
Software management in linux
 
RPM packaging @OSCAL2014
RPM packaging @OSCAL2014RPM packaging @OSCAL2014
RPM packaging @OSCAL2014
 
Bringing-it-all-together-overview-of-rpm-packaging-in-fedora
Bringing-it-all-together-overview-of-rpm-packaging-in-fedoraBringing-it-all-together-overview-of-rpm-packaging-in-fedora
Bringing-it-all-together-overview-of-rpm-packaging-in-fedora
 
How to make debian package from scratch (linux)
How to make debian package from scratch (linux)How to make debian package from scratch (linux)
How to make debian package from scratch (linux)
 
Linux shell scripting
Linux shell scriptingLinux shell scripting
Linux shell scripting
 
Building a linux kernel
Building a linux kernelBuilding a linux kernel
Building a linux kernel
 
RPM Packaging 101 (Old)
RPM Packaging 101 (Old)RPM Packaging 101 (Old)
RPM Packaging 101 (Old)
 
C make cache
C make cacheC make cache
C make cache
 
Steps to create an RPM package in Linux
Steps to create an RPM package in LinuxSteps to create an RPM package in Linux
Steps to create an RPM package in Linux
 
$ make install
$ make install$ make install
$ make install
 
101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management
 
Sahul
SahulSahul
Sahul
 
Sahul
SahulSahul
Sahul
 
Bacula - Backup system
Bacula - Backup systemBacula - Backup system
Bacula - Backup system
 
Packaging for the Maemo Platform
Packaging for the Maemo PlatformPackaging for the Maemo Platform
Packaging for the Maemo Platform
 
XPDDS18: A dive into kbuild - Cao jin, Fujitsu
XPDDS18: A dive into kbuild - Cao jin, FujitsuXPDDS18: A dive into kbuild - Cao jin, Fujitsu
XPDDS18: A dive into kbuild - Cao jin, Fujitsu
 
C make cache
C make cacheC make cache
C make cache
 

Mais de Rajesh Kumar

Fundamental of apache maven
Fundamental of apache mavenFundamental of apache maven
Fundamental of apache mavenRajesh Kumar
 
Git and github fundamental
Git and github fundamentalGit and github fundamental
Git and github fundamentalRajesh Kumar
 
Tools for quality matrix and kloc
Tools for quality matrix and klocTools for quality matrix and kloc
Tools for quality matrix and klocRajesh Kumar
 
Testing in a glance
Testing in a glanceTesting in a glance
Testing in a glanceRajesh Kumar
 
Code coverage & tools
Code coverage & toolsCode coverage & tools
Code coverage & toolsRajesh Kumar
 
Scm process assessment guide
Scm process assessment guideScm process assessment guide
Scm process assessment guideRajesh Kumar
 
Branching and Merging Practices
Branching and Merging Practices Branching and Merging Practices
Branching and Merging Practices Rajesh Kumar
 
SCM Process and smartBuild
SCM Process and smartBuildSCM Process and smartBuild
SCM Process and smartBuildRajesh Kumar
 
Version Control With CVS
Version Control With CVSVersion Control With CVS
Version Control With CVSRajesh Kumar
 
Using Ant To Build J2 Ee Applications
Using Ant To Build J2 Ee ApplicationsUsing Ant To Build J2 Ee Applications
Using Ant To Build J2 Ee ApplicationsRajesh Kumar
 
Software Configuration Management And CVS
Software Configuration Management And CVSSoftware Configuration Management And CVS
Software Configuration Management And CVSRajesh Kumar
 
Scm With Mks Integrity
Scm With Mks IntegrityScm With Mks Integrity
Scm With Mks IntegrityRajesh Kumar
 
Introduction To Software Configuration Management
Introduction To Software Configuration ManagementIntroduction To Software Configuration Management
Introduction To Software Configuration ManagementRajesh Kumar
 
Introduction To Ant
Introduction To AntIntroduction To Ant
Introduction To AntRajesh Kumar
 
Introduction To Ant1
Introduction To  Ant1Introduction To  Ant1
Introduction To Ant1Rajesh Kumar
 

Mais de Rajesh Kumar (20)

Fundamental of apache maven
Fundamental of apache mavenFundamental of apache maven
Fundamental of apache maven
 
Git and github fundamental
Git and github fundamentalGit and github fundamental
Git and github fundamental
 
Tools for quality matrix and kloc
Tools for quality matrix and klocTools for quality matrix and kloc
Tools for quality matrix and kloc
 
Cast vs sonar
Cast vs sonarCast vs sonar
Cast vs sonar
 
Cast vs sonar
Cast vs sonarCast vs sonar
Cast vs sonar
 
Testing in a glance
Testing in a glanceTesting in a glance
Testing in a glance
 
Code coverage & tools
Code coverage & toolsCode coverage & tools
Code coverage & tools
 
Scm process assessment guide
Scm process assessment guideScm process assessment guide
Scm process assessment guide
 
Cruise control
Cruise controlCruise control
Cruise control
 
Cloud computer
Cloud computerCloud computer
Cloud computer
 
Branching and Merging Practices
Branching and Merging Practices Branching and Merging Practices
Branching and Merging Practices
 
SCM Process and smartBuild
SCM Process and smartBuildSCM Process and smartBuild
SCM Process and smartBuild
 
Why Scm
Why ScmWhy Scm
Why Scm
 
Version Control With CVS
Version Control With CVSVersion Control With CVS
Version Control With CVS
 
Using Ant To Build J2 Ee Applications
Using Ant To Build J2 Ee ApplicationsUsing Ant To Build J2 Ee Applications
Using Ant To Build J2 Ee Applications
 
Software Configuration Management And CVS
Software Configuration Management And CVSSoftware Configuration Management And CVS
Software Configuration Management And CVS
 
Scm With Mks Integrity
Scm With Mks IntegrityScm With Mks Integrity
Scm With Mks Integrity
 
Introduction To Software Configuration Management
Introduction To Software Configuration ManagementIntroduction To Software Configuration Management
Introduction To Software Configuration Management
 
Introduction To Ant
Introduction To AntIntroduction To Ant
Introduction To Ant
 
Introduction To Ant1
Introduction To  Ant1Introduction To  Ant1
Introduction To Ant1
 

Último

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

RPM Cheat Sheet: A Concise Guide to Red Hat Package Manager Commands and Concepts

  • 1. RPM Cheat Sheet Installation: rpm -ihv <package name> rpmbuild -ba - build binary and source rpms Upgrade: rpm -Uhv <package name> rpmbuild -bb - build binary rpm Freshen: rpm -Fhv <package names> rpmbuild -bs - build source rpm Erase: rpm -e <package name> rpmbuild --rebuild package.src.rpm - binary package 4m src Query: rpm -q[option] <package name> RPM Divided into sections -qi = Query Package Information %description -ql = List Package Files %prep -qf = Query which package a file belongs %build to. %install %files .deb: Debian, Ubuntu and derived .rpm: RedHat, Fedora, SuSE, Mandriva rpm -V[option] <package name> : Compare information about installed package files with information stored in rpm database and note any discrepancies. Example %define name nano %define version 2.0.9 %define release 1 Summary : Pico editor clone with enhancements Name : %{name} Version : %{version} Release : %{release} License : GPL Group : Applications/Editors URL : http://www.nano-editor.org/ Source : http://www.nano-editor.org/dist/v2.0/%{name}-% {version}.tar.gz BuildRoot : %{_tmppath}/%{name}-%{version}-root BuildRequires : autoconf, automake, gettext-devel, ncursesdevel %description GNU nano is a small and friendly text editor. It aims to emulate the Pico text editor while also offering a few enhancements. %prep %setup -q %build %configure --enable-all make %install rm -rf %{buildroot} make DESTDIR="%{buildroot}" install %files %defattr(-,root,root) %doc AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README THANKS
  • 2. Stage Reads Writes Action %prep %_sourcedir %_builddir This reads the sources and patches in the source directory %_sourcedir (usually ~/rpmbuild/SOURCES). It unpackages the sources to a subdirectory underneath the build directory %_builddir (usually ~/rpmbuild/BUILD/) and applies the patches. %build %_builddir %_builddir This compiles the files underneath the build directory %_builddir (usually ~/rpmbuild/BUILD/). This is often implemented by running some variation of "./configure ; make". %check %_builddir %_builddir Check that the software works properly. This is often implemented by running some variation of "make test". Many packages don't implement this stage. %install %_builddir %_buildrootdir This reads the files underneath the build directory %_builddir (usually ~/rpmbuild/BUILD/) and writes to a directory underneath the build root directory %_buildrootdir (usually ~/rpmbuild/BUILDROOT). The files that are written are the files that are supposed to be installed when the binary package is installed by an end-user. Beware of the weird terminology: The build root directory is not the same as the build directory. This is often implemented by running "make install". bin %_buildrootdir %_rpmdir This reads the files underneath the build root directory %_buildrootdir (usually ~/rpmbuild/BUILDROOT/) to create binary RPM packages underneath the RPM directory %_rpmdir (usually ~/rpmbuild/RPMS/). Inside the RPM directory is a directory for each architecture, and a "noarch" directory for packages that apply to any architecture. These RPM files are the packages for users to install. src %_sourcedir %_srcrpmdir This creates a source RPM package (.src.rpm) inside the source RPM directory %_srcrpmdir (usually ~/rpmbuild/SRPMS). These files are needed for reviewing and updating packages. Macro Name Name Usually Purpose %_specdir Specification ~/rpmbuild/SPECS RPM specifications (.spec) files directory %_sourcedir Source ~/rpmbuild/SOURCES Pristine source package (e.g., directory tarballs) and patches %_builddir Build directory ~/rpmbuild/BUILD Source files are unpacked and compiled in a subdirectory underneath this. %_buildrootdir Build root ~/rpmbuild/BUILDROOT Files are installed under here directory during the %install stage. %_rpmdir Binary RPM ~/rpmbuild/RPMS Binary RPMs are created stored directory under here. %_srcrpmdir Source RPM ~/rpmbuild/SRPMS Source RPMs are created and directory stored here.