How to restart gnome
How to restart gnome
Сеанс Gnome заморожен, есть несколько вариантов его перезапуска
В следующей статье мы рассмотрим что мы можем сделать, если мы столкнемся с зависшей сессией Gnome. В настоящее время многие люди используют Gnome Shell, поскольку она надежна, проста в использовании, работает быстрее и быстрее. Однако даже у лучших столов есть проблемы.
Возможно, самая поразительная и изнурительная проблема, от которой страдает Gnome, заключается в том, что многие пользователи замораживают свою сессию. В следующих строках мы увидим, что делать, когда у нас есть замороженный сеанс рабочего стола Gnome.
Как перезапустить замороженный сеанс Gnome
Метод 1: перезапустить X11
Gnome Shell имеет встроенную функцию перезапуска. Пользователи могут запустить его, чтобы перезапустить зависший рабочий стол. Единственный недостаток в том, что это не работает с Wayland, поэтому мы должны использовать «Xorg Чтобы это работало.
Чтобы перезапустить сеанс Gnome Shell, пока все заморожено, мы начнем нажатие комбинации клавиш Alt + F2. Это вызовет окно, в котором мы можем писать команды.
В этом окне нам останется только написать ‘r«. Эта команда в основном перезапускает сеанс, не закрывая его.
Мы сможем делать это столько раз, сколько захотим, если однократный перезапуск не решит проблему.
Метод 2: перезапуск Wayland
Если вы используете Wayland для Gnome вы заметите хорошую производительность, но даже несмотря на это сеанс могут вылетать. К несчастью, здесь функция сброса не работает. Чтобы восстановить контроль над командой, нужно будет сделать еще больше.
Чтобы перезапустить сеанс, в этом случае мы не сможем работать в среде рабочего стола Gnome. Вместо Нам нужно будет использовать консоль TTY и принудительно перезапустить администратора рабочего стола, который обрабатывает Gnome, и, таким образом, иметь возможность перезапустить сеанс.. Чтобы открыть консоль, мы можем использовать комбинации клавиш Ctrl + Alt + F2 o Ctrl + Alt + F3.
Оказавшись в окне консоли TTY, нам нужно будет войти в систему. Если все правильно, мы получим доступ к командная строка в режиме телетайпа. Отсюда нам нужно будет следовать пошаговым инструкциям, чтобы перезапустить наш сеанс:
Paso 1: В лице systemctl команда остановки, мы остановим выполнение диспетчера экрана Gnome. Сделай это автоматически выйдет из Gnome Shell:
Если вы используете LightDM с Gnome вместо команды вам нужно будет использовать:
Paso 2: При выполнении команды остановки, gdm или lightdm перестанут работать. Отсюда мы будем начни это снова используя команду запуска:
Для LightDM команда для выполнения будет:
Если команды выполняются правильно, мы должны увидеть экран входа в Gnome. Оттуда мы можем снова войти в систему.
Метод 3: использование gnome-shell –replace
Если вы пробовали вышеуказанные методы Xorg и Wayland и все еще не смогли решить проблемы, есть еще третий способ перезапустить сеанс Gnome Shell, пока он заморожен. Аргумент «замещать«Это работает аналогично тому, что мы сделали с Wayland, поскольку должен быть запущен на терминале TTY. Мы будем обращаться к нему с помощью комбинаций клавиш Ctrl + Alt + F2 или Ctrl + Alt + F3.
Как я там читал, это решение работает со всеми версиями Gnome Shell, в том числе Wayland.
Внутри терминала TTY мы собираемся войти в систему с нашим пользователем и следовать следующим инструкциям:
Сначала мы собираемся создайте файл с именем «гном-перезагрузка с помощью сенсорной команды:
Следующее будет используйте команду echo. С помощью которого мы собираемся добавить код сброса в файл гном-перезагрузка, написав в терминале сначала строку:
А затем эта другая строка:
Мы обновим права доступа к файлам ‘гном-перезагрузка« который мы только что создали, чтобы мы могли запускать его как программу с терминала:
Следующее будет переместить файл ‘гном-перезагрузка‘ к / usr / bin /. Таким образом, мы получим, что система может вызывать его как программу:
С терминала TTY нам нужно будет запись гном-перезагрузка чтобы перезапустить сеанс Gnome Shell замороженный. Мы также можем выполнить эту команду прямо с рабочего стола Gnome, нажав Alt + F2, чтобы открыть командное окно, в котором мы напишем:
После успешного выполнения команды наш сеанс должен снова работать.
Метод 4: использование Killall
После всего сказанного, когда сеанс Gnome вылетает из строя, я думаю, что это самый простой способ его перезапустить. Нам останется только написать на телетайпе:
Вышеупомянутую команду мы также можем используйте его как псевдоним в файле
После сохранения файла когда сеанс рабочего стола заморожен, из TTY нам нужно будет только написать:
С помощью этой команды мы принудительно закрываем заблокированный сеанс.
Содержание статьи соответствует нашим принципам редакционная этика. Чтобы сообщить об ошибке, нажмите здесь.
Полный путь к статье: Убунлог » Ubuntu » Сеанс Gnome заморожен, есть несколько вариантов его перезапуска
How to restart Gnome Shell after a crash short of killing X?
5 Answers 5
Switch back to the GUI with ctrl+alt+7. (Normally gnome-shell will automatically restart for me.)
I will assume you are running 3.2 Currently due to the obvious bugs the best thing to do is 1 of the following.
The first thing to do is create a seperate profile in whatever terminal you have as default, or whichever it would be if you opened a terminal from your file browsers right click menu. Try to name this profile something you will notice like Restart Shell. In this new profile you want to set it to ‘Run a custom command instead of my shell’, you would find this in Gnome Terminal under Edit>Profile Preferences>Title and Command. Check the box and insert
Next do one of the follwing when you run into a crash. Always remember to keep the terminal running once it’s open.:
a) Keep a browser open. Example, Firefox is open, no Title Bars and you can’t restart, close anything that might be blocking the focus of Firefox. In FF click Tools>Downloads and find a recent download, right click on it and click Open Containing Folder. Now right click and Open in Terminal. It will now either open your default profile or you will right click and select the Restart Shell profile and open a new tab, thus automatically starting a new shell. You must now keep the terminal open.
b) always keep a terminal open. Then when you crash, you just select the alternate profile, and open a new tab which should launch that profile and the command to start a new shell.
c) In empathy and pidgin, perhaps other IM clients as well, type file:/// and hit enter. This will allow you to click the link and should open your file browser(Nautilus). If not, try right clicking on it and selecting the appropriate action. From the browser you open the terminal by right clicking.
All of these options can come in handy and help prevent a lot of frustration. One thing to remember is sometimes to get to the window you need, i.e Firefox, since everything might be blocking focus; File>Exit, should normally do the trick.
How to Restart a Frozen Desktop in Linux
While Linux has a reputation for being stable, able to keep chugging along for years, there are times when the desktop will just freeze and stop responding to input. One of the most common solutions to fix a frozen desktop is to restart the PC. An easier way is to just restart the desktop.
Let’s see how to do this on three of the most popular desktop environments: Gnome, KDE, and XFCE. We will be using Ubuntu (Kubuntu/Xubuntu) for this illustration.
Restart Gnome in Ubuntu
This will restart your desktop environment without much fuss. If your desktop doesn’t respond to your input, though, you will have to take more drastic measures.
Press Ctrl + Alt + F3 to access the first terminal outside of your desktop environment.
Enter the following command to restart the Gnome desktop environment:
Press Ctrl + Alt + F2 to move back to the desktop and, if everything goes according to the plan, a refreshed version of your desktop will be waiting for you.
If that doesn’t work, you can try restarting the display manager. Since the display manager is the “base” on which the desktop environment runs, by restarting it, you also end up reloading the desktop environment. To do that, go back to the terminal and enter the following:
Note that this fully reloads the desktop environment, so you will have to log in again from scratch.
Restart KDE in Kubuntu
Restarting the KDE desktop environment follows the same approach as Gnome, but there are small differences in the individual steps you will have to take.
For starters, and at least in Kubuntu, the first available terminal outside your desktop environment is tty2, so you will have to use the Ctrl + Alt + F2 combination to get there.
In the latest versions of KDE, the proper way to restart the desktop from the terminal is:
If that doesn’t work, you can also try:
If that fails as well, it’s worth trying to restart the display manager itself as a last option before rebooting your whole PC. Try it out with:
Note, though, that this forced-restart of the desktop environment may also lead to the appearance of some error messages.
Restart XFCE in Xubuntu
With XFCE being a much simpler desktop environment than Gnome and KDE, restarting it is also easier.
The primary desktop element of XFCE – and the most probable to freeze – is its panel. To restart it, if your desktop is still somewhat responsive, fire up a terminal by using the Ctrl + Alt + T combination and type:
This command will “kill” the panel. To reload it, enter:
To restart the whole window manager, move to the first available terminal outside your desktop. (On the Xubuntu installation, it was the first one, accessible with the Ctrl + Alt + F1 combination.) There, try the official approach:
If that doesn’t work, try the more forceful approach:
Hopefully, your desktop will be back up and running, waiting for you.
The above methods should help you get out of a frozen desktop situation very easily. Do also check out the keyboard shortcut for GNOME to better navigate the desktop.
Our latest tutorials delivered straight to your inbox
How To Restart GNOME Shell From Command Line Without Closing Any Applications (X11 Only)
This article explains how to restart GNOME Shell from the command line, without closing any applications (X11 only).
GNOME Shell can be restarted without closing all applications only on X11 (used by default on Ubuntu for example); under Wayland (which is what Fedora uses by default for example), GNOME Shell is the display server, and if the display server goes down, all running applications go down as well, so this doesn’t work. If you use this under Wayland, the session is restarted, closing all running applications.
But what if you want to restart GNOME Shell from the command line without closing all applications? This can be useful in a script, or attach the command to a keyboard shortcut so you can restart GNOME Shell in case it freezes / becomes unresponsive, etc.
The command-line equivalent of pressing Alt + F2 and then typing r is the following (so this command restarts GNOME Shell without closing any running applications):
In case this doesn’t work for some reason, another command that should restart GNOME Shell is:
This keeps some running applications, but others are closed. Also, if you keep running this, GNOME Shell might detect that something went wrong and disable all your extensions, logging you out in the process. So this command is not perfect, that’s why I don’t recommend using it unless you really have to.
So what does this HUP signal do? This is sent to a program to request it to restart and re-read its configuration.
How to restart GNOME Shell from command line?
I would like to implement a keyboard shortcut to restart gnome-shell whenever this one crashes (some bugs aren’t currently fixed just yet). For this I would need a command line to restart the shell.
The Alt + F2 and restart command won’t work when the shell is crashed because the prompt is implemented in the shell.
Hence, how to restart the gnome-shell from command line?
10 Answers 10
GNOME Shell 3.30.1 on Ubuntu 18.10
The command to replace gnome-shell would be sending a SIGQUIT signal to it with:
As of GNOME Shell 3.30.1 on Ubuntu 18.10, the solution below no longer works, and will kick the user to the login screen, losing all of their work.
Before GNOME Shell 3.30.1
The command to replace gnome-shell would be:
The ampersand is added to return the shell prompt after running the command; pressing Ctrl + C or closing the terminal instead would make the desktop unusable, and require a full restart.
From the manual page of gnome-shell :
Unsure which version you are using?
The command to check your GNOME Shell version is:
In case the whole gnome-shell got frozen there is a way how to restart it from the terminal without restarting the whole X window:
The Gnome 40 the equivalent of Alt+F2 restart is:
I came up with this function to logout users (see at the bottom)
You can give it multiple usernames:
And you can give it additional options:
So, I have the following helper function:
Источники информации:
- http://askubuntu.com/questions/102118/how-to-restart-gnome-shell-after-a-crash-short-of-killing-x
- http://www.maketecheasier.com/restart-frozen-desktop-linux/
- http://www.linuxuprising.com/2020/07/how-to-restart-gnome-shell-from-command.html
- http://askubuntu.com/questions/100226/how-to-restart-gnome-shell-from-command-line