温馨提示×

如何升级debian compton

小樊
45
2026-10-07 19:20:16
栏目: 智能运维

在 Debian 上“升级 compton”通常有两种理解:升级已安装的 compton 软件包,或 用其继任者 picom 替代它(因为 compton 已基本停止维护,Debian 新版本中多被 picom 取代)。下面分别说明。


一、如果你只是想升级已安装的 compton

1. 使用 apt 升级(推荐)

sudo apt update
sudo apt upgrade compton

2. 查看当前版本

compton --version
# 或
dpkg -l compton

⚠️ 注意:

  • Debian 11(Bullseye)之后,官方仓库中 compton 已被 picom 替代
  • 在 Debian 12(Bookworm)中,compton 包通常不存在或只是过渡包

二、推荐做法:迁移到 picom(compton 的继任者)

1. 安装 picom

sudo apt update
sudo apt install picom

2. 停止并替换 compton

pkill compton
picom &

3. 修改启动配置

如果你之前在:

  • ~/.xinitrc
  • ~/.config/autostart/
  • i3 / bspwm / openbox 配置中启动了 compton

请把:

compton &

改为:

picom &

4. 配置文件兼容说明

  • picom 兼容大部分 compton 配置
  • 配置文件位置通常是:
~/.config/picom/picom.conf
# 或旧路径
~/.config/compton.conf

若使用旧配置,可复制:

cp ~/.config/compton.conf ~/.config/picom/picom.conf

三、从源码升级(不推荐,除非你需要最新特性)

sudo apt install meson ninja-build libxext-dev libxcb1-dev libxcb-damage0-dev \
libxcb-xfixes0-dev libxcb-shape0-dev libgl1-mesa-dev libpixman-1-dev

git clone https://github.com/yshui/picom.git
cd picom
meson setup build
ninja -C build
sudo ninja -C build install

四、如何确认你该用哪个?

apt-cache policy compton picom
  • 有 picom → 用 picom
  • 只有 compton → 可继续用,但建议计划迁移

如果你告诉我:

  • Debian 版本(cat /etc/debian_version)
  • 桌面环境(i3 / KDE / XFCE 等)

我可以给你更精确的升级步骤。

0 踩