Home  >  Article  >  Operation and Maintenance  >  How to start the graphical interface in centos?

How to start the graphical interface in centos?

coldplay.xixi
coldplay.xixiOriginal
2020-07-06 15:53:5117913browse

How to start the graphical interface in centos: first install the complete set of software packages through the yum group command; then install the graphical desktop environment through KDE; finally open the graphical interface, the code is [[root@bogon ~] # init 5].

How to start the graphical interface in centos?

How to start the graphical interface in centos:

1. yum group command

yum can install a complete set of software packages in program group mode. Supported software packages can be queried through,

# yum grouplist

. In the group software package, Desktop, Desktop Platform, KDE Desktop, and X Window System are the main desktop environments.

The software package list is displayed according to the language used by the system, and simplified Chinese file names are supported. Therefore, it is best to use the above command to check before installation. If the system uses Simplified Chinese and the installation instructions use English, it may cause errors such as the software package cannot be found. The installation instructions below are all in English.

2. Graphical desktop environment

To install the KDE desktop environment, execute the command,

# yum groupinstall "X Window System" "KDE Desktop" Desktop

, and 3 software packages are installed at the same time. Note that because both KDE Desktop and X Window System package names contain spaces, they need to be enclosed in quotation marks.

To install the Gnome desktop environment, execute the command,

# yum groupinstall "X Window System" "Desktop Platform" Desktop

, and 3 software packages are installed at the same time, of which X Window System is necessary, whether it is Gnome or KDE.

Since it is a desktop environment, you may also need fonts, management tools, etc., such as,

# yum -y groupinstall "Graphical Administration Tools"
# yum -y groupinstall "Internet Browser"
# yum -y groupinstall "General Purpose Desktop"
# yum -y groupinstall "Office Suite and Productivity"
# yum -y groupinstall "Graphics Creation Tools"

3. Enable

from the command line Start the graphical desktop environment directly,

# startx

This will start the default Gnome or KDE desktop environment. If someone likes to install Gnome and KDE at the same time, you can refer to the CentOS documentation for switching methods.

If you want to automatically boot to the graphical desktop at startup, you need to modify the startup configuration. Because CentOS 7 starts using the systemd manager, its operation is different from previous versions.

Centos6.x

1, Close the graphical interface:

    [root@bogon ~]# init 3

// Close the graphical interface (XServer service will also be closed)

2. Open the graphical interface:

   [root@bogon ~]# init 5

or

   [root@bogon ~]# startx

//Enter the first graphical interface (if there are multiple)

3. When booting, X Window is not entered by default:

   [root@bogon ~]# vim /etc/inittab

Find id:5:initdefault:

Change to id: 3:initdefault:

If the permissions are not enough, switch to the root account to modify it

In CentOS 7, you can directly use the systemd command to modify the startup destination state.

Used,

# systemctl get-default

can query the currently set status. multi-user.target is equivalent to the previous level 3, which is the command line terminal; and graphical.target is equivalent to the previous level 5, which is the graphical interface.

So if you want to set the default startup to the graphical interface, execute,

# systemctl set-default graphical.target

Related learning recommendations: centos tutorial

The above is the detailed content of How to start the graphical interface in centos?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn