2024-02-14 20:41:45 +00:00
|
|
|
---
|
|
|
|
title: YUM
|
|
|
|
category: CLI
|
|
|
|
updated: 2024-02-07
|
|
|
|
---
|
|
|
|
|
2024-02-14 20:42:47 +00:00
|
|
|
## Commands
|
2024-02-14 20:41:45 +00:00
|
|
|
|
2024-02-14 20:42:47 +00:00
|
|
|
### Help and lists
|
2024-02-14 20:41:45 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
yum help # Display yum commands and options
|
|
|
|
yum list available # List all available packages
|
|
|
|
yum list installed # List all installed packages
|
|
|
|
yum list kernel # List installed and available kernel packages
|
|
|
|
yum info vsftpd # List info about vsftpd package
|
|
|
|
```
|
|
|
|
|
2024-02-14 20:42:47 +00:00
|
|
|
### Searching and dependencies
|
2024-02-14 20:41:45 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
yum deplist nfs-utils # List dependencies for nfs-utils
|
|
|
|
yum provides "*bin/top" # Show package containing top command
|
|
|
|
yum search samba # Find packages with samba in name or description
|
|
|
|
```
|
|
|
|
|
2024-02-14 20:42:47 +00:00
|
|
|
### Updating and security
|
2024-02-14 20:41:45 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
yum updateinfo security # Get info on available security updates
|
|
|
|
yum update --security # Apply security-related package updates
|
|
|
|
```
|
|
|
|
|
2024-02-14 20:42:47 +00:00
|
|
|
### Managing repositories
|
2024-02-14 20:41:45 +00:00
|
|
|
|
|
|
|
```bash
|
2024-02-14 20:42:47 +00:00
|
|
|
yum repolist # Display enabled software repositories
|
2024-02-14 20:41:45 +00:00
|
|
|
yum repoinfo rhel-7-server-rpms # See info on specific repo
|
|
|
|
yum repo-pkgs my-rpms list # List packages from a specific repo
|
|
|
|
```
|
|
|
|
|
2024-02-14 20:42:47 +00:00
|
|
|
### Installation and upgrades
|
2024-02-14 20:41:45 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
yum install vsftpd # Install the vsftpd package
|
|
|
|
yum update # Update all packages
|
|
|
|
yum downgrade abc # Downgrade the abc package to an earlier version
|
|
|
|
yum autoremove httpd # Remove httpd and unneeded packages
|
|
|
|
```
|
|
|
|
|
2024-02-14 20:42:47 +00:00
|
|
|
### Package groups
|
2024-02-14 20:41:45 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
yum groupinstall "Web server" # Install Web Server packages
|
|
|
|
```
|
|
|
|
|
2024-02-14 20:42:47 +00:00
|
|
|
### Troubleshooting
|
2024-02-14 20:41:45 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
yum history list # List all yum transactions
|
|
|
|
yum clean packages # Delete packages saved in cache
|
|
|
|
```
|
|
|
|
|
2024-02-14 20:42:47 +00:00
|
|
|
### Popular options
|
2024-02-14 20:41:45 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
-y # Assume yes if prompted
|
|
|
|
--disablerepo=epel # Disable a specific repo for a command
|
|
|
|
--downloadonly # Download package to cache but don't install
|
2024-02-14 20:42:47 +00:00
|
|
|
```
|