官方文档:

https://www.percona.com/doc/percona-xtrabackup/8.0/installation/apt_repo.html

1,首先都在root用户下操作,不然提示权限不足

wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
通过上面命令得到最新的安装包,会根据你的系统来,

比如ubuntu1804就是percona-release_latest.bionic_all.deb

比如ubuntu1604就是percona-release_latest.xenial_all.deb

2,然后安装:

dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb;##$(lsb_release -sc)换成你对应系统的名字(xenial或者bionic等等)
2.1可能会提示很多没有安装的依赖:

percona-release depends on curl; however:
Package curl is not installed.
percona-xtrabackup-80 : Depends: libdbd-mysql-perl but it is not going to be installed
Depends: libcurl4-openssl-dev but it is not going to be installed
Depends: libev4 (>= 1:4.04) but it is not going to be installed
libdbd-mysql-perl : Depends: perl-dbdabi-94
Depends: libmysqlclient20 (>= 5.7.11) but it is not going to be installed
Depends: libdbi-perl but it is not going to be installed
2.2我安装的过程就很多提示,所以我一并将所有的依赖全部安装了

sudo apt-get -f install curl libev4 libcurl4-openssl-dev libdbd-mysql-perl libdbi-perl libmysqlclient20 perl-dbdabi-94;

sudo apt-get update
3,重新安装安装包

dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb;##$(lsb_release -sc)换成你对应系统的名字(xenial或者bionic等等)
3.1安装完毕,官方提示可以在这里 看Percona库的配置来添加Percona库 但是我没有此文件...

Once you install this package the Percona repositories should be added. You can check the repository setup in the /etc/apt/sources.list.d/percona-release.list file.
3.2启用存储库:

percona-release enable-only tools release
如果打算将Percona XtraBackup与上游MySQL Server结合使用,则只需启用tools 存储库:

percona-release enable-only tools
4.记住要更新本地缓存:

apt-get update
5.安装该percona-xtrabackup-80软件包或者其他版本

sudo apt-get install percona-xtrabackup-80;##8.0版本
sudo apt-get install percona-xtrabackup-24;##2.4版本
6.为了进行压缩备份,请安装qpress软件包

sudo apt-get install qpress