• 设置开机默认图形启动


     设置开机默认图形启动

     - systemctl set-default graphical.target
     

    备注:如果想设置默认字符界面,需要如下命令:

    systemctl set-default multi-user.target


    # systemctl get-default
    graphical.target
     

    # ll /usr/lib/systemd/system/default.target
    lrwxrwxrwx. 1 root root 16 3月 26 23:59 /usr/lib/systemd/system/default.target -> graphical.target

     


    复制代码
    [root@localhost ~]# systemctl get-default
    graphical.target
    [root@localhost ~]# systemctl set-default multi-user.target
    Removed symlink /etc/systemd/system/default.target.
    Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/multi-user.target.
    [root@localhost ~]# systemctl get-default
    multi-user.target
    复制代码

    使用systemctl get-default可以获得当前的默认target; 
    使用systemctl set-default可以设置默认target,target可以是graphical.target、multi-user.target

    //graphical.target表示开机将默认进入图形界面 
    //multi-user.target表示开机将默认进入文本界面

    rm -f /etc/systemd/system/default.target

    设置命令行级别方法: 
    ln -sf /lib/systemd/system/runlevel3.target /etc/systemd/system/default.target 
    或 
    ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target 
    或 
    systemctl set-default multi-user.target

    改回窗口级别方法: 
    ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target 
    或 
    ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target 
    或 
    systemctl set-default graphical.target 

     ----------------------------------------------------------------------------------------------------------------------------------

    网上各种策略将编辑 inittab文件,从 5--》3即可,centos 7 之后 用系统

    graphical.target

    复制代码
    "/etc/inittab" 17L, 511C                                                                                                                             17,1         全部
    # inittab is no longer used when using systemd.
    #
    # ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
    #
    # Ctrl-Alt-Delete is handled by /usr/lib/systemd/system/ctrl-alt-del.target
    #
    # systemd uses 'targets' instead of runlevels. By default, there are two main targets:
    #
    # multi-user.target: analogous to runlevel 3
    # graphical.target: analogous to runlevel 5
    #
    # To view current default target, run:
    # systemctl get-default
    #
    # To set a default target, run:
    # systemctl set-default TARGET.target
    复制代码

    重启系统,就进入命令行模式了。

     
  • 相关阅读:
    django类视图MRO
    ThreadPoolExecutor 多线程
    数论-最小公倍数、整数的唯一分解定理、一次不定方程
    buuctf-level4
    数论-整除+欧几里得+扩展欧几里得
    第三届江西省网络安全大赛-部分Crypto
    网鼎杯-re-signal
    nebula 星云模拟器适配 xbox手柄;星云模拟器支持xbox手柄;星云模拟器xbox手柄配置;
    git 上传大文件;remote: fatal: pack exceeds maximum allowed size
    Kawaks 项目文件整理
  • 原文地址:https://www.cnblogs.com/xuanbjut/p/12599375.html
Copyright © 2020-2023  润新知