當我們在Ubuntu下載 cursor 這套編輯工具並進行以下步驟安裝時:
sudo apt-get install libfuse2
chmod +x cursor-0.42.5x86_64.AppImage
./cursor-0.42.4x86_64.AppImage
sudo mv cursor-0.42.5x86_64.AppImage /opt/cursor.appimage
sudo vim /usr/share/applications/cursor.desktop
[Desktop Entry]
Name=Cursor
Exec=/opt/cursor.appimage
Icon=/opt/cursor.png
Type=Application
Categories=Development;
sudo apt-get install libfuse2
chmod +x cursor-0.42.4x86_64.AppImage
./cursor-0.42.4x86_64.AppImage
sudo mv cursor-0.42.4x86_64.AppImage /opt/cursor.appimage
sudo vim /usr/share/applications/cursor.desktop
[Desktop Entry]
Name=Cursor
Exec=/opt/cursor.appimage
Icon=/opt/cursor.png
Type=Application
Categories=Development;
照著步驟安裝完之後, 啟動 /opt/cursor.appimage 卻無法啟動, 這是怎麼回事呢🤔?
/opt/cursor.appimage
[217643:1118/121303.107311:FATAL:setuid_sandbox_host.cc(158)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /tmp/.mount_cursorKv0jd5/chrome-sandbox is owned by root and has mode 4755
SUID Sandbox 問題, 需要一個特殊的可執行檔案 chrome-sandbox,該檔案必須有 SUID 權限 (4755),並且歸屬於 root 使用者。
首先我們解包並更改chrome-sandbox權限
# 解包
./cursor.appimage --appimage-extract
cd squashfs-root
sudo chmod 4755 chrome-sandbox
sudo chown root:root chrome-sandbox
./AppRun
驗證可行之後, 我們試著將整包目錄移動到/opt底下
mv squashfs-root /opt/cursor
接著再次更改一下桌面啟動的位置
sudo vim /usr/share/applications/cursor.desktop
[Desktop Entry]
Name=Cursor
Exec=/opt/cursor/cursor %U
Icon=/opt/cursor.png
Type=Application
Categories=Development;
./cursor.appimage --no-sandbox
Linux系統真的是博大精深, 光是安裝程式就有許多種方法, 雖然非常的靈活彈性, 但也相對需要更多的背景知識來支持, 幸虧有ChatGPT、Gemini這類的AI助理, 讓我們更加快速的找到相關的知識與解答。