在 Ubuntu 20.04 上运行 rdiff-backup 版本 1(例如 1.2.8)

在 Ubuntu 20.04 上运行 rdiff-backup 版本 1(例如 1.2.8)

我需要在 Ubuntu 20.04 上运行 rdiff-backup 版本 1(例如 1.2.8),以允许传统备份服务器备份 Ubuntu 20.04 盒。

我尝试关注这里的帖子: https://askubuntu.com/a/1280195/1564231,但这给了我错误:

# apt install -y librsync1=0.9.7-10build1 rdiff-backup=1.2.8-7
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Version '0.9.7-10build1' for 'librsync1' was not found

(而且我也没有资格评论这个答案)

因此我尝试查找并下载所需的特定软件包,我这样做了:

# wget http://cz.archive.ubuntu.com/ubuntu/pool/main/libr/librsync/librsync1_0.9.7-10build1_amd64.deb
# dpkg -i librsync1_0.9.7-10build1_amd64.deb
Selecting previously unselected package librsync1:amd64.
(Reading database ... 135179 files and directories currently installed.)
Preparing to unpack librsync1_0.9.7-10build1_amd64.deb ...
Unpacking librsync1:amd64 (0.9.7-10build1) ...
Setting up librsync1:amd64 (0.9.7-10build1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for man-db (2.9.1-1) ...
# dpkg -i rdiff_0.9.7-10build1_amd64.deb
(Reading database ... 135189 files and directories currently installed.)
Preparing to unpack rdiff_0.9.7-10build1_amd64.deb ...
Unpacking rdiff (0.9.7-10build1) over (0.9.7-10build1) ...
Setting up rdiff (0.9.7-10build1) ...
Processing triggers for man-db (2.9.1-1) ...

看起来效果不错。所以我又用 rdiff-backup 做了同样的事情

# dpkg -i rdiff-backup_1.2.8-7_amd64.deb
Selecting previously unselected package rdiff-backup.
(Reading database ... 135189 files and directories currently installed.)
Preparing to unpack rdiff-backup_1.2.8-7_amd64.deb ...
Unpacking rdiff-backup (1.2.8-7) ...
dpkg: dependency problems prevent configuration of rdiff-backup:
 rdiff-backup depends on python (>= 2.7.1-0ubuntu2); however:
  Package python is not installed.
 rdiff-backup depends on python (<< 2.8); however:
  Package python is not installed.

dpkg: error processing package rdiff-backup (--install):
 dependency problems - leaving unconfigured
Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
 rdiff-backup

虽然不太顺利,但现在已经安装好了:

# rdiff-backup
bash: /usr/bin/rdiff-backup: /usr/bin/python: bad interpreter: No such file or directory

因此设置替代方案:

# update-alternatives --install /usr/bin/python python /usr/bin/python2 1
update-alternatives: using /usr/bin/python2 to provide /usr/bin/python (python) in auto mode
# update-alternatives --install /usr/bin/python python /usr/bin/python3 2
update-alternatives: using /usr/bin/python3 to provide /usr/bin/python (python) in auto mode
# update-alternatives --config python
There are 2 choices for the alternative python (providing /usr/bin/python).

  Selection    Path              Priority   Status
------------------------------------------------------------
* 0            /usr/bin/python3   2         auto mode
  1            /usr/bin/python2   1         manual mode
  2            /usr/bin/python3   2         manual mode

Press <enter> to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/bin/python2 to provide /usr/bin/python (python) in manual mode

和:

# rdiff-backup --version
rdiff-backup 1.2.8

但是,每当我尝试做其他事情时,它都会给我带来抱怨的问题:

root@tek:/usr/local/src/rdiff-backup# apt upgrade wget
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 rdiff-backup : Depends: python (>= 2.7.1-0ubuntu2)
                Depends: python (< 2.8)
                Recommends: python-pylibacl but it is not installed
                Recommends: python-pyxattr
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

我是不是应该早点做些不同的事情?我能修复 apt 问题吗?

我已经做了

# apt-mark hold rdiff-backup

停止将 rdiff 升级到版本 2。

非常感谢凯文

答案1

你必须先让 Ubuntu 20.04 LTS 完全升级并正常运作

sudo apt-get update
sudo apt-get install -f
sudo dpkg --configure -a
sudo apt-get dist-upgrade

然后下载rdiff-backuplibrsync1来自 18.04 LTS 存储库的软件包,通过以下方式安装

cd ~/Downloads
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/r/rdiff-backup/rdiff-backup_1.2.8-7_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/main/libr/librsync/librsync1_0.9.7-10build1_amd64.deb

sudo apt-get install ./rdiff-backup_1.2.8-7_amd64.deb ./librsync1_0.9.7-10build1_amd64.deb

最后通过以下命令固定其版本

cat <<EOF | sudo tee /etc/apt/preferences.d/pin-rdiff-rsync
Package: rdiff-backup
Pin: version 1.2.8-7
Pin-Priority: 1337

Package: librsync1
Pin: version 0.9.7-10build1
Pin-Priority: 1337
EOF

相关内容