Tutorial on how to use YUM to manage software packages in CentOS/RHEL 7 and earlier versions

888u

Last update at :2024-01-19,Edit by888u

We are familiar with the CentOS system and generally use YUM (Yellowdog Updater, Modified) to manage software packages. YUM is the default package manager for CentOS 7 and older versions of RHEL and Fedora. This article introduces some common YUM commands, including YUM commands to install software, update software packages, uninstall software packages, search for software packages, etc. However, it has largely been replaced by its successor Dandified YUM (also known as DNF) in most newer RPM-based distributions, including CentOS 8, RHEL 8, and Fedora 22 (and later).

Preparation before starting

1. Prepare a CentOS/RHEL 7 system

Systems running on CentOS/RHEL 7, Fedora 21, or any earlier distribution. Other Linux distributions that use the APT package manager can also be used. If there is no compatible system yet, you can reinstall the system.

2. Connect to Banwagonhost SSH

Secondly, we need to connect to the Banwagonhost VPS via SSH before we can perform a series of operations.

Use YUM to upgrade packages

1. Update installed software packages

sudo yum update

2. List installed software packages that can be updated

sudo yum list updates

3. Update specific software packages (taking Apache as an example)

sudo yum update httpd

Use YUM to install packages

1. Install the software package (taking PHP as an example)

sudo yum install php

2. Reinstall the software package

sudo yum reinstall php

Use YUM to uninstall packages

1. Uninstall the software package (taking MariaDB as an example)

sudo yum remove mariadb-server

2. Delete a package and all dependent packages installed with it

sudo yum autoremove mariadb-server

3. Use the autoremove command without specifying a package to identify and delete system dependencies that are no longer needed

sudo yum autoremove

Some useful YUM options

1. Install multiple software packages at the same time (the following commands install Apache, PHP and MariaDB in a single command)

sudo yum install httpd php mariadb-server

2. To specify a specific version of the software package, please add – and the required version number after the package name

sudo yum install neovim-0.3.8

To list the available versions of a package, use the –showdupicates option with the list command and the name of a specific package:

sudo yum list neovim --showduplicates

3. Automatically confirm, use -y or –assumeyes option

sudo yum install neovim -y

Find and search packages

1. List all packages in the YUM repository

sudo yum list

List all packages that can be installed on the system via YUM's repository:

sudo yum list available

List all packages currently installed on the system:

sudo yum list installed

List packages added to the YUM repository in the past week:

sudo yum list recent

2. Search for available YUM packages (take git as an example)

sudo yum search git

Search multiple keywords:

sudo yum search version control

3. Search for packages based on commands (such as finding packages containing the pip3 command)

sudo yum provides pip3

4. Get other detailed information about the package

sudo yum info python36

5. Get the dependency list of a given package

sudo yum deplist python36

Add YUM repository method

Like other Linux package managers, YUM allows adding repositories in addition to the default repositories. The following mainly introduces how to add Extra Packages for Enterprise Linux (EPEL).

1. Install EPEL repository

sudo yum install epel-release

2. Verify that the EPEL repository is in use

sudo yum repolist

3. Once the repository is added, you can install packages from it just like you would from the default repository. This example installs Nagios, which is available in the EPEL repository but not in YUM's default repository

sudo yum install nagios

Get more help using YUM

You can use the -h or –help command to get more help information.

sudo yum help

Recommended discounts/cost-effective packages for bricklayers

Warm reminder: If you have difficulty choosing, just choose the CN2 GIA-E plan in the middle. The quarterly payment is $49.99, and you can switch between up to 12 computer rooms at will.

Banwagonhost discount code: BWH3HYATVBJW, discount 6.58%, available everywhere. The table below summarizes more preferential packages for bricklayer removal.

plan Memory CPU harddisk Traffic/month bandwidth engine room price Buy
CN2 (cheapest) 1GB 1 core 20GB 1TB 1Gbps DC3 CN2 DC8 ZNET $49.99/year Buy
CN2 2GB 1 core 40GB 2TB 1Gbps $52.99/half year $99.99/year Buy
CN2 GIA-E (Most recommended) 1GB 2 cores 20GB 1TB 2.5Gbps DC6 CN2 GIA-E DC9 CN2 GIA Japan SoftBank JPOS_1 China Unicom Netherlands EUNL_9 $49.99/quarter $169.99/year Buy
CN2 GIA-E 2GB 3 core 40GB 2TB 2.5Gbps $89.99/quarter $299.99/year Buy
HK 2GB 2 cores 40GB 0.5TB 1Gbps Hong Kong CN2 GIA $89.99/month $899.99/year Buy
HK 4GB 4 core 80GB 1TB 1Gbps $155.99/month $1559.99/year Buy

Select a suggestion:

  • Getting started: Los Angeles CN2 package, currently the cheapest, optional CN2 GT computer room, the entry-level choice.
  • Recommendation: Los Angeles CN2 GIA-E package, affordable, super fast, with many optional computer rooms, and the most cost-effective.
  • High-end: Hong Kong CN2 GIA package, the price is higher, but impeccable.

Recommended site search: China's top ten domain name registrars American space, virtual host evaluation, host server rental, Taiwan proxy server, dynamic IP server, Ministry of Information Industry registration, space service provider, virtual host Hong Kong host, domain name registration center,

Tutorial on how to use YUM to manage software packages in CentOS/RHEL 7 and earlier versions

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码