📜  yum install package with version - Shell-Bash (1)

📅  最后修改于: 2023-12-03 14:48:41.860000             🧑  作者: Mango

yum install package with version - Shell/Bash

Introduction

In the world of Linux package management, yum is a popular tool that lets you install and manage software packages on CentOS/RHEL/Fedora systems. With yum, you can install packages with their latest versions, but sometimes you may need to install a specific version of a package. In this tutorial, we will explain how to use yum to install specific versions of packages.

Installing a Specific Version of a Package

To install a specific version of a package with yum, you need to follow these steps:

  1. First, make sure that the package you want to install is available in the repository. You can check this by running the following command:
yum list <package-name> --showduplicates
  1. Next, select the version of the package that you want to install. You can do this by specifying the version number along with the package name. For example, to install version 1.0.0 of the nginx package, you would run:
yum install nginx-1.0.0
  1. If you want to downgrade a package to an older version, you can use the --oldpackage option. This option will allow yum to replace the newer version with the older version of the package. For example, to downgrade the nginx package to version 1.0.0, you would run:
yum downgrade nginx-1.0.0 --oldpackage
Conclusion

In this tutorial, we have shown how to use yum to install specific versions of packages. By following these steps, you can easily manage different versions of packages on your CentOS/RHEL/Fedora system.