RHEL Developer subscription not finding repos - rhel

I've been signed up for the Redhat Developer program for a while. I needed to do some tests in the RHEL 7.5 VM that had been working with the subscription program. When I reverted and did an update, I was able to get updates. However, I need to access some items via the downloads and had to change password on the site.
I unregistered my subscription and re-registered using new password. Now when I use subscription manager to list repos. It says returns:
$ sudo subscription-manager repos --list
This system has no repositories available through subscriptions.
It seems as though I have nothing but problems with subscription-manager. Is there something that I'm doing wrong with the Developer program?

I finally found the answer in the RedHat knowledge base. I still don't understand why it's so difficult to use.
You may want to clean up first:
sudo subscription-manager remove --all
sudo subscription-manager unregister
sudo subscription-manager clean
Re-register and attach:
sudo subscription-manager register
sudo subscription-manager refresh
sudo subscription-manager attach --auto
List repost and attach:
Execute sudo subscription-manager repos --list-enabled to see all actually enabled subscriptions.
Execute sudo subscription-manager repos --list to see all subscriptions that are available for you.
Execute sudo subscription-manager repos --enable <repo> if you want to add additional repos.

Related

Docker: container cannot find local repo

I am trying to build a centos image, then run basic yum commands from a company network with no internet access. After successfully grabbing the centos artifact in step 1, next comes RUN yum update where the container tries to load plugins using http://mirrorlist.centos.org, and that obviously will not work. It cannot resolve that host because no web access. So, I get the error:
Loaded plugins: fastestmirror, ovl
Determining fastest mirrors
..."Could not resolve host http://mirrorlist.centos.org; Unknown error"
One of the configured repositories failed (Unknown),
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=<repoid> ...
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 <repoid>
or
subscription-manager repos --disable=<repoid>
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=<repoid>.skip_if_unavailable=true
Cannot find a valid baseurl for repo: base/7/x86_64
The command '/bin/sh -c yum update' returned a non-zero code: 1
I have a repo file in /etc/yum.repos.d that contains content described here. In that file, I have multiple local repo URLs. An [updates] entry has a baseurl for /updates. Is this entry supposed to be used by the container when I do a RUN yum update in my Dockerfile? How does the container know where to look for a local mirror repo or other repo?
Is there also an issue regarding localhost on the host vs. localhost in the container?
I have researched a dozen S.O. entries with no luck.
UPDATE: Dockerfile so far...
FROM path.to.repo/centos
RUN yum update
So, it errors upon yum update.
When you're creating images that can't reach the web but only internal network, you must change tools configuration before trying to use them.
With yum, you have to remove existing repos and replacing them with yours before RUN yum update, something like that :
FROM path.to.repo/centos
RUN rm -rf /etc/yum.repos.d/*.repo
COPY myprivate.repo /etc/yum.repos.d/
RUN yum update
File myprivate.repo must be defined in the same folder as your Dockerfile and must declares your repos.
Furthermore, this created image can now be used as a base image for all others images you need to create.

RH 7.1 Linux, yum install issue

The Host is registered with Redhat, when I try yum install it says
There are no enabled repos
How to enable repos.
There is similar question here which is unanswered.
[root## yum install pdksh.x86_64
Loaded plugins: langpacks, product-id, subscription-manager
This system is registered to Red Hat Subscription Management, but is not receiving updates. You can use subscription-manager to assign subscriptions.
There are no enabled repos.
Run "yum repolist all" to see the repos you have.
You can enable repos with yum-config-manager --enable <repo>
To resolve your subscription related issue please follow this.
https://access.redhat.com/solutions/253273
And regarding your pdksh installation, Pdksh was an open source version that had many of the ksh'88 shell features, which was only available for commercial Linux system and licensed by AT&T. Starting with RHEL 6, pdksh has been deprecated. If you need the Korn shell, use the standard public domain ksh (ksh'93)
yum install ksh
Hope this helps

yum error - centos 7.1 x86_64

I'm facing an issue with the yum command on a dedicated server (hosted by OVH):
[root#mail-server ~]# yum clean all
[root#mail-server ~]# yum update
Modules complémentaires chargés : fastestmirror
One of the configured repositories failed (Inconnu),
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. Disable the repository, 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 <repoid>
4. 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=<repoid>.skip_if_unavailable=true
Cannot find a valid baseurl for repo: base/7/x86_64
After investigation, i found that the error bellow (the url return not ok from the dedicated server) :
KO From dedicated server :
[root#mail-server ~]# curl "http://mirrorlist.centos.org/?release=7.1.1503&arch=x86_64&repo=os"
Invalid release
[root#mail-server ~]#
OK From home (ADSL)
MacBook-Air-de-John:~ jjohn$ curl "http://mirrorlist.centos.org/?release=7.1.1503&arch=x86_64&repo=os"
http://mirror.ate.info/ftp.centos.org/7.1.1503/os/x86_64/
http://ftp.rezopole.net/centos/7.1.1503/os/x86_64/
http://distrib-coffee.ipsl.jussieu.fr/pub/linux/centos/7.1.1503/os/x86_64/
http://mirror0.babylon.network/centos/7.1.1503/os/x86_64/
http://centos.crazyfrogs.org/7.1.1503/os/x86_64/
http://centos.mirrors.ovh.net/ftp.centos.org/7.1.1503/os/x86_64/
http://mirrors.ircam.fr/pub/CentOS/7.1.1503/os/x86_64/
ftp://ftp.free.fr/mirrors/ftp.centos.org/7.1.1503/os/x86_64/
http://mirror.ibcp.fr/pub/Centos/7.1.1503/os/x86_64/
http://ftp.ciril.fr/pub/linux/centos/7.1.1503/os/x86_64/
MacBook-Air-de-John:~ jjohn$
I got the same issue after a fresh install and on a friend's dedicated server (hosted by OVH too).
I don't know if the error is coming from OVH network (DNS, ...) or mirrorlist.centos.org server.
I solved the problem by typing
# dhclient
Your DNS doesn't seem to resolve the centos mirror list
Use
# dhclient
or Add "nameserver 8.8.8.8" in "/etc/resolv.conf" file
# vi /etc/resolv.conf [press i] now you are in insert mode
nameserver 8.8.8.8 [press: Esc][press :wq]
#
hope it work's..!
first you have to go to the /etc/yum.repos.d directory and edit the CentOS-Base.repo using vi editor. look for following lines;
mirrorlist=
baseurl=
remove the # sign in the #baseurl if you have difficulties in accessing the baseurl/mirrorlist web address using yum then save and exit the vi editor.
goodluck and enjoy the yum package-management utility in linux.
Best Regards-KB

Set proxy for terminal in linux

In CentOS 7 how can i connect terminal through a "proxy with username and password" and use some command like:
yum update
For now when i use this command i got this error:
Loaded plugins: fastestmirror, langpacks
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os error was
14: curl#7 - "Failed to connect to 2a02:2498:1:3d:5054:ff:fed3:e91a: Network is unreachable"
One of the configured repositories failed (Unknown),
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. Disable the repository, 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 <repoid>
4. 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=<repoid>.skip_if_unavailable=true
Cannot find a valid baseurl for repo: base/7/x86_64
yum uses HTTP so you need to set a http proxy for your environment.
Check this out: https://www.centos.org/docs/5/html/yum/sn-yum-proxy-server.html
try to run the command and you will be connected to do upload or whatever you want
Just add : dhclient and press enter the this command : yum update

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