Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Linux Commands»Using RPM Command to Install, Upgrade and Remove Packages

    Using RPM Command to Install, Upgrade and Remove Packages

    By RahulFebruary 27, 20233 Mins Read

    If you’re using a Linux distribution that uses the RPM package format, you’re probably familiar with the RPM command. RPM stands for Red Hat Package Manager and is used to manage packages on Red Hat and its derivatives like Fedora, CentOS, and OpenSUSE.

    Advertisement

    In this tutorial, we’ll cover the basics of using the RPM command to install, upgrade, and remove packages on your Linux system.

    Installing Packages with RPM Command

    To install a package using the RPM command, you need to have the RPM package file on your system. You can either download the RPM package from the internet or use a package manager like yum or dnf to install it. Once you have the package file, open the terminal and run the following command:

    sudo rpm -ivh package_name.rpm 
    

    The -i flag is used to install the package, -v is for verbose output, and -h is to print a hash mark (#) for each file being installed. The package_name.rpm is the name of the RPM package you want to install.

    Upgrading Packages with RPM Command

    To upgrade a package using the RPM command, you need to have the newer version of the package available on your system. You can either download the RPM package from the internet or use a package manager like yum or dnf to upgrade it. Once you have the newer package file, open the terminal and run the following command:

    sudo rpm -Uvh package_name.rpm 
    

    The -U flag is used to upgrade the package, and the other flags have the same meanings as in the installation command. The package_name.rpm is the name of the RPM package you want to upgrade.

    Querying RPM Packages

    To list all installed RPM packages, use the following command:

    rpm -qa 
    

    To query information about a specific RPM package, use the following command:

    rpm -qi package_name 
    

    Replace package_name with the name of the RPM package you want to query.

    Removing Packages with RPM Command

    The package that is no more required, should be removed from the system. To remove a package using the RPM command, open the terminal and run the following command:

    sudo rpm -e package_name 
    

    The -e flag is used to erase or remove the package, and the package_name is the name of the RPM package you want to remove.

    Conclusion

    In this tutorial, we covered the basics of using the RPM command to install, upgrade, and remove packages on your Linux system. RPM is a powerful tool for managing packages on Red Hat and its derivatives like Fedora, CentOS, and OpenSUSE. Knowing how to use RPM can make it easier to manage packages on your Linux system.

    Install rpm
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    cp Command in Linux (Copy Files Like a Pro)

    dd Command in Linux (Syntax, Options and Use Cases)

    Top 10 JQ Commands Every Linux Developer Should Know

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Implementing a Linux Server Security Audit: Best Practices and Tools
    • cp Command in Linux (Copy Files Like a Pro)
    • 15 Practical Examples of dd Command in Linux
    • dd Command in Linux (Syntax, Options and Use Cases)
    • Iptables: Common Firewall Rules and Commands
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.