Issues installing Docker on RHEL 7 Linux Server - linux

I have been constantly running into this issue more and more lately, and finally need some assistance because I'm completely stuck.
I just got access to a RHEL EC2 Linux server and I am just simply trying to install Docker. This process has been extremely painful lately. Tons of 404 HTTP Not Found errors when trying to follow the processes mentioned online
According to https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html, you can just simply run one of the following two commands:
sudo amazon-linux-extras install docker
sudo yum install docker
However, neither one of these comands work, as shown in the output below:
[root#d8de679d27f2454 myuser]# sudo amazon-linux-extras install docker
sudo: amazon-linux-extras: command not found
[root#d8de679d27f2454 myuser]# yum install docker
Loaded plugins: amazon-id, search-disabled-repos
No package docker available.
Error: Nothing to do
[root#d8de679d27f2454 myuser]#
Here is a list of things I've tried to do :
First Attempt (RE: How to install docker on Amazon Linux2)
The second answer proposed in that you can just run the following:
sudo yum update -y
sudo yum -y install docker
However, that doesn't work either, as shown in the output below:
[root#d8de679d27f2454 myuser]# yum update -y
Loaded plugins: amazon-id, search-disabled-repos
No packages marked for update
[root#d8de679d27f2454 myuser]# yum -y install docker
Loaded plugins: amazon-id, search-disabled-repos
No package docker available.
Error: Nothing to do
[root#d8de679d27f2454 myuser]#
Second Attempt: Installing via get.docker.com
When running curl https://get.docker.com | bash, that doesn't work either
Third Attempt: https://computingforgeeks.com/install-docker-ce-on-rhel-7-linux/
Part of this article suggests running the following two commands:
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
However, that doesn't work either:
# yum install -y yum-utils device-mapper-persistent-data lvm2
Loaded plugins: amazon-id, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
https://download.docker.com/linux/rhel/7/x86_64/stable/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/articles/1320623
If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.
One of the configured repositories failed (Docker CE Stable - x86_64),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=docker-ce-stable ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable docker-ce-stable
or
subscription-manager repos --disable=docker-ce-stable
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=docker-ce-stable.skip_if_unavailable=true
failure: repodata/repomd.xml from docker-ce-stable: [Errno 256] No more mirrors to try.
https://download.docker.com/linux/rhel/7/x86_64/stable/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Here's the output of my cat /etc/os-release command
NAME="Red Hat Enterprise Linux Server"
VERSION="7.9 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.9"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.9 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.9:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
Any help would be greatly appreciated. It seems nearly impossible to install docker at this point.

Ran the following commands and this worked:
yum install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch.rpm
yum install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-17.03.0.ce-1.el7.centos.x86_64.rpm

Download latest version of these 3 packages from internet and
[root#test_hostame docker19.03_rpm]# ll
total 93904
-rw-r--r-- 1 root root 30381608 Jan 20 18:19 containerd.io-1.3.9-3.1.el7.x86_64.rpm
-rw-r--r-- 1 root root 25519432 Jan 20 18:19 docker-ce-19.03.14-3.el7.x86_64.rpm
-rw-r--r-- 1 root root 40247412 Jan 20 18:19 docker-ce-cli-19.03.14-3.el7.x86_64.rpm
run command in folder where only these 3 packages are present
yum localinstall *rpm
It is surely gonna work. If it doesnt, share your error.

Related

Can not install mariadb on amazon linux ARM: packages not found

Working fine on Amazon Linux with Intel arch but not on ARM. I have followed one of the many guides like this one: https://techviewleo.com/how-to-install-mariadb-server-on-amazon-linux/
So executed:
sudo amazon-linux-extras | grep mariadb
got version 10.5, so continued:
sudo yum -y update
sudo reboot
curl -LsS -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
sudo bash mariadb_repo_setup --os-type=rhel --os-version=7 --mariadb-server-version=10.5
sudo rm -rf /var/cache/yum
sudo yum makecache
sudo amazon-linux-extras install epel -y
So far so good, now:
yum install MariaDB-server MariaDB-client -y
....
--> Finished Dependency Resolution
Error: MariaDB-common conflicts with MariaDB-server-10.5.17-1.el7.centos.aarch64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
"--skip-broken" argument does not help.
When trying version 10.10:
yum install MariaDB-server MariaDB-client -y
....
https://dlm.mariadb.com/repo/mariadb-server/10.10/yum/rhel/7/aarch64/rpms/galera-4-26.4.12-1.el7a.aarch64.rpm: [Errno -1] Package does not match intended download. Suggestion: run yum --enablerepo=mariadb-main clean metadata
Trying other mirror.
Error downloading packages:
MariaDB-server-10.10.1-1.el7.centos.aarch64: [Errno 256] No more mirrors to try.
galera-4-26.4.12-1.el7a.aarch64: [Errno 256] No more mirrors to try.
MariaDB-client-10.10.1-1.el7.centos.aarch64: [Errno 256] No more mirrors to try.
"yum --enablerepo=mariadb-main clean metadata" does not help.
I've tried all version between 10.5 and 10.10, all failing.
EC2 machine deployed right now (t4g.medium). Did not have any problems on intel arch last week with exactly same code.
What is wrong ?
Thanks,
Centos7 for non-x86_64 platforms is deprecated. Ref: https://mariadb.com/kb/en/deprecation-policy/
The RHEL7 that feeds Centos 7 ended supported for non-86_64 platforms. While Centos7 still claims to be supported for aarch64, they simply don't get bugs fixes (including bugs affecting the MariaDB development that got noticed and reported to RHEL, that got fixed in RHEL8 only) so for all intensive purposed its not maintained.
As such MariaDB is no longer performing releases for Centos/RHEL 7 on non-x86_64 platforms.
ref: MDEV-30636

Unable to install docker on Amazon linux

I'm trying to install docker on Amazon Linux Ec2 instance, I get the following error.
Installing docker
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Cleaning repos: amzn2-core amzn2extra-docker amzn2extra-lamp-mariadb10.2-php7.2 amzn2extra-php7.2 docker-ce-stable
4 metadata files removed
0 sqlite files removed
0 metadata files removed
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core | 3.7 kB 00:00:00
amzn2extra-docker | 3.0 kB 00:00:00
amzn2extra-lamp-mariadb10.2-php7.2 | 3.0 kB 00:00:00
amzn2extra-php7.2 | 3.0 kB 00:00:00
https://download.docker.com/linux/centos/2/x86_64/stable/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
One of the configured repositories failed (Docker CE Stable - x86_64),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=docker-ce-stable ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable docker-ce-stable
or
subscription-manager repos --disable=docker-ce-stable
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=docker-ce-stable.skip_if_unavailable=true
failure: repodata/repomd.xml from docker-ce-stable: [Errno 256] No more mirrors to try.
https://download.docker.com/linux/centos/2/x86_64/stable/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Installation failed. Check that you have permissions to install.
[root#ip-172-31-79-10 ec2-user]# ^C
[root#ip-172-31-79-10 ec2-user]# chkconfig docker on
error reading information on service docker: No such file or directory
I just had the same problem when I tried to install docker on a centos machine
I followed the official guide here and found out the commad:
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
messed up the installation..
my solution was:
delete the installed docker-repo:
sudo rm /etc/yum.repos.d/docker-ce.repo
install docker: sudo yum install docker
Follow official guide!
You can find it in the below link
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-container-image.html

Unable to install libsasl2-devel on Amazon Linux 2 machine

I am running Ansible playbook and trying to install OS dependencies packages for python. I am trying to run the following:
sudo yum install gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel libsasl2-devel openldap-devel
However, it fails at installing libsasl2-devel with the message:
"No package matching 'libsasl2-devel' found available, installed or updated"
All my instances are Amazon Linux 2 machines. Is there any alternative package for this? I tried to look into this but I found solutions for Ubuntu only.
I was able to get it to work in a series of steps. Its a yum issue after other databases are installed and not cleaned up before installing mysql
clear sasl first: sudo yum remove cyrus-sasl
if you have installed maria, there will be conflicts, remove that as well
sudo yum remove mariadb mariadb-server mariadb-libs
take note of anything uninstalled by this to re-add later. If this is too much, you can take a risk and not remove sasl, but it might not reset the availability of the package.
Start here to clean up the dependency issues: https://serverfault.com/questions/873955/how-solve-mysql-5-7-dependency follow the command given by clean all as sudo rm -rf /var/cache/yum/*
This can possibly resolve your issues right there, if not continue the installation below.
delete all data left in /var/lib/mysql/ or you may have upgrade issues.
resinstall sasl:
sudo yum install cyrus-sasl cyrus-sasl-devel and any other packages removed above.
Establish mysql5.7 with the yum services.
wget https://dev.mysql.com/get/mysql57-community-release-el6-11.noarch.rpm
sudo yum localinstall -y mysql57-community-release-el6-11.noarch.rpm
sudo yum repolist enabled | grep "mysql.*-community.*"
sudo yum repolist enabled | grep mysql
sudo yum install -y mysql-community-common mysql-community-libs mysql-community-server mysql-community-client
if that doesn't work, re-clear the yum cache again and re-run sudo yum install -y mysql-community-server
if that works, then
sudo service mysqld start
IF the /var/lib/mysql is empty, it will have created a temporary password in the /var/log/mysqld.log (use sudo to read)
run sudo mysql_secure_installation and establish your real password and security settings.
now you should have access via mysql -u root -p

can't install httpd-devel rpm by using yum without internet access

I tried to install httpd-devel rpm package by using yum without internet access.
I downloaded dependencies rpm packages by using --downloadonly option of yum on other coumptuer,
and then I move rpm packages what I downlaoded to the machine what I want to install httpd_devel.
this is centos 6.8 release version.
I expect to install currently. but the machine showed error message bellow.
Running
yum install -y httpd-devel-2.2.15-69.el6.centos.x86_64.rpm
gives this output:
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Examining httpd-devel-2.2.15-69.el6.centos.x86_64.rpm: httpd-devel-2.2.15-69.el6.centos.x86_64
Marking httpd-devel-2.2.15-69.el6.centos.x86_64.rpm to be installed
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os&infra=stock error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot find a valid baseurl for repo: base
yum tries to refresh its repositories which won't work without internet. I see two solutions:
1) tell yum not to look at any of its configured repositories:
yum --disablerepo="*" install -y httpd-devel-2.2.15-69.el6.centos.x86_64.rpm
2) use rpm directly; don't use yum:
rpm -Ivh httpd-devel-2.2.15-69.el6.centos.x86_64.rpm

Unable to yum install anything on RHEL

I am on a new RHEL system.
I seem to be unable to be able to install anything package via yum install.
yum install nmap
The current repos in
ls /etc/yum.repos.d/
google-chrome.repo redhat.repo rhel-source.repo
What could be going wrong ?
OUTPUT OF YUM INSTALL:
$ sudo yum install nmap
[sudo] password for user:
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Setting up Install Process
No package nmap available.
Error: Nothing to do
Red Hat doesn't use the /etc/yum.repos.d directory for official packages so the answer won't be in there. It will use the subscription plugin placed in /etc/yum/pluginconf.d.
You mentioned that the RHEL host is new. You will need to make sure your subscription is valid or yum will fail silently.
You can use the subscription-manager list command to gain info regarding subscriptions.
Centos has done it for you.
Create a repo file in /etc/yum.repos.d as
vi /etc/yum.repos.d/myrepo.repo
Then paste this in this file:
[centos]
name=CentOS-7
baseurl=http://ftp.heanet.ie/pub/centos/7/os/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://ftp.heanet.ie/pub/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7
Saving it with wq! now run
yum repolist
Check if you can install any package (say nmap)
yum install nmap -y
Enjoy!!!
Try "searching" for the correct package name in the reps by using yum list
yum list nmap
I guess the correct package name and install command is:
yum install nmap.x86_64
You can also do a "yum search somename"
In my case, I was trying to install OpenJDK using yum; sudo yum install -y java-1.8.0-openjdk-devel but received an error message stating that a dependency was unavailable:
---> Package java-1.8.0-openjdk-headless.x86_64 1:1.8.0.201.b09-1.el6_10 will be installed
--> Processing Dependency: pcsc-lite-devel(x86-64) for package: 1:java-1.8.0-openjdk-headless-1.8.0.201.b09-1.el6_10.x86_64
--> Finished Dependency Resolution
Error: Package: 1:java-1.8.0-openjdk-headless-1.8.0.201.b09-1.el6_10.x86_64 (rhel-6-server-rpms)
Requires: pcsc-lite-devel(x86-64)
**********************************************************************
yum can be configured to try to resolve such errors by temporarily enabling
disabled repos and searching for missing dependencies.
To enable this functionality please set 'notify_only=0' in /etc/yum/pluginconf.d/search-disabled-repos.conf
**********************************************************************
I resolved this by following the suggestion please set 'notify_only=0' in /etc/yum/pluginconf.d/search-disabled-repos.conf and then ran the yum command again. This time yum loaded a bunch of [previously disabled] repos and searched through them, finally reporting success and this message:
*******************************************************************
Dependency resolving was successful thanks to enabling these repositories:
rhel-6-server-optional-rpms
*******************************************************************
So there was no ignored *-devel repo, but still doing this worked. For clearance, the explicitly ignored repos are: ignored_repos=*debug-rpms *source-rpms *beta-rpms
..so that worked, but I'm still no wiser on the mechanics of this..
If you have OS image in your lab or any location you can try this for some RPMS
vim /etc/yum.repos.d/rhel.repo
[rhel]
name=rhel
baseurl=http://172.25.5.25/osimages/rhel7.2_64bit
enabled=1
gpgcheck=0
Then do yum clean all
baseurl is the location where your OS image is available. No subscription is needed, it is reusing your OS image
Try installing using:
yum install nmap-frontend
It worked for me on Red Hat Enterprise Linux Server release 7.7 (Maipo)
You can use the following line to test:
nmap 25 gmail-smtp-in.l.google.com

Resources