所有操作系统有时都会死机,Ubuntu 也不例外。我该怎么做才能重新控制...
- 只有一个程序停止响应?
- 什么都没有响应鼠标点击或按键?
- 鼠标完全停止移动?
- 我有一个Intel Bay Trail CPU?
在决定拔掉电源插头之前,我应该按什么顺序尝试各种解决方案?
启动 Ubuntu 失败时我该怎么办?有我可以遵循的诊断程序吗?
所有操作系统有时都会死机,Ubuntu 也不例外。我该怎么做才能重新控制...
在决定拔掉电源插头之前,我应该按什么顺序尝试各种解决方案?
启动 Ubuntu 失败时我该怎么办?有我可以遵循的诊断程序吗?
If it locks up completely, you can REISUB it, which is a safer alternative to just cold rebooting the computer.
REISUB by:
While holding Alt and the SysReq (Print Screen) keys, type REISUB.
Some mnemonics for REISUB:
This is the SysReq key:
NOTE: There exists less radical way than rebooting the whole system. If SysReq key works, you can kill processes one-by-one using Alt+SysReq+F. Kernel will kill the mostly «expensive» process each time. If you want to kill all processes for one console, you can issue Alt+SysReq+K.
NOTE: You should explicitly enable these key combinations. Ubuntu ships with sysrq default setting 176 (128+32+16), which allows to run only SUB part of REISUB combination. You can change it to 1 (all commands enabled) or 244 which is potentially less harmful. To do this:
and switch 176 to 244; then
它会立即起作用!您可以通过按Alt++进行SysReq测试F。对我来说,它杀死了活动的浏览器选项卡,然后是所有扩展。如果你继续,你可以到达 X Server 重启。
Alt有关所有+SysReq功能的更多信息在这里。
当单个程序停止工作时:
当程序窗口停止响应时,您通常可以通过单击窗口左上方的 X 形关闭按钮来停止它。这通常会导致一个对话框显示程序没有响应(但您已经知道)并为您提供终止程序或继续等待它响应的选项。
有时这不能按预期工作。如果您无法通过正常方式关闭窗口,您可以按Alt+ F2,键入
xkill
,然后按Enter。然后,您的鼠标光标将变成X。将鼠标悬停在有问题的窗口上,然后单击鼠标左键将其杀死。右键单击将取消并使您的鼠标恢复正常。If your program is running from a terminal, on the other hand, you can usually halt it with Ctrl+C. If not, find the name and process ID of its command, and tell the program to end as soon as possible with
kill [process ID here]
. It sends the default signalSIGTERM
(15
). If all else fails, as a last resort sendSIGKILL
(9
):kill -9 [process ID here]
. Note that you should only useSIGKILL
as a last resort, because the process will be terminated immediately by the kernel with no opportunity for cleanup. It does not even get the signal - it just stops to exist.(Killing a process by
kill -9
allways works if you have the permission to kill. In some special cases the process is still listed byps
ortop
(as "zombie") - in this case, the program was killed, but the process table entry is kept, becuse it's needed later.)When the mouse stops working:
如果键盘仍然有效,请按Alt+F2并运行
gnome-terminal
(或者,如果无法启动,请按Alt++并使用您的用户名Ctrl和密码登录)。从那里你可以解决问题。我不打算在这里进行鼠标故障排除,因为我还没有研究过。如果您只想尝试重新启动 GUI,请运行. 这应该会关闭 GUI,然后它会尝试重生,将您带回登录屏幕。F1sudo service lightdm restart
当您拥有 Intel Bay Trail CPU 时
请参阅https://askubuntu.com/a/803649/225694。
当一切,键和鼠标以及所有东西都停止工作时:
First try the Magic SysReq method outlined in Phoenix' answer. If that doesn't work, press the Reset button on the computer case. If even that doesn't work, you'll just have to power-cycle the machine.
May you never reach this point.
You can make the shortcut Ctrl+Alt+Delete open the System Monitor, with which you can kill any unresponsive applications.
In the Command field, enter
gnome-system-monitor
. Name the shortcut whatever you want.Freezes such as you have described can be both software and hardware related and as you have found sometimes frustratingly difficult to diagnose.
Hardware
If this is a desktop PC look at your hardware-cards. For both laptops and desktops possibly acpi type issues.
It might be useful to temporarily simplify your configuration to have just the graphics card connected with a standard keyboard and mouse. All other cards should be removed.
For acpi related issues, try booting with
noapic nomodeset
in your grub boot option. Its also worth tryingacpi=off
although this could have other undesirable effects such as constant fan usage.Also worth checking the bios version level and seeing if the vendor has a newer bios version. The readme notes should hopefully reveal if any newer version fixed crashes and freezes.
Software
I note you have tried the standard 270 drivers but have failed due to freezes. Can you clarify if you had similar issues with the open-source driver? Obviously you will not get Unity during testing this.
Graphics freezing can be one of/or a combination of the driver/compiz/X/kernel
If you are willing to try any of the suggestions below first backup your system with a good backup tool such as CloneZilla. You will need an external media device to receive the image such as a large USB stick/drive or separate internal hard-drive.
Installing newer nVidia driver
Deactivate (uninstall) your current 173-nvidia driver using the Additional Drivers window.
There are a small number of important fixes primarily in the 275 stable but a small number also in the 280beta that fixed freezes - it is worth a shot to see if these apply to your graphics card. Unfortunately nvidia dont go into detail on which cards they specifically fix (readme.txt)
However - I would strongly recommend a backup unless you feel confident on reversing a nvidia install - especially since you had serious issues with the slightly older 270 drivers. I've used clonezilla countless times and it has always got me out of trouble. You do need a large external drive though - USB stick/external drive or a separate drive.
X Updates
The latest graphics drivers have been packaged in the x updates ppa.
Note - this will lead you away from the standard baseline - if upgrading in the future
ppa-purge
the PPA itself before upgrading.You can also manually install the drivers from nVidia:
Try installing the latest nvidia stable 275 or 280 drivers - 32bit 280 drivers: ftp site and 64bit: 280 drivers: ftp site
To Install
CTRL + ALT + F1 to switch to TTY1 and login
To stop the X server
To run as root
To install the 32bit driver (equiv for 64bit) then reboot.
To uninstall
Also remove
/etc/X11/xorg.conf
X/Kernel/Compiz
If you run classic Ubuntu with effects do you get the same freeze issues as standard Ubuntu? If you cannot reproduce the freeze with classic Ubuntu (no effects) then this will point you towards a compiz issue. I would raise a launchpad bug report with the compiz team.
If space is available (e.g. 20Gb), you could dual boot/install alongside the latest oneiric alpha. Obviously this will itself be unstable, but it will come with the latest X and Kernel. You may need to also install manually the beta 280 graphics drivers above since it probably will not be offered in the Additional Drivers window.
If during testing you dont see the same freeze activity you could try uplifting your X version with the x-edgers ppa and using kernel kernel 3.0 in Natty. Going this route is not really desirable - and could cause you upgrade issues in the future - and may have other unforeseen stability issue. Again, use
ppa-purge
to remove the PPA.Kernel 3.0 is packaged with the PPA - you'll need to install the headers as well as the kernel itself from synaptic BEFORE rebooting if you intend to install the nvidia drive later.
This is a testing ppa - do have a ready backup if you want to try this route.
If you're getting a lot of freezes, there might be something wrong with your hardware. I used to get hard lockups every 48 hours due to some less than optimal RAM. Memtest86+ showed the fault after 40 minutes of testing. Swapped the RAM out for some more (under warranty) and I'm now at 32 days, 1 hour of uptime.
Ubuntu doesn't tend to leak its guts all over your memory like Windows can over time. Even if one application or a poor X video driver does, you can restart LigthtDM very simply and just keep going and going and going. I've actually been through three beta versions of the nvidia driver in this one boot :)
Anyway... While knowing how to restart softly is a very handy thing, finding, reporting and fixing the system should be your next priority. If it's an always-on system, you should easily be able to make it between kernel updates* without needing a restart.
*You should restart when you get kernel updates as they'll be security fixes that won't be applied until you reboot into the newer kernel.
当一切都停止工作时,首先尝试Ctrl++Alt转到F1终端,在那里您可能会杀死 X 或其他有问题的进程。
如果即使这样也不起作用,请尝试在按住的同时按住Alt+ SysReq(慢慢地,每次之间间隔几秒钟)R E I S U B。
这会将键盘置于原始模式,以各种状态结束任务,同步磁盘等,最后重新启动机器。这样做比仅仅拔掉插头会得到更好的结果。当然,如果这失败了,你几乎只能拔掉插头了。
Also, sometimes it's simply the X-Server which hangs - a case I've most often found when you're using Compiz.
If this is the case you can kill X, which will restart and drop you back at the log-in screen.
The default sequence is Ctrl + Alt + Backspace
Although this is turned off by default (presumably new-users were accidentally hitting it) and can be turned back on like this:
System
→Keyboard
(i.e. the Keyboard Preferences Dialogue)My first favourite when total freeze occured - Alt + SysRq + K.
That combo kills X, and returns me to the graphical login screen. If that doesn't work, try Alt + SysRq + R E I S U B.
In such cases you can try CTRL-ALT-F1 to get to a console. Then login with your password.
Restarting the GUI
You can try to restart your graphical desktop with:
If you're running Ubuntu 11.04 or earlier, you should use this instead (as
gdm
used to be the default display manager):If you're using Kubuntu instead, then the default display manager is
kdm
, so you should instead use:If you're using another display manager, replace
ligthdm
/gdm
/kdm
with its name.Restarting the Machine
If you want to do a clean system reboot, use:
DoR and Phoenix has answered this well. To make this page more complete I would add:
If it is only X that is "broken", than you can use kernel to kill it:
SysRq + Alt + K
For laptops (depends on the model, typically needed if "SysRq" is written in blue):
Fn + SysRq + Alt + K (release Fn after pressing SysRq).