温馨提示×

linux compton怎么卸载干净

小樊
42
2026-09-21 23:56:10
栏目: 智能运维

在 Linux 下把 compton 卸载干净,通常分三步:卸载软件包 → 删除配置 → 清理残留进程/自启。

下面按常见情况说明。


一、确认你是怎么安装的

1️⃣ 用包管理器安装(最常见)

先确认有没有装:

which compton

或

compton --version

二、卸载 compton

✅ Debian / Ubuntu / Linux Mint

sudo apt remove --purge compton
sudo apt autoremove

✅ Arch / Manjaro

sudo pacman -Rns compton

注意:Arch 社区版常叫 compton 或 compton-git

✅ Fedora

sudo dnf remove compton

✅ 源码编译安装(无包管理器)

如果你以前是 make install 的:

sudo make uninstall

如果没保留源码:

sudo rm -f /usr/local/bin/compton
sudo rm -f /usr/local/share/man/man1/compton.1

三、删除配置文件(很重要)

compton 的配置文件通常在:

rm -rf ~/.config/compton.conf
rm -rf ~/.config/compton/

也可能这样:

rm -f ~/.compton.conf

搜索一下更保险:

find ~ -name "*compton*" 2>/dev/null

四、关闭并清理自启动

1️⃣ 结束正在运行的 compton

pkill compton

确认:

pgrep compton

无输出即已关闭。


2️⃣ 删除自启动项

XDG 自启动

rm -f ~/.config/autostart/compton.desktop

i3 / bspwm / openbox 等

检查配置文件里有没有:

~/.config/i3/config
~/.config/bspwm/bspwmrc
~/.config/openbox/autostart

搜索:

grep -R "compton" ~/.config

有就删掉对应行。


五、(可选)换用 picom(推荐)

compton 已停止维护,现在主流是 picom:

# Ubuntu
sudo apt install picom

# Arch
sudo pacman -S picom

配置文件通常是:

~/.config/picom/picom.conf

六、验证是否卸载干净

which compton
compton --version
ls ~/.config | grep compton

都无结果 ✅


如果你愿意,可以告诉我:

  • 发行版(Ubuntu / Arch / Debian?)
  • 桌面环境或窗口管理器(i3 / KDE / XFCE?)

我可以给你更精准的一条龙命令。

0 踩