{"id":133133,"date":"2020-12-29T07:05:11","date_gmt":"2020-12-29T07:05:11","guid":{"rendered":"https:\/\/onet.com.vn\/centos-how-to-install-rpm.html"},"modified":"2020-12-29T07:05:11","modified_gmt":"2020-12-29T07:05:11","slug":"centos-how-to-install-rpm","status":"publish","type":"post","link":"https:\/\/onet.com.vn\/centos-how-to-install-rpm\/","title":{"rendered":"CentOS How to Install RPM"},"content":{"rendered":"\n
Whenever you\u2019re running a Linux distro, it\u2019s always a challenge to find all your necessary tools directly in the default repository. Granted, all the repositories of any Linux distro comes with a pretty large collection of default software and tools. However, in some cases, you may need to get software outside the repository and install it.<\/p>\n

In the case of CentOS and RHEL, it uses \u201cyum\u201d as its package manager. In case you need to grab a software package from a different source, you either need to follow the classical method (grabbing the source, building the software and installing it) or locate an installable package. For CentOS and RHEL, you should look for RPM packages.<\/p>\n

There are also other Linux distros that use the RPM package format as the default installable package type, for example, Fedora and OpenSUSE. Keep in mind that you should look for RPM packages that are specifically built for CentOS\/RHEL system. Otherwise, you may need to depend on the Fedora\/OpenSUSE package. In that case, use them at your own risk (high chance of it not working properly, malfunctioning or not even installing properly).<\/p>\n

It\u2019s time to learn about managing an RPM package on CentOS\/RHEL! My test system is CentOS 7.<\/p>\n

Obtain an RPM<\/strong><\/h3>\n

At first, find a suitable RPM package that you\u2019ll be working with. Whatever RPM package you grab, make sure that you choose the correct one according to your system\u2019s architecture.<\/p>\n

I\u2019m going with the Google Chrome RPM package.<\/p>\n

\n
wget<\/span> https:\/\/<\/span>dl.google.com\/<\/span>linux\/<\/span>direct\/<\/span>google-chrome-stable_current_x86_64.rpm<\/div>\n<\/div>\n

RPM usage<\/strong><\/h3>\n

Before diving into the deep end, don\u2019t forget to enable the EPEL repository on your CentOS system!<\/p>\n

Run this command first \u2013<\/p>\n

\n
sudo<\/span> yum install<\/span> epel-release<\/div>\n<\/div>\n

<\/p>\n

Then, update your system \u2013<\/p>\n

\n
sudo<\/span> yum update<\/span><\/div>\n<\/div>\n

<\/p>\n

Installing an RPM package<\/strong><\/h3>\n

By default, the following command should do the job \u2013<\/p>\n

\n
sudo<\/span> yum install<\/span> .\/<\/span> google-chrome-stable_current_x86_64.rpm<\/div>\n<\/div>\n

<\/p>\n

<\/p>\n

<\/p>\n

Now, let\u2019s slow down and have a look at the command.<\/p>\n

    \n
  • yum: calling the \u201cyum\u201d tool for performing the installation of the RPM package.<\/li>\n
  • install: Perform an installation job. In this case, it\u2019s the parsed RPM package.<\/li>\n
  • .\/ : This is a very important part. Without this, \u201cyum\u201d won\u2019t solve the dependency issues (missing\/corrupted or unsatisfied dependencies).<\/li>\n<\/ul>\n

    You could also perform the action with \u201cRPM\u201d but working with \u201cyum\u201d is preferred, as it will solve all the dependency issues by default; no need to scratch your head and\u00a0try to find out the required dependencies and packages etc.<\/p>\n

    Uninstalling the RPM package<\/strong><\/h3>\n

    If you\u2019re no longer interested in the software you installed before, you can directly uninstall it by running the following command \u2013<\/p>\n

    \n
    sudo<\/span> yum remove<\/span> <<\/span>package_name><\/span><\/div>\n<\/div>\n

    <\/p>\n

      \n
    • Converting DEB to RPM<\/strong><\/li>\n<\/ul>\n

      This is an interesting thing to perform but it\u2019s possible! You can convert a DEB (default Debian\/Ubuntu installation package) into an RPM package. Of course, things are pretty much bound to break down.<\/p>\n

      However, this method came in handy in the past, so feel free to keep this trick in mind!<\/p>\n

      At first, grab a test DEB package. I\u2019ll be using the Google Chrome DEB package.<\/p>\n

      Install the converting tool \u2013 alien. It comes from the EPEL repository, so make sure that you configured EPEL on your system.<\/p>\n

      \n
      sudo<\/span> yum install<\/span> alien<\/div>\n<\/div>\n

      <\/p>\n

      <\/p>\n

      Then, use the tool for performing the conversion!<\/p>\n

      \n
      sudo<\/span> alien -r<\/span> <<\/span>deb_package_name><\/span><\/div>\n<\/div>\n

      <\/p>\n

      Once the generation process is complete, you\u2019ll end up with an installable RPM package on the directory.<\/p>\n

      Then, enjoy the RPM just like you would with a regular RPM!<\/p>\n

      \n
      sudo<\/span> yum install<\/span> .\/<<\/span>RPM_file><\/span><\/div>\n<\/div>\n

      Enjoy! <\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"

      Whenever you\u2019re running a Linux distro, it\u2019s always a challenge to find all your necessary tools directly in the default repository. Granted, all the repositories of any Linux distro comes with a pretty large collection of default software and tools. However, in some cases, you may need to get software outside the repository and install […]<\/p>\n","protected":false},"author":1,"featured_media":133134,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[],"_links":{"self":[{"href":"https:\/\/onet.com.vn\/wp-json\/wp\/v2\/posts\/133133"}],"collection":[{"href":"https:\/\/onet.com.vn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/onet.com.vn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/onet.com.vn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/onet.com.vn\/wp-json\/wp\/v2\/comments?post=133133"}],"version-history":[{"count":0,"href":"https:\/\/onet.com.vn\/wp-json\/wp\/v2\/posts\/133133\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/onet.com.vn\/wp-json\/wp\/v2\/media\/133134"}],"wp:attachment":[{"href":"https:\/\/onet.com.vn\/wp-json\/wp\/v2\/media?parent=133133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/onet.com.vn\/wp-json\/wp\/v2\/categories?post=133133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/onet.com.vn\/wp-json\/wp\/v2\/tags?post=133133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}