Score:1

E: Package 'python-virtualenv' has no installation candidate while using Certbot to renew certificates

us flag

We had an old Ubuntu 14 server, on which we install certbot and let's encrypt certificates for SSL. Then we upgraded the server to ubuntu 20.

Since then, whenever I try to renew or generate new certificates using sudo certbot --apache or the renew command, I get this error:

Bootstrapping dependencies for Debian-based OSes... (you can skip this with --no-bootstrap)
Hit:1 http://us-west-2.ec2.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://us-west-2.ec2.archive.ubuntu.com/ubuntu focal-updates InRelease                                
Hit:3 http://us-west-2.ec2.archive.ubuntu.com/ubuntu focal-backports InRelease                              
Hit:4 https://download.docker.com/linux/ubuntu focal InRelease                                                                             
Hit:5 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal InRelease                                                                       
Hit:6 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease                       
Get:7 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Fetched 114 kB in 2s (72.8 kB/s)   
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'python-is-python2' instead of 'python'
Note, selecting 'python-dev-is-python2' instead of 'python-dev'
Package python-virtualenv 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 'python-virtualenv' has no installation candidate

I have tried endless forums and tricks including this top google hit -> https://stackoverflow.com/questions/62314556/how-to-install-virtualenv-on-ubuntu-20-04-gcp-instance, but no luck yet :( Any ideas?

Michael Hampton avatar
cz flag
Do not use certbot from the apt repos on Ubuntu. It is always either out of date or broken. Always use the snap.
Rohan avatar
us flag
I tried uninstalling it, but coudn't. Tried removing it using apt purge command, and snap remove too. But I can still run `certbot` command. how to remove it completely so I can install it back fresh?
Michael Hampton avatar
cz flag
Try `which certbot` to find out where in the filesystem it is located.
Rohan avatar
us flag
good idea -> returned this /usr/local/bin/certbot can I remove this file? or is that a bad idea?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.