35

Since I had a lot of trouble finding out how to do this anywhere, I'd like to ask,

how do I enable the PowerTools repository in CentOS 8? (equivalent of CodeReady Linux Builder repo in RHEL 8)

omusil
  • 453
  • 1
  • 4
  • 5

3 Answers3

50

You can enable it with the following commands:

yum install dnf-plugins-core

And then:

yum config-manager --set-enabled powertools

Or:

yum config-manager --set-enabled PowerTools

You can also just open /etc/yum.repos.d/CentOS-PowerTools.repo with a text editor and set enabled= to 1 instead of 0'.

Run yum repolist and you'll see it.

EDIT:

The repo is now powertools instead of PowerTools when enabling it with yum. There was a bug so the developers may set it back to what it was before which is why both are listed. The repo file still has the same name.

Nasir Riley
  • 2,035
  • 8
  • 9
  • 2
    Thanks. I found only the `yum config-manager` line was needed in my case. – mwfearnley Jan 29 '20 at 14:41
  • Editing `/etc/yum.repos.d/CentOS-PowerTools.repo` is a nice option. Then you don't need to install to `dnf-plugins-core`. – wisbucky Jul 28 '20 at 15:28
  • 3
    FYI, this is broken as of today. Need to use "powertools" not "PowerTools". https://bugs.centos.org/view.php?id=17920 – Alex Hirzel Dec 09 '20 at 17:15
  • Note that they may fix the bug I linked and your answer could end up being correct :) – Alex Hirzel Dec 09 '20 at 17:41
  • @AlexHirzel I made a note of this in my edit from a bit ago. Both are now listed. – Nasir Riley Dec 09 '20 at 17:44
  • I could not make it work with `--set-enabled powertools` and found a comment on this [here](https://access.redhat.com/discussions/5417621), saying `powertools` was not an existing repo and suggests to go with `codeready-builder-for-rhel-8-x86_64-rpms` instead (which worked for me and my current usecase). It's quite intereseting (at least for a rhel novice like myself) to see those conflicting statements on this. And this mentioning here is not the forst appearance of powertools I did encounter, so there must be some meat to it. Or ist his 1 of the differences between `rhel` and it's clones? – vrms Jul 19 '22 at 14:03
  • @vrms CentOS and RHEL a two different operating systems despite the former being a derivative of to the latter. I gave another answer either here, Unix & Linux Stack Exchange, or Superuser to use Codeready Builder for RHEL. – Nasir Riley Jul 19 '22 at 19:34
  • that is slowly sinking in. Thanks for pointing that out once again. It can be quite confusing when it comes to the use of particular repositories and locating particular packages. – vrms Jul 23 '22 at 10:43
8

To get more info, run :-

yum info epel-release

Execute the following command:-

sudo yum install epel-release

enable the PowerTools repository since EPEL packages may depend on packages from it:-

sudo yum config-manager --set-enabled powertools

You may get an error that read as follows:-

No such command: config-manager. Please use /usr/bin/yum –help

Run the following command to fix it:

sudo yum install 'dnf-command(config-manager)'

And re-run the above command again:-

sudo yum config-manager --set-enabled powertools

Now that EPEL repo installed it is time to configure and use it. Hence, run the following command:-

sudo yum update

List your new repos:-

sudo yum repolist
user7610
  • 150
  • 7
Sukhjinder Singh
  • 1,944
  • 2
  • 8
  • 17
1

On RHEL 8 and Oracle Linux 8 you'd need to

sudo dnf config-manager --set-enabled ol8_codeready_builder
jamacoe
  • 173
  • 1
  • 7