My certbot got broken (error of version conflict)

/usr/lib/python3/dist-packages# certbot

An unexpected error occurred:

pkg_resources.VersionConflict: (certbot 0.31.0 (/usr/lib/python3/dist-packages), Requirement.parse(‘certbot>=0.35.0’))

Please see the logfile ‘/tmp/tmpcadnybfo’ for more details.

tail /tmp/tmpcadnybfo
File “/usr/lib/python3/dist-packages/certbot/plugins/disco.py”, line 52, in init
self.plugin_cls = entry_point.load()
File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 2323, in load
self.require(*args, **kwargs)
File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 2346, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 783, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (certbot 0.31.0 (/usr/lib/python3/dist-packages), Requirement.parse(‘certbot>=0.35.0’))

How to fix this error of version conflict . Is there any option to downgrade to 0.31

Your certbot is too old, you need to upgrade to version 0.35 or newer.

0.35 isn’t packaged on many of the major Linux distributions yet. Not all users have the option of upgrading to it.

Can you please check whether you have installed any Certbot components from pip? That seems like the most likely reason that you have ended up with a version conflict.

dpkg-query -l "*certbot*"
# or if on an EL-based distro
rpm -qa "*certbot*"
which -a certbot
pip3 list | grep certbot
2 Likes

dpkg-query -l "certbot"

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
++±================================-=====================-=====================-=====================================================================
ii certbot 0.31.0-1+ubuntu18.04. all automatically configure HTTPS using Let’s Encrypt
ii python-certbot-apache 0.31.0-1+ubuntu18.04. all transitional dummy package
un python-certbot-apache-doc (no description available)
un python-certbot-doc (no description available)
un python-certbot-nginx (no description available)
ii python3-certbot 0.31.0-1+ubuntu18.04. all main library for certbot
ii python3-certbot-apache 0.31.0-1+ubuntu18.04. all Apache plugin for Certbot
un python3-certbot-nginx (no description available)

which -a certbot

/usr/local/bin/certbot

/usr/bin/certbot

pip3 list | grep certbot

DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.

certbot (0.36.0)

certbot -apache (0.31.0)

certbot -nginx (0.36.0)

when i run /usr/local/bin/certbot --apache it works

/usr/bin/certbot shows the error message

Thanks.

This is more or less what happens if you install Certbot from pip and from apt side by side.

/usr/bin/certbot (0.31) comes from the Ubuntu PPA (apt).

/usr/local/bin/certbot (0.36) comes from pip.

They can’t coexist on the same system due to them being different versions but sharing the same Python installation - you will need to remove one of them.

The official recommendation for Ubuntu is that you should install Certbot from the Ubuntu PPA (apt).

In that case, you would want to pip3 uninstall all of the packages you installed from pip and probably re-install them via apt, but this can be a little bit tricky to track them all down.

az thank you .

i just deleted the ubuntu ppa version

i cant even reinstall from ubuntu ppa but i reinstalled via pip 0.36 is working .

however when i run apt-install cerbot

certbot is already the newest version (0.31.0-1+ubuntu18.04.1+certbot+1).

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

1 not fully installed or removed.

but no /usr/bin/certbot is existing

strange

It can be a bit tricky to re-install the right packages that deliver the right files, to replace those that pip overwrote.

Something like (e.g. if you use the Certbot Apache plugin)

apt install --reinstall certbot python3-acme python3-augeas python3-certbot python3-certbot-apache

but I am hesitant to tell you what to run, as it’s kind of easy to hose your system like this :frowning: .

Exactly what commands did you run?

Just apt remove cerbot

but it doesnt delete usr/bin/certbot

i deleted

/usr/bin/certbot
and
/usr/local/bin/cerbot

and after that i tried with pip the reinstall worked

but ubuntu ppa cant install /usr/bin/certbot again it says its already installed but

/usr/bin/cerbot gives me not found

yes i tried and saw that it gets absolutely a mess =)
whatever /usr/local/bin/cerbot with pip installation is working though .

apt remove cerbot or apt remove certbot?

What did it output?

/usr/bin/certbot is part of the certbot package.

If apt install certbot says it's already installed, it must not have been removed.

cerbot or certbot?

certbot sorry . i wrote the command here not copied .

appreciated . cleaned up al reinstalled no problem . thanks

2 Likes

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