• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to resolve the error “-bash: xclock: command not found” in CentOS / RHEL

by admin

xclock is a handy tool to test if the DISPLAY variable is set properly and you can get a GUI based clock on running the “xclock” command as shown below. The package xorgs-x11-apps provides the xclock command.

xclock command not found linux CentOS RHEL

Installing the package providing the xclock command

1. Check the package which provides the binary, using below command:

# yum whatprovides xclock
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.cisp.com
 * epel: mirror.cogentco.com
 * extras: mirror.cs.vt.edu
 * nux-dextop: li.nux.ro
 * updates: mirror.vtti.vt.edu
xorg-x11-apps-7.7-7.el7.x86_64 : X.Org X11 applications
Repo        : base
Matched from:
Provides    : xclock

2. As you can see in the output above, the package xorgs-x11-apps provide the xclock command. To install the xorg-x11-apps package run the below command.

# yum install xorg-x11-apps
...
===================================================================================================================================================================
 Package                                    Arch                                Version                                    Repository                         Size
===================================================================================================================================================================
Installing:
 xorg-x11-apps                              x86_64                              7.7-7.el7                                  base                              307 k
Installing for dependencies:
 libXaw                                     x86_64                              1.0.13-4.el7                               base                              192 k
 libXpm                                     x86_64                              3.5.12-1.el7                               base                               55 k
Transaction Summary
===================================================================================================================================================================
Install  1 Package (+2 Dependent packages)
Total download size: 554 k
Installed size: 1.3 M
Is this ok [y/d/N]: y
Downloading packages:
(1/3): libXpm-3.5.12-1.el7.x86_64.rpm                                                                                                       |  55 kB  00:00:00     
(2/3): xorg-x11-apps-7.7-7.el7.x86_64.rpm                                                                                                   | 307 kB  00:00:00     
(3/3): libXaw-1.0.13-4.el7.x86_64.rpm                                                                                                       | 192 kB  00:00:01
...

Filed Under: Linux

Some more articles you might also be interested in …

  1. Unmounting a Windows Share Fails in Linux
  2. CentOS / RHEL 7 : GRUB2 configuration file /boot/grub2/grub.cfg explained
  3. chown: command not found
  4. whois Command Examples in Linux
  5. who Command Examples in Linux
  6. exif Command Examples in Linux
  7. How to Disable rpc.quotad Service in CentOS/RHEL
  8. hardinfo Command Examples in Linux
  9. “mlock failed: Cannot allocate memory” lvcreate command error in CentOS/RHEL 7
  10. “kernel: INFO: task {PROCESS}:{PID} blocked for more than 120 seconds.” – CentOS/RHEL Troubleshooting

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright