linux_wiki:install_and_update_software_packages_from_red_hat_network_a_remote_repository_or_from_the_local_file_system

This is an old revision of the document!


Install And Update Software Packages From Red Hat Network A Remote Repository Or From The Local File System

General Information

About this page/how-to/script.


Yum and Packages

Check to see if updates are available

yum check-update

Update all packages, assume yes to all questions

yum -y update

Search package name and summary for “apache”

yum search apache

View package details

yum info httpd

Install Apache Web Server

yum install httpd

List all installed package

yum list installed

What package created a file (or directory)

yum provides /var/www

Uninstall package

yum remove httpd

Clean yum cache files

yum clean all

List repositories

yum repolist

Yum Groups

List available groups

yum group list

List available groups, including hidden

yum group list hidden
  • This includes most of the Virtualization Groups

List all packages that belong to the “Security Tools” group

yum group info "Security Tools"

Yum group info markers meanings

  • “-” = Package isn't installed, and won't be installed as part of the group (Eg. “yum group install foo -pkgA” or “yum group install foo; yum remove pkgA” … this will have pkgA marked as '-')
  • “+” = Package isn't installed, but will be the next time you run “yum upgrade” or “yum group upgrade foo”
  • “ ” = Package is installed, but wasn't installed via the group (so “group remove foo” won't remove it).
  • “=” = Package is installed, and was installed via the group.

Install the Security Tools group

yum group install "Security Tools"

To undo a group install:

1) View yum history

yum history
Loaded plugins: amazon-id, rhui-lb
ID     | Command line             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
    25 | group install Security T | 2015-06-06 22:21 | Install        |    3   
    24 | -y install httpd         | 2015-06-06 21:32 | Install        |    1 

2) [Optional] View detailed information about ID 25 (Security Tools group install)

yum history info 25
Loaded plugins: amazon-id, rhui-lb
Transaction ID : 25
Begin time     : Sat Jun  6 22:21:20 2015
Begin rpmdb    : 696:2cf91b5d397c109762f978831d2194caabcf22c4
End time       :            22:21:21 2015 (1 seconds)
End rpmdb      : 699:ac6d05d5b20db2192d6b5f7f30723488222723d0
User           :  <user>
Return-Code    : Success
Command Line   : group install Security Tools
Transaction performed with:
    Installed     rpm-4.11.1-25.el7.x86_64                @rhui-REGION-rhel-server-releases
    Installed     yum-3.4.3-125.el7.noarch                @rhui-REGION-rhel-server-releases
    Installed     yum-metadata-parser-1.1.4-10.el7.x86_64 @anaconda/7.0
Packages Altered:
    Dep-Install openscap-1.1.1-3.el7.x86_64             @rhui-REGION-rhel-server-releases
    Dep-Install openscap-scanner-1.1.1-3.el7.x86_64     @rhui-REGION-rhel-server-releases
    Install     scap-security-guide-0.1.19-2.el7.noarch @rhui-REGION-rhel-server-releases
history info

3) Undo the group install (removes installed packages)

yum history undo 25

Use yum downloader to download RPM

yumdownloader nano

Install package

rpm -ivh nano-2.3.1-10.el7.x86_64.rpm
  • i - install
  • v - verbose
  • h - hash progress bar

List all installed rpm packages

rpm -qa
  • q - query
  • a - all

List all files installed as part of package

rpm -ql nano
  • l - list files

List all files that are part of a local RPM file that is not installed yet

rpm -qlp nano-2.3.1-10.el7.x86_64.rpm

List documentation files for a package

rpm -qd nano
  • d - documentation files

List configuration files for a package

rpm -qc nano
  • c - configuration files

Remove package

rpm -e nano
  • -e ⇒ erase

Install local rpm, auto install dependencies

yum install nano-2.3.1-10.el7.x86_64.rpm
  • Note: yum localinstall ⇒ maintained for legacy reasons only, as yum install will behave as a local install if the target is a file.

  • linux_wiki/install_and_update_software_packages_from_red_hat_network_a_remote_repository_or_from_the_local_file_system.1456800776.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)