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
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
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.