Ubuntu中更新Compton版本的常用方法
这是Ubuntu系统中最便捷的更新方式,适用于大多数用户。操作步骤如下:
Ctrl+Alt+T
),运行sudo apt update
,同步官方仓库的最新软件包信息。sudo apt upgrade compton
,系统会自动下载并安装Compton的最新可用版本(需仓库中存在)。killall compton && compton &
命令重启Compton,使新版本生效。sudo add-apt-repository ppa:compton-compositor/stable
sudo apt update
sudo apt upgrade compton
若APT仓库中的版本过旧,可直接下载Compton的最新.deb发布包手动安装:
compton_0.1~beta2-1_amd64.deb
)。sudo dpkg -i /path/to/downloaded/compton_version.deb
(替换为实际下载路径)。sudo apt-get install -f
自动修复依赖关系。killall compton && compton &
命令重启服务。若需要Compton的最新开发版(可能包含未发布的特性),可通过源码编译安装:
sudo apt install cmake libx11-dev libwayland-dev libxrandr-dev mesa-common-dev
,安装编译所需的工具和库。git clone https://github.com/compton-compositor/compton.git
,进入项目目录。mkdir build && cd build
cmake ..
make
sudo make install
无论采用哪种方法,更新完成后均需验证版本:
compton --version
终端将输出当前Compton的版本号,确认是否为预期版本。
~/.config/compton.conf
),避免新版本不兼容导致配置丢失。sudo apt --fix-broken install
修复,或手动安装缺失的依赖包。