I have a rhel deployed as a VM and want to determine if it is a Server or Workstation. The command

I am running the following commands to find out:

$ cat /etc/rhel-release
Red Hat Enterprise Linux release 8.2 (Ootpa)

$ rpm -q --whatprovides /etc/redhat-release

$ uname -as
Linux opus-c-master 4.18.0-193.el8.x86_64 #1 SMP Fri Mar 27 14:35:58 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

None of these commands telling me the type.

Can anyone able to help?

  • 1
    That does not work for newer versions like RHEL8
    – Muzammil
    Jun 15 at 12:34

On RHEL 8, you can use syspurpose to determine the configured purpose of a system, e.g.

$ sudo syspurpose show
  "role": "Red Hat Enterprise Linux Workstation",
  "usage": "Production"

Configuring this is, however, optional. To configure a system’s purpose, run

sudo syspurpose --set-role="Red Hat Enterprise Linux Server"

(the role can be one of “Red Hat Enterprise Linux Server”, “Red Hat Enterprise Linux Workstation”, “Red Hat Enterprise Linux Compute Node”).

If you’re interested in the subscription type that’s used on the system, run

sudo subscription-manager list --consumed | grep "Roles:"

This will indicate the role of the system as subscribed.

  • sudo syspurpose show is empty: {}. How to configure this? I do not want the subscription type but the type of RHEL I have installed.
    – Muzammil
    Jun 15 at 10:08
  • See the update. Jun 15 at 10:16
  • Thanks but this is like we are telling it what role we want it to play. I may set up anything I want? One distribution cannot be workstation and server at the same time I guess. What I am interested to know the type of distribution installed. In the previous versions, you could get this info from /etc/redhat-release: unix.stackexchange.com/questions/146174/…
    – Muzammil
    Jun 15 at 10:33
  • The base system in RHEL 8 is the same in all roles. The role changes the subscriptions that are attached automatically to the system, but it’s only a hint. Jun 15 at 10:50

You can use subscription-manager list --consumed to view the subscription attached to your system. In the output of this command you will have a line starting with Subscription Name:. This line will tell you what kind of subscription you system is using. This is however not a guarantee that you system is indeed of the type indicated by the subscription.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.