yum update dependencies only - redhat

I install my new rpm package using yum install (my package name) command; yum command installs main rpm package along with dependencies; there is no issue.
If my main package is updated to new and higher version then yum update (my package name) work fine, without any issues.
Please note, I execute createrepo command whenever new rpm is copied into rpm collection folder.
Problem is: If only adependent rpm is upgraded i.e. to new version in rpm collection folder at repo server, How to update only dependent rpms on client machine (RH machine)?
What I tried:
1. sudo yum update (my package name) command always returns (my package name) is already updated but It did not even check dependencies for a new version
I added one more dependent pkg (deppkg) section in repo file like below:
[mainpkg]
name=simplest
baseurl="file:///home/anand/testcode/rpmtest/"
gpgcheck=0
[deppkg]
name=simplest
baseurl="file:///home/anand/testcode/rpmtest/"
gpgcheck=0
Having added one deppkg section, yum update deppkg started working which is obvious. Still, yum update mainpkg command still does not find new dependencies.
I do not want to go by 2nd option as there can be many pkgs and will have to add or delete time to time so it will be difficult in the long run.
Could you please let me know if there are any alternative ways which would be useful to update only dependencies from a remote machine?
Regards,
Anand Choubey

Just "sudo yum upgrade" should pull in the updates. Don't give it any package names.
Edit: If you only want the ones from your repo, you can do "sudo yum upgrade --disablerepo=* --enablerepo=yourreponame"

you can run sudo yum makecache to update repos
and sudo yum update --downloadonly to pull rpm's without installing it

Related

No package confluent-community-2.11 available

I am trying to install kafka on on centOS using this page .
https://docs.confluent.io/current/installation/installing_cp/rhel-centos.html
but getting this error
No package confluent-community-2.11 available.
After running this page command
sudo yum clean all && sudo yum install confluent-community-2.11
It seem no rpm is given here: https://packages.confluent.io/rpm/5.1/7
You need both repos added to yum, not just the 5.1/7 (which has some specific additional packages, not the main confluent-community-2.11 package)

Install Obsolete Devtoolset Collection for CentOS

At present time Devtoolset-5 (and earlier) cannot be istalled from Software Collection Repository (centos-release-scl) using yum (only Devtoolset-6 and 7 are available). Nevertheless, this collection can be downloaded as a list of rpm-packages. Is it possible to enable such EOL collections for yum, or maybe there is another way to install them correctly?
There was no DTS 5 release. It was skipped to align the DTS version with the GCC major release, once GCC switched to a yearly increasing version number.
DTS versions 3 and 4 are available from the centos-release-scl repository.
While Devtoolset-3 and 4 are located on the Centos mirror site, yum will not be able to find them as they were not included in the repodata on the site. These were probably excluded because they are EOL (end-of-life), and have dependency bugs (Bug 1410152). Try using the older Devtoolset-3 packages here, which do not have the dependency issues:
https://copr.fedorainfracloud.org/coprs/rhscl/devtoolset-3/
If you really want the packages from the centos.org site, I went with wget to download all the RPMs, then recreated a local yum repo. However, you'll see the dependency issues and yum install devtoolset-3 will fail.
$ wget -r -p -e robots=off --directory-prefix="/mnt/local-devtoolset3-repo" --recursive --no-clobber --no-parent http://mirror.centos.org/centos/6/sclo/x86_64/rh/devtoolset-3/
$ sudo yum install createrepo
$ cd /mnt/local-devtoolset3-repo
$ createrepo --database .
You can install the obsolete devtoolset-3 in this way:
sudo yum --obsolete install devtoolset-3

yum local install to install a package with its dependency

I have downloaded a package with it's dependency and want to install a package with dependency. Even though i have download in local folder it's checking for online.
sudo yum -y --disablerepo=* localinstall autoconf-2.69-11.el7.noarch.rpm
I am trying above command but failed to load it's dependency that is there in same folder.
Thanks,
Hare
Inside the local directory where you have all the downloaded RPMs, do this:
sudo yum --disablerepo=* localinstall *.rpm
OR
sudo yum --disablerepo=* localinstall foo.rpm bar.rpm baz.rpm
Since you have downloaded all the dependencies to a single directory, you can also use rpm to install those:
sudo rpm -Uvvh *.rpm --test
--test does a dry-run. Remove it to install on disk.
Even if the solution provide by iamauser is very great (and I am using it all the time), I wish to give you an other way to do it.
It exists yum-downloader command which doing basically the same thing for you.
# yumdownloader <package> --resolve
You just have to download it first :
# yum install yum-utils
Overall, I suggest you to read this article from Red Hat company site's which details everything about those two methods :
https://access.redhat.com/solutions/10154

centos yum fails installing anything or updating system

I am trying to install a package on CentOS, but it throws error when I run the "yum" command. The internet connection is working fine.
I try to yum clean all but problem persist.
Error:
[root#dcos-master3 ~]# yum install ntp
Loaded plugins: fastestmirror
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/$releasever/x86_64
My yum repolist is the next:
[root#dcos-master3 ~]# yum repolist list
Loaded plugins: fastestmirror
https://yum.dockerproject.org/repo/main/centos/%24releasever/repodata/repomd.xml: [Errno 14] HTTPS Error 403 - Forbidden
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/solutions/69319
If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/
repolist: 0
If I list the repolist:
[root#dcos-master3 ~]# yum repolist
Loaded plugins: fastestmirror
https://yum.dockerproject.org/repo/main/centos/%24releasever/repodata/repomd.xml: [Errno 14] HTTPS Error 403 - Forbidden
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/solutions/69319
If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/
repo id repo name status
base/$releasever/x86_64 CentOS-$releasever - Base 0
dockerrepo/$releasever Docker Repository 0
extras/$releasever/x86_64 CentOS-$releasever - Extras 0
updates/$releasever/x86_64 CentOS-$releasever - Updates 0
repolist: 0
BEFORE TRYING ANY OF THIS, HAVE A BACKUP OF YOUR MACHINE, YOU COULD DAMAGE YOUR OS MORE/COMPLETELY
It seems that your yum variable $releasever is somehow corrupt,
it usually is caused by missing centos-release package on the machine for some obscure reasons.
You can check if you have the package by:
rpm -qi centos-release
You will probably see:
"package centos-release is not installed"
First find out the exact centos version that you have by executing as root:
cat /etc/redhat-release
You will see something like this:
CentOS Linux release 7.3.1611 (Core)
You can fetch the centos-release package from repo by:
wget http://vault.centos.org/centos/7.3.1611/updates/x86_64/Packages/centos-release-7-3.1611.el7.centos.2.5.x86_64.rpm
Now run reinstall centos-release package via rpm:
sudo rpm -Uvh --replacepkgs centos-release-7-3.1611.el7.centos.2.5.x86_64.rpm
As next you can try to install something with yum and you might get:
[root#dcos-master3 ikerlan]# sudo yum install wget
error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch
error: cannot open Packages index using db5 - (-30969)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:
Error: rpmdb open failed
Now you can try to reboot the machine or try to use the following command to rebuild the rpm db:
rpm --rebuilddb
I came across the same issue while downloading some packages in centos 7. After days of search, I found the solution:
Go to the yum repo directory.
cd /etc/yum.repos.d.
Make a copy of the CentOS-Base.repo file.
cp CentOS-Base.repo CentOS-Base.repo.old
Edit the CentOS-Base.repo file. Comment mirrorlist and uncomment baseurl.
vi CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Now when you use yum, do the following.
sudo yum --disablerepo=* --enablerepo=base install httpd
Likewise for yum update.
sudo yum --disablerepo=* --enablerepo=base install httpd
It should work now.
I ran into this problem when attempting to install MariaDB on CentOS 7. I was super frustrated and after much searching found the answer at this link.
Here is what fixed this problem for me. Run as root.
# yum --disablerepo "*" --enablerepo epel install [package]
# yum clean all
"epel" can be whatever repo you like, but this one worked for me. Place [package] in the command just as written, not what package you are trying to install.
After you run the above, exit root and run whatever install you were attempting before encountering the error.
I noticed that in the failing url, your $releasever is %24releasever, but it should be 7 or 7.14.xx. Please check your yum config file at /etc/yum/var, or search in every .repo file, to see what is its value. It may be corrupted.
See Red Hat documentation for more information about how to set these variables.
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sec-using_yum_variables
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y
yum -y install yum-utils
yum-config-manager --enable remi-php74
Then proceed to your installation/updates/etc
Always make sure NAT is active on your centos7. Specially when there is a VMnet2 for host. Because sometimes VMNet2 can be active instead of NAT and because of that you will not be able to connect to the internet through centos7. This is just a one reason for getting that error.

Duplicate Package - update / upgrade - Centos

When I try running yum update on a CentOS 6.3 box, I am getting errors, and says to run yum check. The output of yum check is:
➜ ~ yum check
Loaded plugins: fastestmirror
glibc-2.12-1.107.el6_4.5.x86_64 is a duplicate with glibc-2.12-1.107.el6_4.4.x86_64
glibc-common-2.12-1.107.el6_4.5.x86_64 is a duplicate with glibc-common-2.12-1.107.el6_4.4.x86_64
glibc-devel-2.12-1.107.el6_4.5.x86_64 is a duplicate with glibc-devel-2.12-1.107.el6_4.4.x86_64
glibc-devel-2.12-1.107.el6_4.5.x86_64 has missing requires of glibc-headers = ('0', '2.12', '1.107.el6_4.5')
iputils-20071127-17.el6_4.2.x86_64 is a duplicate with iputils-20071127-17.el6_4.x86_64
nspr-4.9.5-2.el6_4.x86_64 is a duplicate with nspr-4.9.2-1.el6.x86_64
nss-3.14.3-4.el6_4.x86_64 is a duplicate with nss-3.14.0.0-12.el6.x86_64
nss-softokn-3.14.3-3.el6_4.x86_64 is a duplicate with nss-softokn-3.12.9-11.el6.x86_64
nss-util-3.14.3-3.el6_4.x86_64 is a duplicate with nss-util-3.14.0.0-2.el6.x86_64
tzdata-2013g-1.el6.noarch is a duplicate with tzdata-2013c-2.el6.noarch
2:xinetd-2.3.14-39.el6_4.x86_64 is a duplicate with 2:xinetd-2.3.14-38.el6.x86_64
Error: check all
Any idea how to fix these packages? I tried yum reinstall xinetd tzdata nss-util nss-softokn nss nspr iputils glibc glibc-common glibc-devel but got:
Error: Multilib version problems found. This often means that the
root
cause is something else and multilib version checking is just
pointing out that there is a problem.
For me it looks like you rebooted your computer (or it crashed) while you where in the process of upgrading packages. So new packages where installed, but old packages where not removed.
First look if you have any uncomplete transactions with: yum-complete-transaction
If this doesn't help then take a look at the package-cleanup tool which is part of the yum-utils package.
package-cleanup --dupes lists duplicate packages
package-cleanup --cleandupes removes duplicate packages
But be carefull with the command and create a backup before removing duplicates.
This is the way I did fix one CentOS 7 server with 471 dupes.
First I had to install yum utils:
yum install yum-utils
Have tried yum-complete-transaction and other stuff without luck, I gave up the transaction with:
yum-complete-transaction --cleanup-only
Then I got a sorted list of duplicated packages so I could identify older versions to remove filtering even and odd lines later:
package-cleanup --dupes | sort -u > dupes.out
Then I got a uninstall list from this sorted file this way:
cat dupes.out | grep -v 'Loaded plugins:' | sort -u | awk 'NR % 2 == 1' > uninstall.in
Then I removed from rpm database the old versions:
for f in `cat uninstall.in`; do rpm -e --nodeps -f --justdb $f; done
Finally I could continue on regular system upgrade:
yum upgrade
Some things to pay attention:
On this case, I have carefully reviewed the "package-cleanup --dupes" output to make sure how to generate the uninstall list.
I have tried a "reinstall the newer" approach inverting the list (awk 'NR % 2 == 0') but there where lots of packages not available anymore at that version (server was left this way for an year).
I thought about removing from rpmdb the newer packages, so upgrade later should reinstall everything, but after checking on filesystem installed files, it was clear for me that new versions were in place, with only older rpm entries still in rpmdb. Maybe your case is different.
I was able to remove all duplicates by using yum shell:
I first ordered it to remove all packages using remove foo-package-*
Then order it to install previous version by specifying the exact version install foo-package-3.14.1-5.i386 foo-package-3.14.1-5.x86_64
Committing the transaction by run
After that, the duplicates were gone and I could update the system to current packages without problem and without introducing any new duplicates.
This works even for system packages like nss or yum.
Try running:
yum reinstall [package-new.version]
It is mean, if you get the output of yum check is:
# yum check
Loaded plugins: fastestmirror
nss-3.14.3-4.el6_4.x86_64 is a duplicate with nss-3.14.0.0-12.el6.x86_64
Do reinstall:
yum reinstall nss-3.14.3-4.el6_4.x86_64
A minor upgrade was interrupted by SSH disconnection. After handholding a few packages while trying to get other fixes to work, I ended up fixing the rest like so:
sudo yum reinstall --skip-broken $(/usr/bin/package-cleanup --dupes -q |sort)
First install yum utils and run cleanup afterwards to remove old duplicated packages
yum install yum-utils &&
package-cleanup –-cleandupes -y
hint:
sometimes you need to run package-cleanup –-cleandupes few times
A couple of months ago I also ran into this problem after upgrading my fedora.
I also tried the package-cleanup utility and it started removing required libs rendering my workstation unworkable. Luckily I could reinstall Fedora not deleting my home partition.
Yesterday the same problem occured and I fixed it removing the older version of the duplicate.
For example:
I got these duplicates:
oxygen-icon-theme-4.8.3-1.fc16.noarch is a duplicate with oxygen-icon-theme-4.8.2-1.fc16.noarch
sane-backends-libs-1.0.22-10.fc16.i686 is a duplicate with sane-backends-libs-1.0.22-8.fc16.i686
What I did is I used the yum remove sane-backends-libs-1.0.22-8.fc16.i686 and afterwards a yum update.
Everything is now working fine.
from http://forums.fedoraforum.org/showthread.php?t=268328
In my case nothing above has worked.
So after having the Duplicates list, I copied it to a Text Editor ...
And i did
yum upgrade {package name}
As I edited the whole list, I did it continuously ...
Example: yum upgrade sudo nano came mariadb, etc ...
what worked for me is :
1) getting the list of duplicated packages : package-cleanup --dupes
2) deleting manually old duplicates : rpm -e --justdb --nodeps {old-version-duplicated-package}
3) yum update