To use Certbot, packages from the EPEL repository need to be installed - ssl

I use certbot-auto for deploying Let's Encrypt SSL certificates, and I renew certificate with crontab -e like this:
* 01 * * 1 /home/myname/certbot-auto --quiet
It has an error message like the below:
Bootstrapping dependencies for RedHat-based OSes...
yum is /usr/bin/yum
To use Certbot, packages from the EPEL repository need to be installed.
Please enable this repository and try running Certbot again.
I can't solve this error. Please help me!

Under centos 7, provided the "extras" repo is enabled, you can just run yum -y install epel-release. I'm not sure this is available under Centos 6 (certainly won't hurt to try it). However, to install under CentOS 6 manually you would just run (as root, or using sudo):
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -Uvh epel-release-6*.rpm
Once the EPEL repository is installed on your system, try running certbot again. It should now be able to automatically install any required dependencies.

Related

Terminal command in fedora

What does the yum and -y means
yum install httpd -y
new to fedora. please guide me.
the above code will install Apache server in fedora
yum is a software package manager that installs, updates, and removes packages on RPM-based systems. It automatically computes dependencies and figures out what things should occur to install packages. yum makes it easier to maintain groups of machines without having to manually update each one using rpm.
-y means that we did't want to gave yes to install any package (here httpd)
httpd installs apache web server
Thanks for Support and advice

Reinstall rhn-client-tools with non working yum

For every yum command it will return SSL certificate error
Loaded plugins: fastestmirror, rhnplugin, security
The SSL certificate failed verification.
My SSL cert if valid.
I checked rhel site for https://access.redhat.com/solutions/93313 but the problem is i cannot reinstall rhn-client-tools since yum is actually not working and for some other reasons i cannot boot it from DVD/image.
Any tips on this?
Before trying to reinstall, have you also checked your firewall settings and the time and date setting on your server ?
If the firewall is not the issue, I would suggest a simpler approach, just by going to RH's site and downloading the appropriate rhn-client-tools RPM package, copying it to your server and installing it.
"What about the possible dependencies?" I foresee you asking...
Use a different server (or VM) with the same OS version that has access to the internet.
use yum with the download only plugin to only download all the needed dependencies (you must have the yum-plugin-downloadonly package installed beforehand) in a local directory like so:
yum install --downloadonly --downloaddir=<directory> <package>
Copy the packages downloaded at step #2 to your affected machine and install them using the rpm utility as so: rpm -ivh /path/to/yum/download/dir/*

how install pdo-mysql in centos7

I install laravel 5 and then install packages neede.
I install php-pdo and some other but now i cant install pdo-mysql and laravel return error.
PDOException in PDOConnection.php line 47: could not find driver
I am use Centos 7 and PHP 5-6-29.
Check which package is installed (which provider) and provides the stack, then use the same namespace.
Webtatic uses php56w-*
IUS uses php56u-*
remi-safe (SCL packages) use php56-php-*
remi-php56 simply use php-*
other providers can use something else
As you need pdo_mysql driver, simply
yum install <namespace>-pdo_mysql
(using the ext name, yum will find the correct package name which provides this ext).
Also check you don't have any "exclude" lines in the yum configuration (such as the ones provided in altered cpanel distributions)
Try using this
yum install php-mysql
systemctl restart httpd
You can search package like
yum search php
Pick the ones you need and install them like this:
yum -y install php-mysqlnd php-pdo
In the next step I will install some common PHP modules that are required by CMS Systems like Wordpress, Joomla, and Drupal:
yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-soap curl curl-devel
https://webtatic.com/packages/php56/
I believe the driver is php56w-mysql so yum install php56w-mysql should do the job.

Certbot not found

i installed letsencrypt on my ubuntu 16.04 machine with following command.
sudo apt-get install letsencrypt
Now, i want to define a cronjob to automatically renew my certs with following line.
certbot renew --pre-hook "service nginx stop" --post-hook "service nginx start"
But i always get the error, that the command certbot could not be found.
If i use letsencrypt instead of certbot everything works fine as long as i dont use the --pre-hook and --post-hook.
How to install certbotor is there an alternative command for letsencrypt to define such hooks?
Thanks
For me the following commands working fine.
Install snap
sudo apt update
sudo apt install snapd
Install Core
sudo snap install core
Install Certbot
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
Renew Certbot
sudo certbot renew --dry-run
Follow the official instructions and install certbot with
sudo apt install certbot python3-certbot-nginx
or, in newer Ubuntus that have snap, with
sudo snap install --classic certbot
It will be available in $PATH after that.
Ok i found the solution..
git clone git#github.com:certbot/certbot.git
cd certbot
./certbot-auto renew --pre-hook "service nginx stop" --post-hook "service nginx start"
This worked for me. I have to specify full path when running certbot with elevated privileges
sudo /snap/bin/certbot renew --dry-run
TL;DR
Although I have /snap/bin in my $PATH
echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/games:/snap/bin
But without providing full path it does not work with sudo. It throws the following error
certbot renew --dry-run
The following error was encountered:
[Errno 13] Permission denied: '/var/log/letsencrypt/.certbot.lock'
Either run as root, or set --config-dir, --work-dir, and --logs-dir to writeable paths.
and it also works if I (while having /snap/bin in root's $PATH as well) switch to power user
sudo -i
and then run any certbot command
Kindly note I'm on debian 10 and using snapd as package manager according to the tutorial https://certbot.eff.org/lets-encrypt/snap-nginx.
As explained here https://unix.stackexchange.com/questions/245772/why-running-command-as-sudo-returns-command-not-found this is kinda expected and approved of behaviour:
sudo tries to be safe when executing external commands. the usual
workaround is to specify the complete pathname of the program. It's
also more secure; it you don't specify the path, it's conceivable that
an attacker could create another program that will be run with root
permissions.
Going on reading further I can see that my PATHs are different
env | grep ^PATH
sudo env | grep ^PATH
There are several solutions (use custom sudo or change sudo $PATH) provided at the thread Command not found when using sudo so one does not have to specify full path.
try to remove using snap
sudo snap remove certbot
and then install again with
sudo snap install --classic certbot
You can try Let's Certbot.
Let's Certbot is a tool builds automated scripts base on Certbot for obtaining, renewing, deploying SSL certificates.
It supports docker and non-docker environments.
GitHub: https://github.com/jinhucheung/letscertbot
try this
sudo ~/.certbot/bin/certbot certonly --webroot

Ambari repository on CentOS 7

We are trying to install Ambari server following the manual Install Ambari 2.2.1 from Public Repositories.
When we tried to install the Ambari server with the command yum install ambari-server it returns that it is nothing to do.
The ambari.repo is:
#VERSION_NUMBER=2.2.1.0-161
[Updates-ambari-2.2.1.0]
name=ambari-2.2.1.0 - Updates
baseurl=http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.2.1.0
gpgcheck=1
gpgkey=http://public-repo-1.hortonworks.com/ambari/centos7/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
Someone can help us?
The problem was that the OS installed was of 32 bits and it is obligatory install the 64 bits OS.
Just clear the yum cache and then try again it will be solved your problem.
yum clean all
yum install ambari-server
Note: Make sure you kept the ambari.repo file in /etc/yum.repos.d/ location
This happens in case:
Package (ambari-server) is already installed
Repolist can't find the package (ambari-server).
First run yum list all if it's not listing package then run
yum clean all
Again run yum list all
If it's not listing your package you need to add .repo file for the same in /etc/yum.repos.d