Adam Young: Converting a RHEL Workstation to a Server

My laptop is my Demo machine.  I need to be able to run the Red Hat cloud Suite of software on it.  I want to install this software the same way a customer would.  However, much of this software is server side software, and my machine was registered as a workstation. This means the Red Hat Content network won’t show me the server yum repositories.  Here is how I converted my machine to be a server.

The key is to change the installed  RPM from  redhat-release-workstation to redhat-release-server.  These two RPMS control the set of files that tell the yum system what product is installed, and from that, the set of available (Yum) repositories.  However, since they conflict, you cannot just install redhat-release-server.  That leads to the following errors:

Transaction check error:
  file /etc/os-release from install of redhat-release-server-7.5-8.el7.x86_64 conflicts with file from package redhat-release-workstation-7.5-8.el7.x86_64
  file /etc/redhat-release from install of redhat-release-server-7.5-8.el7.x86_64 conflicts with file from package redhat-release-workstation-7.5-8.el7.x86_64
  file /etc/system-release-cpe from install of redhat-release-server-7.5-8.el7.x86_64 conflicts with file from package redhat-release-workstation-7.5-8.el7.x86_64
  file /usr/lib/systemd/system-preset/90-default.preset from install of redhat-release-server-7.5-8.el7.x86_64 conflicts with file from package redhat-release-workstation-7.5-8.el7.x86_64

Here are the steps I worked out to work around this.

First, download the  redhat-release-server RPM on a server-registered machine.  Use the yum coammnad, to make sure keys are presnet, and the repo lets you in.

sudo yum reinstall redhat-release-server  --downloadonly

This will download a copy, that you can find with:

 

find /var/cache/yum/x86_64/7Server/rhel-7-server-rpms/ -name redhat-release-server-7.5-8.el7.x86_64.rpm

And then copy it over from the target machine.  IN my case:

scp -i ~/keys/id_rsa cloud-user@128.31.26.132:/var/cache/yum/x86_64/7Server/rhel-7-server-rpms/packages/redhat-release-server-7.5-8.el7.x86_64.rpm /home/ayoung/Downloads/

To install it, use the yum shell to perform multiple yum commands in a single transaction:

$ sudo yum shell
Loaded plugins: changelog, fs-snapshot, priorities, product-id, refresh-packagekit, rpm-warm-cache, search-disabled-repos, subscription-manager, verify
> erase redhat-release-workstation-7.5-8.el7.x86_64
> install /home/ayoung/Downloads/redhat-release-server-7.5-8.el7.x86_64.rpm
Examining /home/ayoung/Downloads/redhat-release-server-7.5-8.el7.x86_64.rpm: redhat-release-server-7.5-8.el7.x86_64
Marking /home/ayoung/Downloads/redhat-release-server-7.5-8.el7.x86_64.rpm to be installed
> run

Assuming that runs to completion, use the command exit to return to the bash command prompt.  Update the set of repos with:

sudo  mv /etc/yum.repos.d/redhat.repo /etc/yum.repos.d/redhat.repo.old
sudo subscription-manager refresh

And then list, and you should see that most of the repos that had “workstation” in them before now have “server” in their names.

$ sudo subscription-manager repos --list-enabled
+----------------------------------------------------------+
Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID: rhel-7-server-htb-rpms
Repo Name: Red Hat Enterprise Linux 7 Server HTB (RPMs)
Repo URL: https://cdn.redhat.com/content/htb/rhel/server/7/$basearch/os
Enabled: 1

Repo ID: rhel-7-workstation-rpms
Repo Name: Red Hat Enterprise Linux 7 Workstation (RPMs)
Repo URL: https://cdn.redhat.com/content/dist/rhel/workstation/7/$releasever/$basearch/os
Enabled: 1

Repo ID: rhel-7-server-rpms
Repo Name: Red Hat Enterprise Linux 7 Server (RPMs)
Repo URL: https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/$basearch/os
Enabled: 1

I only want the server RPMs for now:

$ sudo subscription-manager repos --disable rhel-7-server-htb-rpms
Repository 'rhel-7-server-htb-rpms' is disabled for this system.
$ sudo subscription-manager repos --disable rhel-7-workstation-rpms
Repository 'rhel-7-workstation-rpms' is disabled for this system.

And…

$ sudo yum update
Loaded plugins: changelog, fs-snapshot, priorities, product-id, refresh-packagekit, rpm-warm-cache, search-disabled-repos, subscription-manager, verify
No packages marked for update

I wonder what this is going to break.

I cannot, yet, say whether this is a sane thing to do or not.  I’ll let you know.

 

 


Source From: fedoraplanet.org.
Original article title: Adam Young: Converting a RHEL Workstation to a Server.
This full article can be read at: Adam Young: Converting a RHEL Workstation to a Server.

Advertisement


Random Article You May Like

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*