Can not install semanage tool on RedHat virtual machine - mongodb

I'm trying to change the MongoDB default port on my AWS Virtual Machine but semanage is not found on the server
semanage port -a -t mongod_port_t -p tcp 27042
-bash: semanage: command not found
Trying to find the package that provides semanage fails.
dnf whatprovides semanage
Errors during downloading metadata for repository 'rhui-client-config-server-8':
Curl error (58): Problem with the local SSL certificate for https://rhui3.eu-west-3.aws.ce.redhat.com/pulp/mirror/protected/rhui-client-config/rhel/server/8/x86_64/os [could not load PEM client certificate, OpenSSL error error:0200100D:system library:fopen:Permission denied, (no key found, wrong pass phrase, or wrong file format?)]
Error: Failed to download metadata for repo 'rhui-client-config-server-8': Cannot prepare internal mirrorlist: Curl error (58): Problem with the local SSL certificate for https://rhui3.eu-west-3.aws.ce.redhat.com/pulp/mirror/protected/rhui-client-config/rhel/server/8/x86_64/os [could not load PEM client certificate, OpenSSL error error:0200100D:system library:fopen:Permission denied, (no key found, wrong pass phrase, or wrong file format?)]
dnf update works and the system is up-to-date
Last metadata expiration check: 0:42:00 ago on Tue 21 Jul 2020 10:11:35 AM UTC.
Dependencies resolved.
Nothing to do.
Complete!
Additional informations :
cat /etc/redhat-release
Red Hat Enterprise Linux release 8.2 (Ootpa)
dnf repolist
repo id / repo name
mongodb-org-4.2 / MongoDB Repository
rhel-8-appstream-rhui-rpms / Red Hat Enterprise Linux 8 for x86_64 - AppStream from RHUI (RPMs)
rhel-8-baseos-rhui-rpms / Red Hat Enterprise Linux 8 for x86_64 - BaseOS from RHUI (RPMs)
rhui-client-config-server-8 / Red Hat Update Infrastructure 3 Client Configuration Server 8
Could you help me to install semanage please ? Thanks.

1.dnf install policycoreutils-python-utils
2. dnf provides semanage (This displays the same result as above-the path)
3. yum provides /usr/sbin/semanage
4. yum install policycoreutils-python
I fixed my issue using this.
You can also refer this link:
https://www.ostechnix.com/linux-troubleshooting-semanage-command-not-found-in-centos-7rhel-7/

Related

Unable to establish SSL connection DNS 320

I am trying to install a webserver using wget on a DNS 320 NAS but I keep having this problem
"OpenSSL: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
Unable to establish SSL connection."
I kind of understood that I have either have wbget or OpenSSL outdated but I don't know how to update them since i cannot use wget and I don't have the perms with filezilla to upload directly inside the directory "Z:\ffp\funpkg\installed"
wget version --2022-10-31 23:21:59--
openssl versionOpenSSL 0.9.7d 17 Mar 2004
I tryed installing using ssl commands with wget --no-check-certificate http://openssl.org/source/
Sliding the dir via filezilla and using the Z:dir in my file explorer
none worked

How to install postgresql-client to Amazon EC2 Linux machine?

I am trying to install postgresql for the meta data of hive on Amazon EC2 Linux machine.
And at that point, I am trying to connect postgresql outside docker image. Inside, I can connect the postgresql.
I tried this command:
[ec2-user#ip-****-***-** ~]$ sudo yum install postgresql-client -y
and the result:
Failed to set locale, defaulting to C
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core | 3.7 kB 00:00:00
No package postgresql-client available.
Error: Nothing to do
To ensure locale, I tried these ones:
[ec2-user#ip-***-***-*** ~]$ echo "$LANG"
en_US.UTF-8
[ec2-user#ip-***-***-*** ~]$ echo "$LC_CTYPE"
UTF-8
Then, I tried this one install postgresql-client lastly:
[ec2-user#ip-***-***-*** ~]$ sudo amazon-linux-extras install postgresql-client
Topic postgresql-client is not found.
I am not so familiar with these technologies, if you can help I will be so appreciated
Install postgresql package
sudo yum install postgresql
As mentioned by #Anon Coward in comments, this package contains the postgresql client. Check it with
yum search postgresql
If you get the error...
No match for argument: postgresql ...
I found that AWS Linux is a dynamic changing OS, so here is the current method + how to detect a new way to do this...
Current method (as of Oct 21, 2022)
(I have Machine Image (AMI): Amazon Linux 2022)
$ sudo yum update
$ sudo yum install postgresql13
$ psql --version
psql (PostgreSQL) 13.5
Future proof answer
Try this first ...
$ sudo yum update
$ sudo yum search "postgres"
... and look in the output for a line like this: postgresql13.aarch64 : PostgreSQL client programs. This tells you the current version of an installable client package name - in this case postgresql13. Now you know which package to install and avoid: No match for argument: postgresql error.
TLDR;
It seems, for Linux that Amazon now says to use yum directly vs. the old amazon-linux-extras here... Install software packages on an Amazon Linux instance. Then you wonder, how to know which package name to use to install it, which is here: Find software packages on an Amazon Linux instance. I used a small part of the name as a 'key' to search for: sudo yum search "postgres" which got me the answer, by looking at the output.
This currently works for my version of Amazon linux:
$ uname -a
Linux ip-0-0-0-0.ec2.internal 5.15.43-20.123.amzn2022.aarch64 #1 SMP Thu May 26 17:03:36 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
This is a new instance with almost nothing added, not even additional yum archives, YMMV.

Signature could not be verified for kubernetes repo

Tring to install kubernetes cluster with kubeadm, and faced issue with installing kube packages.
I continue getting error:
https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for kubernetes
Repo config:
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
exclude=kubelet kubeadm kubectl
Im using centos 7 distro
Linux kube-master 3.10.0-1160.21.1.el7.x86_64 #1 SMP Tue Mar 16 18:28:22 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
You can see very similar issue here.
As a quick workaround, you can simply disable GPG checking by setting repo_gpgcheck=0 in /etc/yum.repos.d/kubernetes.repo but this is obviously not recommended from security perspective.
Additionally you may try the following:
re-import the keys as suggested here
rpm --import https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
install the following version of GNUPG as suggested here
sudo yum install -y http://mirror.centos.org/centos/7/os/x86_64/Packages/gnupg2-2.0.22-5.el7_5.x86_64.rpm

CentOS 8 - yum/dnf error: Failed to download metadata for repo [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
On my CentOS 8 server, many dnf and yum commands fail with this error:
Failed to download metadata for repo
This seems to apply only to repositories involving https connections, e.g.:
/etc/yum.repos.d $ cat epel-modular.repo
[epel-modular]
name=Extra Packages for Enterprise Linux Modular $releasever - $basearch/pub/epel/$releasever/Modular/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-modular-$releasever&arch=$basearch&infra=$infra&content=$contentdir
...
I have used wget to test connectivity to these sites and it is successful, e.g. wget https://mirrors.fedoraproject.org succeeds.
However, various dnf or yum commands fail:
$ dnf provides /bin/ls
Extra Packages for Enterprise Linux Modular 8 - x86_64 0.0 B/s | 0 B 00:00
Failed to download metadata for repo 'epel-modular'
Error: Failed to download metadata for repo 'epel-modular'
# dnf update --refresh
CentOS-8 - AppStream 20 kB/s | 4.3 kB 00:00
CentOS-8 - Base 19 kB/s | 3.8 kB 00:00
CentOS-8 - Extras 7.4 kB/s | 1.5 kB 00:00
CentOS-8 - PowerTools 20 kB/s | 4.3 kB 00:00
Remi's Modular repository for Enterprise Linux 8 - x86_64 4.1 kB/s | 3.5 kB 00:00
Safe Remi's RPM repository for Enterprise Linux 8 - x86_64 3.6 kB/s | 3.0 kB 00:00
Wazuh repository 0.0 B/s | 0 B 00:00
Failed to download metadata for repo 'wazuh_repo'
Error: Failed to download metadata for repo 'wazuh_repo'
How do I resolve this problem?
In my case
sudo rm -r /var/cache/dnf
solved my problem.
Source: https://access.redhat.com/discussions/4222851
I was getting the same error with the Centos8 build inside of a docker container. Fixed by running the below:
# Do on build
RUN dnf clean all && rm -r /var/cache/dnf && dnf upgrade -y && dnf update -y
Error before (i was running yum update and not dnf):
Step 4/5 : RUN yum clean all && yum update -y && echo hostname -a
---> Running in 10d319da361d
0 files removed
CentOS-8 - AppStream 0.0 B/s | 0 B 00:05
Failed to download metadata for repo 'AppStream'
Error: Failed to download metadata for repo 'AppStream'
Success after:
---> 0b96049ee5eb
Step 4/5 : RUN dnf clean all && rm -r /var/cache/dnf && dnf upgrade -y && dnf update -y & echo hostname
---> Running in f928c6da6cb0
hostname
Removing intermediate
I just faced this problem so I thought I'd add what fixed it for me since the resolution was pretty simple. For me, I was overlooking the fact that whenever I changed my hostname, it was wiping out everything in /etc/resolv.conf so I:
nano -w /etc/resolv.conf **
added the following lines:
nameserver 8.8.8.8
nameserver 8.8.4.4
Test it (e.g. yum update -y)
**note: I used nano in example, simply swap the nano portion for your own text editor of choice
If it does not work, check your Internet connection. This error appeared on my CentOS 8 installation, and the problem was that the Internet connection wasn't correctly configured.
Just add the following (DNS server) to /etc/resolv.conf file:
nameserver 9.9.9.9
Will fix the issue :)
I was facing this issue when I tried to run
yum update -y
from a docker container. I changed the version from centos:8 to centos:7 and it solved the issue for me.
You may not realize it, but yum and dnf require SSL certificates when communicating via secure HTTP (aka HTTPS). Have you checked the certificates under /etc/pki/tls/certs? There should be at least two, for example:
/etc/pki/tls/certs# ls -l
total 4
lrwxrwxrwx 1 root root 49 Jan 30 12:48 ca-bundle.crt -> /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
lrwxrwxrwx 1 root root 55 Dec 11 13:19 ca-bundle.trust.crt -> /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt
If these links are missing you may be able to simply restore them. Otherwise, the files are part of the ca-certificates package. You can obtain them from another server running your operating system via yumdownloader then restore your certificates from the resulting RPM file using yum --nogpgcheck localinstall <RPM file>.
I had the same error after I was messing around with SD adapter to microSD card. Edit /etc/fstab to remove SD line solved the issue for me.
I will confirm I recently had this issue and what fixed it for me was a change in the DNS servers. I had a static IP set but DNS was automatic, I had to reconfigure DNS to use my gateway and dc. This is working now.
My issue was that the interface wasn't up after a fresh vm install.
Ran ifconfig to find my interface name and then ifup eXXX to get a dhcp ip address.
Also don't forget to change ONBOOT=no to ONBOOT=yes in /etc/sysconfig/network-scripts/ifcfg-eXXX so it comes up during next boot.

How can install sensu-plugins through a proxy or by offline package

I am using Debian 7 amd64, sensu (version 0.28.4-1).
I install sensu-plugins through a proxy with the command:
/opt/sensu/embedded/bin/gem install sensu-plugins-redis --user-install --no-document -p http://myproxy:3128 --verbose -s https://rubygems.org/
But have an error:
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - send(2)
When I try to directly install it in a server, which have directly internet connection, everything is successful.
I don't know why.
I also find key work: install sensu-plugins by offline package, but not have recommendation.
Please help me, thanks so much.