從原始碼編譯安裝 GDB 後,執行 make uninstall 卻提示 the uninstall target is not supported in this tree。這是 GDB 建置系統的已知限制,本文提供逐目錄手動卸載的替代方案。
bash-3.2# make uninstall
the uninstall target is not supported in this tree
GDB 的 Makefile 未提供頂層 uninstall 目標,無法一鍵清理。
make uninstall:for dir in */; do
if [ -f "$dir/Makefile" ]; then
echo "Processing $dir..."
(cd "$dir" && make uninstall)
fi
done
或手動逐目錄操作:
cd gdb && make uninstall
cd ../gdbserver && make uninstall
cd ../libdecnumber && make uninstall
# ... 視實際子目錄結構依序執行
prefix、DESTDIR)需與安裝時一致;configure 後再執行上述步驟;/usr/local,可能需 sudo 權限;生產環境強烈建議透過系統套件管理器安裝 GDB,卸載乾淨且無依賴殘留:
sudo apt install gdb / sudo apt remove gdbsudo yum install gdb / sudo yum remove gdbsudo dnf install gdb / sudo dnf remove gdb原始碼編譯僅在需要特定版本或修補程式時使用,切記保留建置目錄以便日後卸載。

Kali Linux 破解 WiFi 實戰:Fern Wifi Cracker 圖形化工具完整操作流程
紅旗 Linux 6.0 安裝 VMware Tools 完整指南與滑鼠問題修正
Linux 編譯報錯 "/usr/bin/ld: cannot find -lxxx" 根因分析與解決方案
R 語言連接資料庫:ODBC 與 DBI 兩大擴展包安裝方式深度比較
Ubuntu 關閉 Alt 鍵呼出 HUD 搜尋框:自訂鍵盤捷徑設定教學
Linux 獲取主機資訊命令大全:hostname/host/dig/arch/uname 完整指南