[SOLVED] The latest release of duplicity is missing the duplicity binary

SOLVED: Install duplicity via snap. See my update here.

tl;dr: Uninstall the git PPA of duplicity and install the stable snap release:

$ sudo apt remove duplicity
$ sudo rm -rf /etc/apt/sources.list.d/duplicity-team-ubuntu-duplicity-release-git-jammy.list
$ sudo apt update
$ sudo snap install duplicity --classic
$ sudo ln -s /snap/bin/duplicity /usr/bin/duplicity
$ duplicity --version
duplicity 2.2.0 January 17, 2024

Edit 01 Feb 2024: I realized that an update of MiaB would probably reinstall duplicity on top of our snap symlink. So you’ll also want to block duplicity from being installed via apt. We do this by creating an apt preference file:

$ sudo echo -e "# Duplicity is installed via snap\nPackage: duplicity\nPin: release *\nPin-Priority: -1" > /etc/apt/preferences.d/duplicity

I woke up this morning to an error message from the box:

[Errno 2] No such file or directory: '/usr/bin/duplicity'

I tried reinstalling the duplicity package, but I have no binary:

root@mailbox:~# apt install --reinstall duplicity
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 357 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 https://ppa.launchpadcontent.net/duplicity-team/duplicity-release-git/ubuntu jammy/main amd64 duplicity amd64 2.2.0-ppa202401271616~ubuntu22.04.1 [357 kB]
Fetched 357 kB in 0s (1366 kB/s)
(Reading database ... 115472 files and directories currently installed.)
Preparing to unpack .../duplicity_2.2.0-ppa202401271616~ubuntu22.04.1_amd64.deb ...
Unpacking duplicity (2.2.0-ppa202401271616~ubuntu22.04.1) over (2.2.0-ppa202401271616~ubuntu22.04.1) ...
Setting up duplicity (2.2.0-ppa202401271616~ubuntu22.04.1) ...
Processing triggers for man-db (2.10.2-1) ...
Scanning processes...
Scanning linux images...

Running kernel seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.
root@mailbox:~# updatedb
root@mailbox:~# locate duplicity | grep bin
/var/lib/apt/lists/ppa.launchpadcontent.net_duplicity-team_duplicity-release-git_ubuntu_dists_jammy_main_binary-amd64_Packages
root@mailbox:~# which duplicity
root@mailbox:~# ls -al /usr/bin/duplicity
ls: cannot access '/usr/bin/duplicity': No such file or directory

I just went to another 22.04.1 box I manage, installed the git PPA and got the same result. No binary.

I’ve opened an issue on the duplicity gitlab page.

1 Like

See this bug. Downgrade to 0.8.21

I received the same error on my MIAB box as well.

Did you figure out some steps to resolve this?

A workaround has been posted on the duplicity issues page:

The PPAs on Launchpad named duplicity-develop-git and duplicity-release-git do not have the entry point script for duplicity installed, so you will get an error trying to run directly, i.e. /usr/local/bin/duplicity.

Thankfully, it is installed as a module, so it can be invoked as python3 -m duplicity --version.

There are a couple of workarounds that should work, a short alias like:

alias duplicity='python3 -m duplicity'

or as a shell script:

#!/usr/bin/sh
python3 -m duplicity $@

Personally I’ll be taking the shell-script-wrapper approach:

root@mailbox:~# vi /usr/bin/duplicity
root@mailbox:~# chmod a+x /usr/bin/duplicity
root@mailbox:~# duplicity --version
duplicity 2.2.0 January 17, 2024
2 Likes

After the proposed fix I get a different error:

Something is wrong with the backup: ERROR 23 CommandLineError
. CommandLineError: Wrong number of positional args for 'collection-status', got 11
. Expected 1 positionals from ['/root/.ssh/id_rsa_miab', '-p', "22'", '"/usr/bin/ssh', '-oStrictHostKeyChecking=no', '-oBatchMode=yes', '-p', '22', '-i', '/root/.ssh/id_rsa_miab"\'', 'rsync://finkelstein@storage.shipilev.net:22//home/finkelstein/mail'].
. Enter 'duplicity --help' for help screen.

And the PPA is suddenly empty, interesting

Strange that the PPA is empty - perhaps they don’t want people like us flooding them with reports over a nightly build? :wink:

With regards to the backup, mine is local to the box and kicked off without issue. I see that you’re is referencing an SSH key - did you make script modifications, perhaps? Back in 2023 when migrating to 2.x of duplicity became necessary, Josh updated the script. Are you missing those updates?

No, I didn’t do any modifications. But I’ve downgraded the version

That’s your issue. It won’t work with 0.8.x release. You need the updated 2.x version from the gitlab PPA.

In case anyone else needs the now-deleted instructions, you can add the PPA to your system with

$ sudo add-apt-repository ppa:duplicity-team/duplicity-release-git
$ sudo apt update

After that you can simply install duplicity:

$ sudo apt install duplicity

Then you can create a shell script with the editor of your choice (I like vi):

$ sudo vi /usr/bin/duplicity

with the contents:

#!/usr/bin/sh
python3 -m duplicity $@

Then be sure to make it executable:

$ sudo chmod a+x /usr/bin/duplicity
$ duplicity --version
2 Likes

Yes but no - there is currently no duplicity in the PPA, as I already said :slight_smile:

And if I restore it from the apt cache, I get the same error as in The latest release of duplicity is missing the duplicity binary - #6 by asm0dey

Ouch. No kidding. I just uninstalled and re-installed on another system I manage and only duplicity 0.8.x is installable. I’ll see if I can find an alternative way to install duplicity 2.x and report back.

On the machine where it was already installed, it’s located in /var/cache/apt/archives

Well I clearly missed something happening here :sweat_smile:

Ok. Looks like a much more straightforward way to install the latest duplicity is via snap. I know some people have strong opinions about snap, but I do not, so I installed that way and it worked without issue.

root@mailbox:~# apt remove duplicity
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  librsync2 python3-fasteners python3-monotonic python3-nacl python3-paramiko
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  duplicity
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 2231 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 115471 files and directories currently installed.)
Removing duplicity (2.2.0-ppa202401271616~ubuntu22.04.1) ...
Processing triggers for man-db (2.10.2-1) ...

root@mailbox:~# rm -rf /etc/apt/sources.list.d/duplicity-team-ubuntu-duplicity-release-git-jammy.list
root@mailbox:~# snap install duplicity --classic
duplicity 2.2.0 from Kenneth Loafman installed
root@mailbox:~# rm -rf /usr/bin/duplicity
root@mailbox:~# which duplicity
/snap/bin/duplicity
root@mailbox:~# duplicity --version
duplicity 2.2.0 January 17, 2024

One big benefit here is that it migrates you to the stable release channel, as opposed to the git PPA, which is a nightly release and has the potential for unexpected bugs, as we’ve seen in the last few days.

1 Like

Thanks for the apt cache location.

Here is what I did to roll back duplicity version

cd /var/cache/apt/archives
ls -1 duplicity*
duplicity_2.1.5-ppa202312281721~ubuntu22.04.1_amd64.deb
duplicity_2.2.0-ppa202401271616~ubuntu22.04.1_amd64.deb
sudo apt remove duplicity
sudo apt-get install $PWD/duplicity_2.1.5-ppa202312281721~ubuntu22.04.1_amd64.deb  
sudo apt-mark hold duplicity
1 Like

The snap workaround together with ln /snap/bin/duplicity /usr/bin/duplicity worked for me!

3 Likes

Nice catch! I didn’t consider that backup.py might be calling /usr/bin/duplicity directly. Thanks!

The downside is there is no snap autoupdate