温馨提示×

centos怎么卸载compton配置

小樊
37
2026-09-21 12:53:50
栏目: 智能运维

在 CentOS 上“卸载 compton 配置”一般分两种情况:

  1. 只是删除 compton 的配置文件(保留程序)
  2. 彻底卸载 compton 程序及其配置

下面分别说明。


一、只删除 compton 配置(不卸载程序)

compton 常见配置文件位置:

~/.config/compton.conf
~/.compton.conf
/etc/compton.conf

删除配置:

rm -f ~/.config/compton.conf
rm -f ~/.compton.conf
sudo rm -f /etc/compton.conf

如果你是用 xinitrc 或 autostart 启动的,还要移除自启:

# 查看是否有自启
cat ~/.xinitrc
cat ~/.config/autostart/compton.desktop

删除自启项:

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

并编辑 ~/.xinitrc,删掉类似:

compton &

二、彻底卸载 compton(程序 + 配置)

1. 先停止 compton

pkill compton

或:

killall compton

2. 根据安装方式卸载

✅ 如果是 yum / dnf 安装的

sudo yum remove compton

或(CentOS 8+):

sudo dnf remove compton

✅ 如果是源码编译安装的

一般源码安装会装到:

/usr/local/bin/compton

卸载:

sudo rm -f /usr/local/bin/compton

如果编译时用了 make install,可回到源码目录:

cd compton
sudo make uninstall

✅ 如果是 git + 手动运行的

直接删程序文件:

rm -rf ~/compton

3. 删除所有配置文件

rm -rf ~/.config/compton*
rm -f ~/.compton.conf
sudo rm -f /etc/compton.conf

三、校验是否卸载干净

which compton

无输出说明已卸载。


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

  • CentOS 版本(7 / 8 / Stream)
  • compton 安装方式(yum / 源码 / git)

我可以给你更精确的命令。

0 踩