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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

startx: command not found

by Deepika

startx is a command used to start the X Window System on Unix-like operating systems. It is a script that is used as a front end to the xinit command and provides a user-friendly interface to run X server and client applications.

When the startx command is executed, it checks for a configuration file called ~/.xinitrc and runs the commands listed in it. Typically, this file contains a list of window managers, desktop environments, and other X client applications that the user wants to run when the X server is started.

The startx script performs several tasks, such as checking the user’s environment, setting up the X server, and launching a session manager or window manager. It also sets up the default X Window System fonts, keyboard mapping, and other basic configuration options.

The startx command is commonly used on Linux and other Unix-like systems, as it provides an easy way to start the X Window System without requiring the user to manually configure the system. It is often used in conjunction with display managers like gdm, kdm, or xdm, which provide graphical login interfaces for users.

If you encounter the below error while running the command startx:

startx: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install xinit
Ubuntu apt-get install xinit
Alpine apk add xinit
Arch Linux pacman -S xorg-xinit
Kali Linux apt-get install xinit
CentOS yum install xorg-x11-xinit
Fedora dnf install xorg-x11-xinit
Raspbian apt-get install xinit

startx Command Examples

1. Start an X session:

# startx

2. Start an X session with a predefined depth value:

# startx -- -depth value

3. Start an X session with a predefined dpi value:

# startx -- -dpi value

4. Override the settings in the `.xinitrc` file and start a new X session:

# startx /path/to/window_manager_or_desktop_environment

Filed Under: Linux

Some more articles you might also be interested in …

  1. gh api: Makes authenticated HTTP requests to the GitHub API and prints the response
  2. CentOS / RHEL : How to set chroot jail for vsftp for all the users
  3. vgcreate: command not found
  4. lslogins Command Examples in Linux
  5. How To Configure NIS (Network Information System) Master and Slave Servers in CentOS/RHEL
  6. How to uninstall lammps package from Ubuntu
  7. lsns: command not found
  8. apt-file Command Examples in Linux
  9. fdroidcl – F-Droid CLI client
  10. Audit rules to log reboot command executions in CentOS/RHEL

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright