Ubuntu "apt install borgmatic" installs version 1.7.9-0ubuntu1 #751

Closed
opened 2023-09-03 18:41:14 +00:00 by so7ow · 7 comments

What I'm trying to do and why

I'm trying to install borgmatic for the first time. I'm confused by the results of sudo apt install borgmatic as it installs an outdated version of the application.

% sudo apt install borgmatic
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
borgmatic is already the newest version (1.7.9-0ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Steps to reproduce

sudo apt install borgmatic

Actual behavior

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
borgmatic is already the newest version (1.7.9-0ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Expected behavior

I would like to install the current version of borgmatic.

Other notes / implementation ideas

No response

borgmatic version

1.7.9

borgmatic installation method

sudo apt install borgmatic

Borg version

borg 1.2.4

Python version

Python 3.11.4

Database version (if applicable)

No response

Operating system and version

Ubuntu 23.04

### What I'm trying to do and why I'm trying to install borgmatic for the first time. I'm confused by the results of `sudo apt install borgmatic` as it installs an outdated version of the application. ``` % sudo apt install borgmatic Reading package lists... Done Building dependency tree... Done Reading state information... Done borgmatic is already the newest version (1.7.9-0ubuntu1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. ``` ### Steps to reproduce sudo apt install borgmatic ### Actual behavior Reading package lists... Done Building dependency tree... Done Reading state information... Done borgmatic is already the newest version (1.7.9-0ubuntu1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. ### Expected behavior I would like to install the current version of borgmatic. ### Other notes / implementation ideas _No response_ ### borgmatic version 1.7.9 ### borgmatic installation method sudo apt install borgmatic ### Borg version borg 1.2.4 ### Python version Python 3.11.4 ### Database version (if applicable) _No response_ ### Operating system and version Ubuntu 23.04
Author

Attempting a pip3 install doesn't seem to work either. I'm sure I've made some catastrophic mistake in setting up this system but this is the first package I've attempted to install that simply won't go for me!

% sudo pip3 install --user --upgrade borgmatic 
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Attempting a pip3 install doesn't seem to work either. I'm sure I've made some catastrophic mistake in setting up this system but this is the first package I've attempted to install that simply won't go for me! ``` % sudo pip3 install --user --upgrade borgmatic error: externally-managed-environment × This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install. If you wish to install a non-Debian-packaged Python package, create a virtual environment using python3 -m venv path/to/venv. Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make sure you have python3-full installed. If you wish to install a non-Debian packaged Python application, it may be easiest to use pipx install xyz, which will manage a virtual environment for you. Make sure you have pipx installed. See /usr/share/doc/python3.11/README.venv for more information. note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification. ```
witten added the
question / support
label 2023-09-03 20:28:05 +00:00
Owner

Unfortunately, as you've discovered, Ubuntu packages an outdated version of borgmatic. You can try filing an Ubuntu ticket / contacting the Ubuntu borgmatic package maintainer to update it.. or you can try another installation method.

As for installing with pip, I'm not sure why you're getting the "This environment is externally managed" error when you've got the --user flag, which tells pip not to do a system-wide install. To make this work anyway though, you can either add the --break-system-packages flag to your pip install (which hopefully won't break anything) and try again or you can create a virtualenv as per the instructions in that error message. A virtualenv is technically more isolated, so it's really a matter of what else you intend to install with pip in that particular user account and how much you care that it's isolated from borgmatic.

Here's some more reading about potential solutions to the same problem you're having: https://askubuntu.com/questions/1465218/pip-error-on-ubuntu-externally-managed-environment-%C3%97-this-environment-is-extern

I hope some of this helps! I'm sorry that even just installing a recent version of borgmatic is such a hassle on your system.

Unfortunately, as you've discovered, Ubuntu packages an outdated version of borgmatic. You can try [filing an Ubuntu ticket / contacting the Ubuntu borgmatic package maintainer to update it](https://packages.ubuntu.com/lunar/borgmatic).. or you can try another installation method. As for installing with pip, I'm not sure why you're getting the "This environment is externally managed" error when you've got the `--user` flag, which tells pip *not* to do a system-wide install. To make this work anyway though, you can either add the `--break-system-packages` flag to your pip install (which hopefully *won't* break anything) and try again or you can create a virtualenv as per the instructions in that error message. A virtualenv is technically [more isolated](https://stackoverflow.com/questions/45153178/is-using-the-pip-user-option-as-safe-as-creating-a-virtualenv), so it's really a matter of what else you intend to install with pip in that particular user account and how much you care that it's isolated from borgmatic. Here's some more reading about potential solutions to the same problem you're having: https://askubuntu.com/questions/1465218/pip-error-on-ubuntu-externally-managed-environment-%C3%97-this-environment-is-extern I hope some of this helps! I'm sorry that even just installing a recent version of borgmatic is such a hassle on your system.
Author

I hope some of this helps! I'm sorry that even just installing a recent version of borgmatic is such a hassle on your system.

I suspect my main sin was installing HomeBrew early in the build of this machine. At any rate, using that instead of apt or pip3 worked for me.

% brew install borgmatic

-snip-

% borgmatic --version
1.8.2
> I hope some of this helps! I'm sorry that even just installing a recent version of borgmatic is such a hassle on your system. I suspect my main sin was installing HomeBrew early in the build of this machine. At any rate, using that instead of `apt` or `pip3` worked for me. ``` % brew install borgmatic -snip- % borgmatic --version 1.8.2 ```
Owner

Cool.. I didn't know Homebrew supported Ubuntu. I'm glad to hear you've got a recent version of borgmatic installed now. I'll close this ticket, but please feel free to file a new one if you have any other problems with borgmatic.

Cool.. I didn't know Homebrew supported Ubuntu. I'm glad to hear you've got a recent version of borgmatic installed now. I'll close this ticket, but please feel free to file a new one if you have any other problems with borgmatic.

I believe this change is due to Debian implementing PEP 668. I've recently updated to Ubuntu 23.04, and had to learn venv to install borgmatic. Its been a bit of a headache (that's not a gripe at borgmatic maintainers).

I may open an issue to learn how to use venv borgmatic in cron job, since I haven't yet been able to make it work.

Edits: grammar, clarification

I believe this change is due to Debian implementing [PEP 668](https://peps.python.org/pep-0668/). I've recently updated to Ubuntu 23.04, and had to learn venv to install borgmatic. Its been a bit of a headache (that's not a gripe at borgmatic maintainers). I may open an issue to learn how to use venv borgmatic in cron job, since I haven't yet been able to make it work. Edits: grammar, clarification
Owner

Thanks for providing that link. From that page, here is the rationale they give on this error also applying to the pip install --user use case:

This applies both to system-wide installs (sudo pip install) as well as user home directory installs (pip install --user), since packages in either location show up on the sys.path of /usr/bin/python3.

I guess a globally installed system package could in theory import something installed non-globally by pip install --user. Seems like an edge case, but okay. Maybe I need to change the recommended/default borgmatic install method from pip, although there aren't a lot of other good alternatives without the install instructions getting even more complicated—and therefore the chance of something going wrong increasing.

I'm happy to look at a ticket about your cron job venv though!

Thanks for providing that link. From that page, here is the rationale they give on this error also applying to the `pip install --user` use case: > This applies both to system-wide installs (sudo pip install) as well as user home directory installs (pip install --user), since packages in either location show up on the sys.path of /usr/bin/python3. I guess a globally installed system package could in theory import something installed non-globally by `pip install --user`. Seems like an edge case, but okay. Maybe I need to change the recommended/default borgmatic install method from pip, although there aren't a lot of other good alternatives without the install instructions getting even more complicated—and therefore the chance of something going wrong increasing. I'm happy to look at a ticket about your cron job venv though!
Owner

Partly based on this ticket, I've updated borgmatic documentation to recommend installing borgmatic via pipx rather than pip:

That may also help with the cron job situation.

Partly based on this ticket, I've updated borgmatic documentation to recommend installing borgmatic via [pipx](https://pypa.github.io/pipx/) rather than pip: - https://torsion.org/borgmatic/docs/how-to/set-up-backups/#installation - https://torsion.org/borgmatic/docs/how-to/upgrade/#upgrading-borgmatic That may also help with the cron job situation.
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#751
No description provided.