You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何启动Emacs图形界面?Ubuntu 14.04下启动异常求助

Fixing Emacs GUI Not Launching on Ubuntu 14.04

Hey there, I've run into this exact issue on Ubuntu 14.04 before—let's walk through some troubleshooting steps to get Emacs' graphical interface working:

  • Verify you installed the GUI-enabled Emacs package
    Sometimes sudo apt-get install emacs pulls in the headless emacs-nox package by default depending on your repositories. Check which package you have installed with:

    dpkg -l | grep emacs
    

    If you only see emacs-nox and no entries like emacs-gtk or emacs24-gtk, install the GUI version explicitly:

    sudo apt-get install emacs-gtk
    

    This package is compiled for GTK, which plays nicely with Ubuntu's Unity desktop.

  • Check the DISPLAY environment variable
    Emacs' GUI relies on the X Window System, and the DISPLAY variable tells it which X server to use. In a local terminal, run:

    echo $DISPLAY
    

    You should see something like :0 or :0.0. If it's empty, your terminal isn't connected to the X server (this happens if you're in a pure text TTY or SSHing without X forwarding). For a local desktop, manually set the variable and try again:

    export DISPLAY=:0
    emacs testfile
    
  • Force Emacs to launch the GUI with command-line flags
    If the package and DISPLAY check out, use these flags to bypass terminal-mode defaults:

    • Use -c to create a new graphical frame directly:
      emacs -c testfile
      
    • Or explicitly specify the display device:
      emacs --display :0 testfile
      
  • Rule out configuration issues
    Old or misconfigured Emacs settings can force terminal mode. Test launching Emacs without loading your config:

    emacs -q testfile
    

    If the GUI pops up now, your ~/.emacs or ~/.emacs.d/ folder has a setting causing the problem. Back up your config and gradually reintroduce settings to find the culprit (look for lines modifying initial-terminal-frame-alist or forcing terminal-specific behavior).

  • Check if your system's GUI environment is working
    If none of the above works, test another graphical app like gedit testfile. If that also fails, the issue isn't with Emacs—it's a problem with Ubuntu's Unity desktop or Xorg server. Try restarting your desktop or checking Xorg logs for errors.

内容的提问来源于stack exchange,提问作者Mike S

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 06:38:43