[Linux] 不小心移除了 CentOS 7 的 GNOME Desktop!重新安裝回來
今天想要在 CentOS 7 上安裝 samba server,卻怎麼樣都設定不好,
後來看了一篇文章,裡面有個步驟是先移掉舊的 samba 元件,
於是我就照著在 terminal 裡面,執行 yum remove samba*:
testuser@localhost ~ $ sudo yum remove samba* ...... Dependencies Resolved ================================================================================================== Package Arch Version Repository Size ================================================================================================== Removing: samba x86_64 4.4.4-12.el7_3 @updates 1.8 M samba-client x86_64 4.4.4-12.el7_3 @updates 1.7 M samba-client-libs x86_64 4.4.4-12.el7_3 @updates 18 M samba-common noarch 4.4.4-12.el7_3 @updates 122 k samba-common-libs x86_64 4.4.4-12.el7_3 @updates 274 k samba-common-tools x86_64 4.4.4-12.el7_3 @updates 1.1 M samba-dc x86_64 4.4.4-12.el7_3 @updates 964 samba-dc-libs x86_64 4.4.4-12.el7_3 @updates 964 samba-debuginfo x86_64 4.4.4-12.el7_3 @base-debuginfo 161 M samba-devel x86_64 4.4.4-12.el7_3 @updates 1.4 M samba-krb5-printing x86_64 4.4.4-12.el7_3 @updates 29 k samba-libs x86_64 4.4.4-12.el7_3 @updates 709 k samba-pidl noarch 4.4.4-12.el7_3 @updates 438 k samba-python x86_64 4.4.4-12.el7_3 @updates 11 M samba-test x86_64 4.4.4-12.el7_3 @updates 6.8 M samba-test-libs x86_64 4.4.4-12.el7_3 @updates 75 k samba-vfs-glusterfs x86_64 4.4.4-12.el7_3 @updates 38 k samba-winbind x86_64 4.4.4-12.el7_3 @updates 1.5 M samba-winbind-clients x86_64 4.4.4-12.el7_3 @updates 128 k samba-winbind-krb5-locator x86_64 4.4.4-12.el7_3 @updates 12 k samba-winbind-modules x86_64 4.4.4-12.el7_3 @updates 83 k Removing for dependencies: cifs-utils x86_64 6.2-9.el7 @base 175 k control-center x86_64 1:3.14.5-19.el7 @base 17 M gdm x86_64 1:3.14.2-19.el7 @base 3.2 M gnome-classic-session noarch 3.14.4-21.el7 @base 78 k gnome-initial-setup x86_64 3.14.4-5.el7 @base 2.0 M gnome-shell x86_64 3.14.4-53.el7 @base 9.3 M gnome-shell-extension-alternate-tab noarch 3.14.4-21.el7 @base 9.9 k gnome-shell-extension-apps-menu noarch 3.14.4-21.el7 @base 27 k gnome-shell-extension-common noarch 3.14.4-21.el7 @base 525 k gnome-shell-extension-launch-new-instance noarch 3.14.4-21.el7 @base 4.9 k gnome-shell-extension-places-menu noarch 3.14.4-21.el7 @base 22 k gnome-shell-extension-window-list noarch 3.14.4-21.el7 @base 60 k gnome-tweak-tool noarch 3.14.3-2.el7 @base 907 k gvfs-smb x86_64 1.22.4-8.el7 @base 90 k ipa-client x86_64 4.4.0-14.el7.centos.4 @updates 359 k kde-baseapps x86_64 4.10.5-4.el7 @base 9.7 M kde-baseapps-libs x86_64 4.10.5-4.el7 @base 1.4 M kde-runtime x86_64 4.10.5-8.el7 @base 14 M kde-runtime-drkonqi x86_64 4.10.5-8.el7 @base 518 k kde-runtime-libs x86_64 4.10.5-8.el7 @base 5.0 M konsole-part x86_64 4.10.5-4.el7 @base 1.2 M libsmbclient x86_64 4.4.4-12.el7_3 @updates 156 k libwbclient x86_64 4.4.4-12.el7_3 @updates 71 k orca x86_64 3.6.3-4.el7 @base 13 M pulseaudio-gdm-hooks x86_64 6.0-8.el7 @base 354 python-smbc x86_64 1.0.13-7.el7 @base 60 k sssd x86_64 1.14.0-43.el7_3.11 @updates 34 k sssd-ad x86_64 1.14.0-43.el7_3.11 @updates 327 k sssd-common-pac x86_64 1.14.0-43.el7_3.11 @updates 152 k sssd-ipa x86_64 1.14.0-43.el7_3.11 @updates 586 k system-config-printer x86_64 1.4.1-19.el7 @base 1.3 M Transaction Summary ================================================================================================== Remove 21 Packages (+31 Dependent packages)
yum 出來的結果好長一串,仔細看的話,
yum 除了要移掉 samba 之外,還會把其他相依於 samba 元件的東西都移除掉,
像是 gdm, gnome-shell 等等一堆有的沒的,
但我那時沒仔細看,按下了 Yes…
這下子可不得了了,yum 才移除東西到一半,CentOS 的 GUI 畫面就突然消失,
閃了幾下之後,進入了久違的 multi-user 純文字模式…
一下子慌了手腳,我可是得靠 GUI 才能在 Linux 上活下去的呀 (<– 被 Windows 慣壞的小孩)
試著執行 yum install samba* 把 samba 的元件都再裝回去,但沒有用…
後來查到要先將 GNOME Desktop 這個群組的元件都先裝起來:
sudo yum groupinstall "GNOME Desktop"
GNOME Desktop 元件都安裝好了之後,執行 startx 是可以進入 GUI 畫面,
但是重開機的話,還是進到了 multi-user 純文字模式…
原來這是因為 gdm (GNOME Display Manager) 服務被停用的關係,
將它啟用、並且設定開機時使用圖形介面就行了:
sudo systemctl enable gdm sudo systemctl set-default graphical.target
這樣子再重新開機後,果然就回復原狀,以 GUI 方式登入了~
真是太好了,不用因為一個小錯誤搞到重灌呀~~
參考資料:
Install Gnome GUI on CentOS 7 / RHEL 7
Enable graphical login in CentOS 7
(本頁面已被瀏覽過 1,970 次)