Yum install package and all its dependencies from local directory - yum

I have downloaded a package and all of its dependencies using yum's download only option into a local directory. I want to then install the package and its dependencies from that directory by passing yum the name of the rpm that contains the primary package in a manner similar to how pip lets you install wheel packages from local directories (provided the wheel files for the dependencies are also present). I DO NOT want yum to try and download the dependencies from a remote repo.
Basically I want this only for yum:
pip install --no-index --find-link=/directory-with-wheel-files primary_package.whl
I have used these links to try and solve my problem:
How to make rpm auto install dependencies
https://unix.stackexchange.com/questions/281715/how-can-i-install-a-local-rpm-using-only-the-local-dependency-rpm-files?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
https://wiki.centos.org/HowTos/CreateLocalRepos
https://www.ostechnix.com/install-packages-specific-repository-linux/
My repo file looks like this:
[basemap]
name=Basemap
baseurl=file:///var/tmp/install/basemap
enabled=1
gpgcheck=0
and my folder /var/tmp/install/basemap has been turned into a repo using yum's createrepo. Yet when I run yum --enablerepo=basemap install primary_package.rpm yum still tries to download the dependencies from the internet. How do I force it to look in my local repo for the dependencies?

Figured it out. I had one option missing from my yum command. I had to disable other repos and then enable only my repo. This command worked:
yum --disablerepo='*' --enablerepo=myrepo install primary_package.rpm

Related

Msys2 included packages

Is there a way to find out what default packages are installed along with Msys2 installation. I see that there is openssh, curl, git installed which I didn't. If there is a list that would also be useful. The official base package repository has a long list with thousands of entry.
After installing MSYS2, run pacman -Q to list the packages that are installed.

Yum install graphviz on RHEL 7 fails with 'No package graphviz available.'

I am trying to install graphviz on my RHEL VM. when I run
$sudo yum install graphviz
I get this:
This system is not registered with an entitlement server. You can use subscription-manager to register.
No package graphviz available.
Error: Nothing to do
I later found out that I get this same problem with all packages.
I have tried several solutions I have found online such as:
saving the .repo file found here (this link will download the file)
then running
#from dir containing graphviz-rhel.repo
$sudo yum-config-manager --add-repo graphviz-rhel.repo
the output was
This system is not registered with an entitlement server. You can use subscription-manager to register.
adding repo from: graphviz-rhel.repo
grabbing file graphviz-rhel.repo to /etc/yum.repos.d/graphviz-rhel.repo
repo saved to /etc/yum.repos.d/graphviz-rhel.repo
Then I ran
$sudo yum-config-manager --enable graphviz-rhel
This gives no output and $yum-config-manager list all does not list anything related to graphviz as a repo (enabled or disabled)
I tried the solution here: failed to install 'graphviz*' packages with yum command on my RHEL server
except I found the rpm file here
When I ran the rpm command I got an error because I was missing a couple dozen dependencies so I dont think following this solution for all of them is a reasonable solution.
If someone can either inform me why one of these didn't work or let me know how to accomplish my goal of getting yum install <package> to work I would greatly appreciate it.
As posted in the comments, in order to utilize yum on a RHEL system you need an active subscription

How install Intl, GMP and BCMath PHP extensions?

Centos 6.8 Final
Php 7.0.16
Directadmin control panel
yum install php-gmp
yum install php-bcmath
yum install php-intl
result is: No package xxx available.
Thank you.
BCmath is already preinstalled with PHP. http://php.net/manual/en/bc.requirements.php
For other libs try to define repository where yum would search artifacts and then install the extension. For example,
yum --enablerepo=remi install php-intl
Another alter way is described there https://webtatic.com/packages/php70/
Take a look at the php70w-common package which includes gmp, and further just install php70w-bcmath and php70w-intl. Don't forget to enable all packages inside php.ini.

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

Trying to get yum to install dependencies from own repo

I have created a yum repository on a machine I have. I have thrown certain RPM's into it and created the repo. On my second machine I am able to view these repos and the files in them by doing a yum list. The second part of this is I have done a spec file that creates an rpm that depends on all of the RPM's in this specific repo but when I do a yum install createdrpm it determines the correct dependencies, but does not install them from my own repo.
I have tried searching over the web for this, but no luck unfortunately. If someone can point me in the right direction that would be great.
Thanks
In the rpm spec file, the Requires section should list the package names that are shown in the yum repo, not the rpm filenames.
For example:
yum list | grep something
something.noarch v1.0
The rpm spec file should have:
Require: something >= 1.0