I’ve tried running the installation command without backports
apt-get install certbot python-certbot-apache
And then I get following
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package certbot 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
My original problem is I had to remove php5. So i’ve run
apt-get --purge remove libapache2-mod-php5 (this apply to any other library removal)
This gives me following
Reading package lists… Done
Building dependency tree
Reading state information… Done
You might want to run ‘apt-get -f install’ to correct these:
The following packages have unmet dependencies:
python-certbot-apache : Depends: certbot (>= 0.9.3~) but it is not installable
E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).
Then I run the apt-get -f install, command gives me following result
Reading package lists… Done
Building dependency tree
Reading state information… Done
Correcting dependencies… Done
The following packages were automatically installed and are no longer required:
augeas-lenses libaugeas0 libpython2.7 python-augeas
Use ‘apt-get autoremove’ to remove them.
The following packages will be REMOVED:
python-certbot-apache
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 190 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database … 62303 files and directories currently installed.)
Removing python-certbot-apache (0.9.3-1~bpo8+1) …
/usr/bin/pyclean: 24: /usr/bin/pyclean: import: not found
/usr/bin/pyclean: 25: /usr/bin/pyclean: import: not found
/usr/bin/pyclean: 26: /usr/bin/pyclean: import: not found
from: can’t read /var/mail/os
from: can’t read /var/mail/os.path
/usr/bin/pyclean: 29: /usr/bin/pyclean: Syntax error: word unexpected (expecting “)”)
dpkg: error processing package python-certbot-apache (–remove):
subprocess installed pre-removal script returned error exit status 2
from: can’t read /var/mail/future
/usr/bin/pycompile: 26: /usr/bin/pycompile: import: not found
/usr/bin/pycompile: 27: /usr/bin/pycompile: import: not found
/usr/bin/pycompile: 28: /usr/bin/pycompile: import: not found
/usr/bin/pycompile: 29: /usr/bin/pycompile: import: not found
from: can’t read /var/mail/os
from: can’t read /var/mail/os.path
from: can’t read /var/mail/subprocess
/usr/bin/pycompile: 33: /usr/bin/pycompile: Syntax error: word unexpected (expecting “)”)
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
python-certbot-apache
E: Sub-process /usr/bin/dpkg returned an error code (1)
First if you have errors like below
/usr/bin/pycompile: 26: /usr/bin/pycompile: import: not found
/usr/bin/pycompile: 27: /usr/bin/pycompile: import: not found
/usr/bin/pycompile: 28: /usr/bin/pycompile: import: not found
/usr/bin/pycompile: 29: /usr/bin/pycompile: import: not found
upgrade python or reinstall it
My original problem was corrupted sources.list file at /etc/apt. Delete the file and recreated it.
After apt-get update I’ve also got following errors
dpkg: error processing package python-certbot (–configure):
subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of certbot:
certbot depends on python-certbot (= 0.9.3-1~bpo8+1); however:
Package python-certbot is not configured yet.
dpkg: error processing package certbot (–configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-certbot-apache:
python-certbot-apache depends on certbot (>= 0.9.3~); however:
Package certbot is not configured yet.
python-certbot-apache depends on python-augeas; however:
Package python-augeas is not configured yet.
python-certbot-apache depends on python-certbot; however:
Package python-certbot is not configured yet.
dpkg: error processing package python-certbot-apache (–configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
python-augeas
python-certbot
certbot
python-certbot-apache
Reinstall python
I’ve run following commands
apt-get clean
apt-get install --reinstall python2.7-minimal
This will reinstall python. Then try to reinstall certbot
apt-get install certbot python-certbot-apache