Differences
This shows you the differences between two versions of the page.
linux_wiki:install_and_update_software_packages_from_red_hat_network_a_remote_repository_or_from_the_local_file_system [2016/03/03 23:09] billdozor [repos via config files] |
linux_wiki:install_and_update_software_packages_from_red_hat_network_a_remote_repository_or_from_the_local_file_system [2019/05/25 23:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Install And Update Software Packages From Red Hat Network A Remote Repository Or From The Local File System ====== | ||
- | |||
- | **General Information** | ||
- | |||
- | Managing software packages and repos. | ||
- | |||
- | ---- | ||
- | |||
- | ===== Yum and Packages ===== | ||
- | |||
- | Check to see if updates are available | ||
- | <code bash> | ||
- | yum check-update | ||
- | </ | ||
- | |||
- | \\ | ||
- | Update all packages, assume yes to all questions | ||
- | <code bash> | ||
- | yum -y update | ||
- | </ | ||
- | |||
- | \\ | ||
- | Search package name and summary for " | ||
- | <code bash> | ||
- | yum search apache | ||
- | </ | ||
- | |||
- | \\ | ||
- | View package details | ||
- | <code bash> | ||
- | yum info httpd | ||
- | </ | ||
- | |||
- | \\ | ||
- | Install Apache Web Server | ||
- | <code bash> | ||
- | yum install httpd | ||
- | </ | ||
- | |||
- | \\ | ||
- | List all installed package | ||
- | <code bash> | ||
- | yum list installed | ||
- | </ | ||
- | |||
- | \\ | ||
- | What package created a file (or directory) | ||
- | <code bash> | ||
- | yum provides /var/www | ||
- | </ | ||
- | |||
- | \\ | ||
- | Uninstall package | ||
- | <code bash> | ||
- | yum remove httpd | ||
- | </ | ||
- | |||
- | \\ | ||
- | Clean yum cache files | ||
- | <code bash> | ||
- | yum clean all | ||
- | </ | ||
- | |||
- | \\ | ||
- | List repositories | ||
- | <code bash> | ||
- | yum repolist | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ==== Yum Groups ==== | ||
- | |||
- | List available groups | ||
- | <code bash> | ||
- | yum group list | ||
- | </ | ||
- | |||
- | \\ | ||
- | List available groups, including hidden | ||
- | <code bash> | ||
- | yum group list hidden | ||
- | </ | ||
- | * This includes most of the Virtualization Groups | ||
- | |||
- | \\ | ||
- | List all packages that belong to the " | ||
- | <code bash> | ||
- | yum group info " | ||
- | </ | ||
- | **Yum group info markers meanings** | ||
- | * " | ||
- | * " | ||
- | * " " = Package is installed, but wasn't installed via the group (so "group remove foo" | ||
- | * " | ||
- | |||
- | \\ | ||
- | Install the Security Tools group | ||
- | <code bash> | ||
- | yum group install " | ||
- | </ | ||
- | |||
- | \\ | ||
- | To undo a group install: | ||
- | |||
- | 1) View yum history | ||
- | <code bash> | ||
- | yum history | ||
- | Loaded plugins: amazon-id, rhui-lb | ||
- | ID | Command line | Date and time | Action(s) | ||
- | ------------------------------------------------------------------------------- | ||
- | 25 | group install Security T | 2015-06-06 22:21 | Install | ||
- | 24 | -y install httpd | 2015-06-06 21:32 | Install | ||
- | </ | ||
- | |||
- | \\ | ||
- | 2) [Optional] View detailed information about ID 25 (Security Tools group install) | ||
- | <code bash> | ||
- | 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: | ||
- | End time : | ||
- | End rpmdb : 699: | ||
- | User : | ||
- | Return-Code | ||
- | Command Line : group install Security Tools | ||
- | Transaction performed with: | ||
- | Installed | ||
- | Installed | ||
- | Installed | ||
- | Packages Altered: | ||
- | Dep-Install openscap-1.1.1-3.el7.x86_64 | ||
- | Dep-Install openscap-scanner-1.1.1-3.el7.x86_64 | ||
- | Install | ||
- | history info | ||
- | </ | ||
- | |||
- | \\ | ||
- | 3) Undo the group install (removes installed packages) | ||
- | <code bash> | ||
- | yum history undo 25 | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ===== RPM (Redhat Package Manager) ===== | ||
- | |||
- | Use yum downloader to download RPM | ||
- | <code bash> | ||
- | yumdownloader nano | ||
- | </ | ||
- | |||
- | \\ | ||
- | Install package | ||
- | <code bash> | ||
- | rpm -ivh nano-2.3.1-10.el7.x86_64.rpm | ||
- | </ | ||
- | * i - install | ||
- | * v - verbose | ||
- | * h - hash progress bar | ||
- | |||
- | \\ | ||
- | List all installed rpm packages | ||
- | <code bash> | ||
- | rpm -qa | ||
- | </ | ||
- | * q - query | ||
- | * a - all | ||
- | |||
- | \\ | ||
- | List all files installed as part of package | ||
- | <code bash> | ||
- | rpm -ql nano | ||
- | </ | ||
- | * l - list files | ||
- | |||
- | \\ | ||
- | List all files that are part of a local RPM file that is not installed yet | ||
- | <code bash> | ||
- | rpm -qlp nano-2.3.1-10.el7.x86_64.rpm | ||
- | </ | ||
- | |||
- | \\ | ||
- | List documentation files for a package | ||
- | <code bash> | ||
- | rpm -qd nano | ||
- | </ | ||
- | * d - documentation files | ||
- | |||
- | \\ | ||
- | List configuration files for a package | ||
- | <code bash> | ||
- | rpm -qc nano | ||
- | </ | ||
- | * c - configuration files | ||
- | |||
- | \\ | ||
- | Remove package | ||
- | <code bash> | ||
- | rpm -e nano | ||
- | </ | ||
- | * -e => erase | ||
- | |||
- | \\ | ||
- | Install local rpm, auto install dependencies | ||
- | <code bash> | ||
- | 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. | ||
- | |||
- | ---- | ||
- | |||
- | ===== Managing Repositories ===== | ||
- | |||
- | Repo config files location | ||
- | * / | ||
- | * file must end in " | ||
- | |||
- | \\ | ||
- | Show all enabled repos | ||
- | <code bash> | ||
- | yum repolist | ||
- | </ | ||
- | |||
- | \\ | ||
- | Show all enabled and disabled repos | ||
- | <code bash> | ||
- | yum repolist all | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ==== yum config manager ==== | ||
- | Add new repo | ||
- | <code bash> | ||
- | yum-config-manager --add-repo=http:// | ||
- | </ | ||
- | |||
- | \\ | ||
- | Disable repo using yum-config-manager and repo id (get id from "yum repolist" | ||
- | <code bash> | ||
- | yum-config-manager --disable dl.fedoraproject.org_pub_epel_7_x86_64_ | ||
- | </ | ||
- | |||
- | \\ | ||
- | Remove repo | ||
- | <code bash> | ||
- | rm -f / | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ==== Repos via Config Files ==== | ||
- | |||
- | Add new repo; create new file in / | ||
- | <code bash> | ||
- | vim / | ||
- | |||
- | [EPEL7] | ||
- | name=Fedora EPEL 7 | ||
- | baseurl=http:// | ||
- | enabled=1 | ||
- | </ | ||
- | * [EPEL7] => repo id | ||
- | * Fedora EPEL 7 => repo name | ||
- | |||
- | \\ | ||
- | Disable repo by editing repo file | ||
- | <code bash> | ||
- | vim / | ||
- | |||
- | enabled=0 | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ==== Configuring A Local Repository ==== | ||
- | |||
- | Setup directory and mount iso | ||
- | <code bash> | ||
- | mkdir -p / | ||
- | mount -o loop rhel-server-7.1-x86_64-dvd.iso / | ||
- | </ | ||
- | |||
- | \\ | ||
- | Create local repo config file | ||
- | <code bash> | ||
- | cd / | ||
- | vim local-repo.repo | ||
- | |||
- | [local-repo] | ||
- | name=Red Hat Linux Local Repo | ||
- | baseurl=file:/// | ||
- | enabled=1 | ||
- | gpgcheck=0 | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ===== Configure The GPG Key ===== | ||
- | |||
- | Download gpg key from repo | ||
- | <code bash> | ||
- | cd / | ||
- | wget http:// | ||
- | </ | ||
- | |||
- | \\ | ||
- | Add gpg check and key to repo config | ||
- | <code bash> | ||
- | cd / | ||
- | vim dl.fedoraproject.org_pub_epel_7_x86_64_.repo | ||
- | |||
- | gpgcheck=1 | ||
- | gpgkey=file:/// | ||
- | </ | ||
- | |||
- | ---- | ||