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

Not to worry - snaps update themselves daily!

Also, I was able to confirm that backup.py directly references /usr/bin/duplicity so that symlink is a needed step. I’ve updated the solution edited into the top post. Thanks again!

$ grep \/usr\/bin\/duplicity mailinabox/management/backup.py
                "/usr/bin/duplicity",
                        "/usr/bin/duplicity",
                "/usr/bin/duplicity",
                "/usr/bin/duplicity",
                "/usr/bin/duplicity",
                "/usr/bin/duplicity",

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
2 Likes

Many thanks! Snap has always worked fine for my needs. This approach solved my duplicity backup issue.

The Duplicity release notes at Releases · duplicity / duplicity · GitLab now state: “This is the 2.2.1 release of duplicity. It fixes the packaging problems in 2.2.0.” Updating our MiaB server reported: “Setting up duplicity (2.2.1-ppa202401301651~ubuntu22.04.1) …” Nevertheless, after restarting the server, the Backup Status page still reports: “[Errno 2] No such file or directory: ‘/usr/bin/duplicity’”

¯\_(ツ)_/¯

Install via snap as I documented above.

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

Now if you try to install duplicity it can’t:

user@mailbox:~$ sudo apt install duplicity
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package duplicity is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'duplicity' has no installation candidate

@JoshData is any official solution in the work, don’t want to add custom workaround that could cause potential future issues.

I think Duplicity has posted a new package to the PPA that fixes the issue. I haven’t checked it myself though.

1 Like

MiaB may want to change the preferred deployment of duplicity, however. The jammy repos only provide duplicity 0.8.21, and at this point most folks require 2.x. Switching to a deployment of the stable snap release seems like a much more straightforward way to manage it than the git PPA.

Yes, I installed the updated package and everything is working fine on my system.

Did you manually update a version… I still see the issue as of this morning

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

If, by manually, you mean did I run “apt” by hand, then yes. As soon as I saw the duplicity project had a new release to fix this issue, I ran update, which showed a new package was available, followed by upgrade. As follows:

sudo apt update
sudo apt upgrade

As I was writing this, I just logged onto my server and ran those again, and see that there was yet another new update available:

duplicity/jammy 2.2.1-ppa202402021538~ubuntu22.04.1 amd64 [upgradable from: 2.2.1-ppa202401291823~ubuntu22.04.1]

As I understand it, the 2.2.0 version is the one with the packaging problem (which resulted in a missing /usr/bin/duplicity). On my system the 2.2.1 versions are not missing this file, and nightly backups are running without issue.

I’ll add one final note that might help some of you, I did not attempt to apply any of the workarounds to the broken 2.2.0 that have been discussed on these forums. So, if you’re still having problems with the newest 2.2.1 package, you may want to look at whether you made any manual changes to your system that are affecting the installation of the new version.

The issue with the PPA has been confirmed to be fixed by the maintainer and updates should include the binary as usual.

That said, I encourage anyone reading this to avoid using a nightly PPA for their software unless they’re prepared to deal with issues that crop up due to it. Installing via snap is easy, straightforward, and will put you on a stable release channel that self-updates as needed.

Thanks for detailed explanation, thats exactly I wanted to understand, anything other than apt command I assume manual, I verified the latest update and its working again, thanks again!

Hi @mokiejovis

Thank you for all the hard work you’ve put in on this problem, but can I respectfully suggest you stop pushing the “snap” option as not everybody wants to go down that route.

Cheers

As a workaround for possible future events like this, I’ve set duplicity package on hold. My plan is to keep duplicity on hold. When duplicity PPA gets updated, I should get notified by “Status Checks Change Notice” email.
After that I’ll wait for some time and see if there have been any issues reported regarding duplicity in MIAB forums.

sudo apt-mark hold duplicity

After I’m reasonably sure that new duplicity isn’t broken, then I’ll update it in the following manner.

sudo apt-mark unhold duplicity
sudo apt-get install -y duplicity
sudo apt-mark hold duplicity

If for some reason I have to revert back to previous version, the procedure is shown here.

1 Like

This topic was automatically closed 40 days after the last reply. New replies are no longer allowed.