taka.

taka./Rocky Linux の runlevel (GUI/CUI 環境起動変更) を変更する

Created at Updated at
239 Words 1 min

はじめに

自宅ラボ環境の Rocky Linux の runlevel を変更し、 GUI から CUI 環境起動に変更した時の手順を備忘のため、記載する。

 

この記事を読んで欲しい人

  • Rocky Linux の runlevel を変更したい人

 

設定手順

  1. runlevel の定義を確認

    cat /etc/inittab
    
    # inittab is no longer used.
    #
    # 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
    

     

  2. 現在の runlevel 設定を確認
    例では GUI 環境起動となっている

    sudo systemctl get-default
    
    graphical.target
    

     

  3. multi-user.target (CUI 環境起動)に変更

    sudo systemctl set-default multi-user.target
    
    Removed '/etc/systemd/system/default.target'.
    Created symlink '/etc/systemd/system/default.target' → '/usr/lib/systemd/system/multi-user.target'.
    

     

  4. 再起動
    再起動後に CLI に切り替わっていることを確認

    sudo reboot
    

     

環境

  • Rocky Linux 10.0