Technology Encyclopedia Home >How to install packages using YUM?

How to install packages using YUM?

To install packages using YUM (Yellowdog Updater Modified), you typically follow these steps:

  1. Update Package Index: Before installing a new package, it's a good practice to update your system's package index. This ensures that you are installing the latest version of the package available in the repositories. You can do this by running:

    sudo yum update
    
  2. Install a Package: To install a specific package, use the following command:

    sudo yum install package_name
    

    Replace package_name with the name of the package you wish to install. For example, to install the httpd package (which is Apache HTTP Server), you would run:

    sudo yum install httpd
    
  3. Verify Installation: After the installation is complete, you can verify that the package has been installed correctly by checking its version or by attempting to run the service if it's an application. For example, to check the version of Apache installed, you might run:

    httpd -v
    

YUM is a powerful tool for managing software packages on RPM-based Linux distributions like CentOS, Fedora, and RHEL (Red Hat Enterprise Linux). It handles dependencies automatically, making it easier to install, update, and remove software.

For cloud-related tasks, such as deploying and managing applications, you might consider using services like Tencent Cloud's Cloud Virtual Machine (CVM), which provides scalable and reliable cloud computing services. On CVM, you can use YUM or other package managers to install and manage software just as you would on a local server.