温馨提示×

debian compton如何备份

小樊
38
2026-09-07 23:25:10
栏目: 智能运维

在 Debian 上“备份 compton”通常有两种理解,下面分别说明,你可以按需选择。


一、备份 Compton 的配置文件(最常见)

Compton(现已多被 picom 取代)的配置文件一般在:

~/.config/compton.conf

或更早的:

~/.compton.conf

备份方法

cp ~/.config/compton.conf ~/compton.conf.bak
# 或
cp ~/.compton.conf ~/compton.conf.bak

如果要整体备份配置目录:

cp -r ~/.config/compton ~/compton-config-backup

恢复

cp ~/compton.conf.bak ~/.config/compton.conf

二、备份 Compton 软件包(可重装用)

1. 查看是否已安装

dpkg -l | grep compton

2. 备份已安装的 deb 包(可选)

apt-get install --reinstall -d compton
cp /var/cache/apt/archives/compton*.deb ~/

3. 记录安装来源(推荐)

apt-mark showmanual | grep compton

或导出全部手动安装包:

apt-mark showmanual > installed-packages.txt

重装时:

sudo apt install compton

三、如果你用的是 Picom(Compton 分支)

很多 Debian 用户实际用的是 picom

~/.config/picom/picom.conf

备份方式一样:

cp ~/.config/picom/picom.conf ~/picom.conf.bak

四、系统级完整备份(进阶)

如果你是想“整个桌面环境配置一起备份”:

tar czf debian-home-backup.tar.gz \
  ~/.config \
  ~/.local \
  ~/.xinitrc \
  ~/.bashrc

如果你能说清楚:

  • Compton 还是 Picom
  • 想备份 配置 / 软件 / 整个系统

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

0