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

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.

Related

A library is installed with `yum install` but not with `yum update`

In my CMakeLists.txt, I have the following:
set(CPACK_RPM_PACKAGE_REQUIRES "boost148, intel-daal-core-2018.1-163, \
intel-mkl-core-2018.1-163")
My problem is that when I do a yum install,the intel-mkl-core-2018.1-163 library gets installed, but when I do yum update on a machine that did not have intel-mkl-core - it does not get installed.
I also tried yum upgrade, with the same results.
The above does not seem to be the correct behaviour. Any suggestions on how to debug this issue?
(OS: CentOS/RedHat 7)
yum update means: update every currently installed package. If intel-mkl-core was not installed before, it won't be updated...
yum install means: install (or update) this package even if it was not installed before.

Error: Cannot find a valid baseurl for repo: google64

I just wanna to install vim using yum, however, the yum doesn't work.
And I tried to install other software using yum, the result remains the same.
I remembered typed commands like this: yum clean all, maybe it's the reason that yum doesn't work. How could I repair the yum configuring?

Install Older Version of Mono

Today my Ubuntu updated Mono to 4.2.1.102. It will not allow a certain program I absolutely need to run. How can I down-grade it to 4.0.5.1? I have tried...
sudo apt-get install mono-complete=4.0.5.1
That doesn't work.
Edit your /etc/apt/sources.list.d/mono-xamarin.list and change:
deb http://download.mono-project.com/repo/debian wheezy main
to:
deb http://download.mono-project.com/repo/debian wheezy/snapshots/4.0.5.1 main
That will pin it to version 4.0.5.1.
FYI: Make sure that you do not have any alpha/beta repos for mono in any of your /etc/apt/sources/list.d/xxxxx.list files.
Basic Steps to Downgrade:
sudo apt-get remove mono-complete
# Edit your mono-xamarin.list and pin it to the version of your choice.
sudo apt-get update
sudo apt-get install mono-complete
Accessing older releases If for some reason you want to pin an older
version of Mono rather than updating to the latest, you can modify the
Debian repository to “wheezy/snapshots/X.XX.X” instead of “wheezy”.
For example, “wheezy/snapshots/3.10.0” will lock you to that version.
These snapshots will cease receiving updates as soon as the next major
Mono version gets uploaded - for example, as soon as Mono 3.12 gets
uploaded, 3.10 will never receive updates.
On RPM distributions, force the package version in your package
manager - all older versions are published in the YUM metadata and
should be available.
Ref: http://www.mono-project.com/docs/getting-started/install/linux/#accessing-older-releases
Ref: Versions available:
http://download.mono-project.com/repo/debian/pool/main/m/mono/
If, like me, you followed the official guide: https://www.mono-project.com/download/stable/ then you would have added an apt key and created
/etc/apt/sources.list.d/mono-official-stable.list
You can keep the key, but remove the file above using sudo rm -r /etc/apt/sources.list.d/mono-official-stable.list
Then make sure you follow the best answer above by editing the mono-xamarin.list file for the version you want and remove the version of mono you have.
Then apt update, then install mono-complete. An easy way to know you are correctly downloading and compiling a different version is that apt will prompt you asking if you want to download the files, and the size will be different.
Hope this helps someone, this last step made it work for me.
My system is Ubuntu 18.04.

Should yum update <package-name> resolve dependencies?

I have foo-1.1 and foo-devel-1.1 both installed. Now I update my repo with foo-1.2 and foo-devel-1.2. After yum clean metadata, I simply type yum update, no problem. I get both foo-1.2 and foo-devel-1.2 reported as ready to update.
However, if I type yum update foo-devel the related foo dependency is not reported as ready to update. Is this correct behavior? How do I get the behavior I'm expecting? Which is that all dependencies resolve and update when a package name is specified as an argument to yum update.
$rpm -q yum
yum-3.2.29-43.el6_5.noarch
Thanks for any info!
-Fin
When updating all packages
yum update will update any packages that have a newer version available, and take care of dependencies.
From the manual page man yum:
While updating packages, yum will ensure that all dependencies are satisfied.
One thing to bear in mind is that while a package may have an update available, that does not mean that a dependency of that package has been updated too - they are after all seperate packages.
When updating a specific package
From the manual: If one or more packages or package globs are specified, Yum will only update the listed packages.
This seems to imply that if foo-devel requires foo, and you specify to update only foo-devel, then yum won't update foo to a newer version (unless foo-devel specifically requires the newer version).

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