Control yum update packages sequence - repository

Couldn't find an answer anywhere so I will try here.
Is there a way to tell yum, while running yum update, to update a specific package as the last one?
I am not talking about requires / dependencies, It just needs to be updated after all other packages on the system.
In a nutshell, I manage local repositories in my environment and this particular rpm holds the version for each repository, so by updating it as last I can label the client with that particular version.

You can run two yum commands. First one excluding the .rpm that you don't want to be updated and second, running your usual update.
$ yum --exclude="foo*.rpm" update
If foo*.rpm comes from a particular repository, then during the update, you can disable it using its name. Name of a repository can be found by looking into /etc/yum.repos.d/*.repo file or using the command
$ yum repolist
Then disable the repo and update. Note, this will disable update of all packages coming from this repo.
$ yum --disablerepo="nameOfRepo" update
Finally, run your usual update
$ yum update

Related

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.

How do I get the man command?

I just installed Windows Subsystem for Linux for the first time and downloaded the Debian distribution from the Windows Store.
The first thing I tried to do was use the "mv" command. The second thing was to run "man mv" because I don't remember how to use it. But I received the error:
-bash: man: command not found
It looks like the package I want is called manpages. But I can't install that:
sudo apt-get install manpages
[sudo] password for pi:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package manpages is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
E: Package 'manpages' has no installation candidate
How do I get the man command up and running?
apt update to update the local package lists followed by apt install man-db to install the actual package.
I want to add to elken's answer that apparently, the 'man-db' packages doesn't cover all the manpages. For example, I needed documentation for the C stdio library (fopen, fgets, ...), and for that I had to install 'manpages-dev':
sudo apt install manpages-dev
Apparently there are also some other manpage collections (/different names for them on certain unix distros), see https://superuser.com/questions/40609/how-to-install-man-pages-for-c-standard-library-functions-in-ubuntu

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).

SSH Install Mysqlnd - Package Not Found

I am trying to install Mysqlnd using ssh and the yum command but I keep getting the error that no such package exists. Can someone help me out? I have also tried yum search php-mysqlnd and there is no such package on the system.
Sounds like you'll have to pull it from another repo, I suggest Atomic's repo.
They have a simple one liner auto installer, give it a shot.
wget -q -O - http://www.atomicorp.com/installers/atomic | sh
Then of course yum update and then fire off yum install php-mysqlnd
Edit: Sounds like you've got some yum excludes active.
vi /etc/yum.conf and you'll likely see something to the effect of exclude=mysql* php*. You can comment out this line or just remove them altogether.
Another options is to use the command line option...
yum --disableexcludes=all which will kill all excludes currently active.
yum --disableexcludes=main which will kill all excludes in your main yum.conf.