温馨提示×

debian compton如何降级

小樊
39
2026-10-16 14:26:43
栏目: 智能运维

在 Debian 下“降级 compton”通常有两种理解:

  1. 你用的是旧版 compton,想换成更老/更稳定的版本
  2. 你用的是 picom(compton 的继任者),想降级到旧 compton 或旧 picom

下面分别说明。


一、先确认你装的是哪个

which compton
which picom
apt list --installed | grep -E 'compton|picom'
  • 如果是 compton:Debian 旧包名就是 compton
  • 如果是 picom:新版 Debian 已用 picom 替代 compton

二、通过 apt 降级(推荐,最安全)

1. 查看可用版本

apt-cache policy compton
# 或
apt-cache policy picom

你会看到类似:

compton:
  Installed: 1.0.0
  Candidate: 1.0.0
  Version table:
     1.0.0 500
        500 http://deb.debian.org/debian bookworm/main amd64 Packages
     0.1~git2021 500
        500 http://deb.debian.org/debian bullseye/main amd64 Packages

2. 降级到指定版本

sudo apt install compton=0.1~git2021
# 或
sudo apt install picom=旧版本号

如果提示依赖问题,可加:

sudo apt install --allow-downgrades compton=版本号

三、从旧 Debian 版本装(跨版本降级)

如果当前仓库没有旧版:

方法 A:使用 snapshot.debian.org

# 编辑 sources.list
sudo nano /etc/apt/sources.list

添加(示例为 bullseye):

deb http://snapshot.debian.org/archive/debian/20211231T000000Z/ bullseye main

然后:

sudo apt update
sudo apt install compton=旧版本

用完建议注释掉该源。


四、从源码降级(最灵活)

适合你明确想要某个 git 提交:

sudo apt remove compton picom
sudo apt build-dep compton

git clone https://github.com/chjj/compton.git
cd compton
git checkout 旧commit或tag

make
sudo make install

五、如果你是想“退回 compton 而不是 picom”

Debian 新版本已移除 compton,只提供 picom。

解决方式:

  • 用 picom(配置基本兼容)
  • 或从 bullseye / 源码安装旧 compton

六、常见建议

  • 不要混用 compton 和 picom
  • 降级后建议锁定版本:
sudo apt-mark hold compton

如果你能告诉我:

  • Debian 版本(bookworm / bullseye?)
  • 当前 compton/picom 版本
  • 为什么要降级(bug?性能?配置?)

我可以给你精确的一条命令方案。

0 踩