Trying to get yum to install dependencies from own repo - repository

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

Related

rpm build with local Required: some_local_package.rpm

Requires: in the spec files sets the package dependencies, but what will happen if the repo of the requirements is not in the repolist?
Is there a way to use pre downloaded rpm files and tell the rpmbuild that the dependencies should be installed from the local file like yum localinstall.
You're conflating rpm and yum when you mention repolist.
rpm is a lower level and only knows about RPM files
yum collects sets of RPMs into repositories and sits on top of RPM to handle dependencies
Now, to answer the question - rpmbuild does not need anything from the Requires field to build the RPM. If it does, then the RPMs should be listed as BuildRequires in the specfile and only be in Requires if the end user needs it to be installed to run the final product. For example, to build you might need foo-devel but at runtime you only need libfoo. Those should be declared appropriately.
Even if you fix the Requires vs. BuildRequires fields, it still won't help you - rpmbuild cannot install RPMs itself because you should never run rpmbuild as root. An error in a specfile can very easily nuke an entire machine if it's run as root.

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

downgrade rpm package from experimental repo just by disabling the repo and yum update

I have packages Foo-2.0.rpm and Foo-2.3.rpm. The former is normally distributed by the Linux distro but old. Foo-2.3 is the latest version, and the rpm I am making. I am writing the .spec file, and for now, keep it in my own repo.
I thought--and I thought I even did--that I could replace Foo-2.3 with Foo-2.0 (downgrade to the stable version) by doing the following:
yum-config-manager --disable myrepo
yum --update Foo
Provided that Foo-2.3 was installed, the expected outcome is to have Foo-2.0 in place of Foo-2.3.
However, now, it gives me the following message only:
# yum update Foo
No packages marked for update
"yum downgrade Foo" seems a working command.
Why "yum update" does not work as I expected? Is it because of my spec file? Or is it just something that is not working?
In the .spec file of Foo, Foo "Provides: Foo-2.3," and "Conflicts: Foo <= 2.1." I have lost a few the spec files in development. Although I think disabling the repo and "yum update" downgraded Foo, my memory might be wrong.
yum upgrade always went up. When in the repo is a higher version, then upgrade. If there is older, just do nothing. It always acted this way. Even rpm itself behave this way. But for rpm you can force it to downgrade with upgrade with rpm -Uvh --force Foo-2.0.rpm. For yum there is no way. You have to use downgrade command.
And BTW in your spec file should be:
Provides: Foo-2.3
Obsoletes: Foo <= 2.1
But this is usually needed when you rename the package. Which I believe is not your case.

Yum install package and all its dependencies from local directory

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