• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Urban Penguin

The Urban Penguin - Linux Training

  • Home
  • About
  • Programming
    • Master Editing Text Files Using VIM
    • Learn Shell Scripting with BASH
    • PERL Scripting in Linux
    • Ruby Scripting in Linux
    • Scripting with PowerShell
    • Learn C Programming using Linux and the Raspberry Pi
    • General Java Tutorials
    • Java 7 OCA Exam 1ZO-803
  • OS Tutorials
    • Red Hat and CentOS Training
      • Red Hat Enterprise Linux System Administration 1 – RH124
      • RHCSA – System Admin 2 – RH134
      • RHCE – EX294 – Automation With Ansible
    • Learning Ubuntu
    • LPI Training
      • LPI Linux Essentials
      • LPIC-1 Linux Administrator
      • LPIC-2 Certified Linux Engineer
      • LPIC-3 Senior Level Certification
        • LPIC-3 Exam 300 : Mixed Environments
        • LPIC-3 Exam 303 : Security
        • LPIC-3 Exam 304 : Virtualization and High Availability
    • Linux Technologies
      • Apache HTTPD Server
      • Learning PHP
      • Learning PUPPET
      • Learning SAMBA
      • Linux File-Systems
      • Monitoring with Nagios Core
      • MYSQL
      • openLDAP Directories on Linux
You are here: Home / Linux / LPIC-1 Exam 101 / 102.5 Use RPM and YUM package management

102.5 Use RPM and YUM package management

May 28, 2013 by The Urban Penguin

Weight3
DescriptionCandidates should be able to perform package management using RPM and YUM tools.

Key Knowledge Areas:

  • Install, re-install, upgrade and remove packages using RPM and YUM.
  • Obtain information on RPM packages such as version, status, dependencies, integrity and signatures.
  • Determine what files a package provides, as well as find which package a specific file comes from.

The following is a partial list of the used files, terms and utilities:

  • rpm
  • rpm2cpio
  • /etc/yum.conf
  • /etc/yum.repos.d/
  • yum
  • yumdownloader

Software management in Linux will differ depending to the type of distribution you are using. Debian based systems like Debian, Ubuntu and Mint use .deb files and the Debian package management tools; where as distributions based around the red Hat Package Management system will use RPM files. In this module we will look at at the RPM tools and YUM software repositories.

RPM

The Red Hat Package Management tool are not only available on Red Hat but also Fedora , CentOS and SUSE based system as well as many other Linux distributions that choose to use this form of software management. Using the raw RPM commands over those of the software repository system YUM, does have it advantages. We can download the latest version of software direct from vendor websites without waiting for them to appear in an online repository. Also, working with the RAW tools we get a better insight into the the software dependencies and what is installed on our systems. Of course the disadvantages move in the same vein in that, as we have to manage the dependencies we have to make sure we locate and install all the required software too. I think you will understand why it is required to know both the YUM and RPM mechanisms for the exam.

Once we have downloaded or otherwise located our .rpm file we can install it on our system with root privileges. We can also query the package before hand to make sure it is what we want to install.

rpm -qpi <nameoffile>.rpm
rpm -qpl  <nameoffile>.rpm

Both these commands are run against the rpm before it is installed onto the system the first will list the information contained in the package about the rpm and the second will list all the files

rpm -ih<nameoffile>.rpm

This command will install the rpm file and supply progress in the form of HASH marks (-h). Once installed we can query all the installed packages with:

rpm -qa

This can list the actual names of the packages and then we can again query the installed packages using the package name rather than the file name and omitting the -p option.

rpm -qi <nameofinstalledpackage>
rpm -ql <nameofinstalledpackage>

Should we want to remove the installed package we can remove it with:

rpm -e <nameofinstalledpackage>
rpm -qa (will list all package names installed on the system)

Additionally we can query files withinn the file-system to see which package they belong to

rpm -qf <filename>

Access files within the RPM

It is possible to extract files if required from your RPM files. This is done though the tool rpm2cpio

rpm2cpio <nameofrpm>.rpm > output.cpio
cpio -i --make-directories < output.cpio

In the first line we convert the rpm file to a cpio archive and in the second we extract the archive. The RPM will be extracted to the current directory. In the video we open the Adobe Reader rpm and an opt directory is created with directories below containing all the files of the rpm.

Using YUM

If we choose to use the YUM tools, Yellowdog Update Modified, then we can make life just a little more easy for ourselves. Yum will look in online repositories for the software and we can search their names and descriptions, making it much easier to locate and install software. Along with this YUM will manage the depancancies as long as they too are located with a software reposiories. Many systems including CentOS that we use in the video will install software from the online repositories automatically once the system is up and running.

  • yum –help to list options
  • yum search nmap to search for the nmap package
  • yum provides namp to search for packages that contan the file nmap
  • yum info nmap to show information on the nmap package weather installed or not
  • yum list to list the state of all packages
  • yum list nmap to list just the state of nmap
  • yum install nmap installs nmap
  • yum provides /usr/bin/nmap which package does the nmap file come from
  • yum provides /etc/yum.conf which package does the yum configuration file belong to
  • yum remove nmap uninstalls nmap
  • yum grouplist list package groups
  • yum groupinstall “MySQL Database” Install all packages to support MySQL


Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to print (Opens in new window)

Filed Under: LPIC-1 Exam 101

Primary Sidebar

Newest Video

The Urban Penguin On Youtube

Categories

Pages

  • About The Urban Penguin
  • Contact Us
  • Linux Technologies
    • Apache HTTPD Server
    • Learning PHP
    • Learning PUPPET
    • Learning SAMBA
    • Linux File-Systems
    • Monitoring with Nagios Core
    • MYSQL
    • openLDAP Directories on Linux
  • LPI Training from The Urban Penguin
    • Complete Linux Essentials
    • Live and Pluralsight hosted courses
    • LPI Linux Essentials
    • LPI Linux Essentials for Raspberry Pi
    • LPIC-1 Linux Administrator
    • LPIC-2 Certified Linux Engineer
    • LPIC-3 Senior Level Certification
      • LPIC-3 Exam 300 : Mixed Environments
      • LPIC-3 Exam 303 : Security
      • LPIC-3 Exam 304 : Virtualization and High Availability
  • Online Instructor-led Courses
    • Bash Scripting Masterclass
    • Nftables Masterclass
    • Red Hat Enterprise Linux System Administration 1 – RH124
    • SELinux Masterclass
  • OpenStack
    • Citrix Videos
    • Pluralsight
    • Raspberry Pi Tutorials
    • Udemy
  • Operating System Tutorials
    • Learning SUSE
    • Learning Ubuntu
    • Linux Foundation Training
    • Red Hat and CentOS Training
      • RHCE – EX294 – Automation With Ansible
      • RHCSA – System Admin 1 – RH124
      • RHCSA – System Admin 2 – RH134
    • Solaris 11 OCA 1ZO-821
  • Scripting – the power of repetition!
    • General Java Tutorials
    • Java 7 OCA Exam 1ZO-803
    • Learn C Programming using Linux and the Raspberry Pi
    • Learn Shell Scripting with BASH
    • Master Editing Text Files Using VIM
    • PERL Scripting in Linux
    • Ruby Scripting in Linux
    • Scripting with PowerShell

© 2022 The Urban Penguin · All Rights Reserved