3

I'm experimenting something estrange with yum in centos7, lets see If someone understands what's happening:

Usually, I upgrade packages using sudo yum install <package_name>-<version_info>, for example, right now, I'm trying to do an upgrade of elasticsearch package from v6.7.1 to 7.1.1. To do that, I first need (suggested by the Elasticsearch documentation) to upgrade to 6.8.0, so I executed yum install elasticsearch-6.8.0 and the package was correcty upgraded.

Now, if I check the version of Elasticsearch, I got:

[root@centos7 vagrant]# rpm -qa | grep elasticsearch
elasticsearch-6.8.0-1.noarch

Now, I add the Elasticsearch repositories for 7.x with:

# rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
# cat > /etc/yum.repos.d/elastic.repo << EOF
[elasticsearch-7.x]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
EOF

and check that the package elasticsearch-7.1.1 exists and is available:

[root@centos7 vagrant]# yum --showduplicates list elasticsearch | expand | grep 7.
elasticsearch.noarch                 6.7.0-1                  elasticsearch-6.x 
elasticsearch.noarch                 6.7.1-1                  elasticsearch-6.x 
elasticsearch.noarch                 6.7.2-1                  elasticsearch-6.x 
elasticsearch.x86_64                 7.0.0-1                  elasticsearch-7.x 
elasticsearch.x86_64                 7.0.1-1                  elasticsearch-7.x 
elasticsearch.x86_64                 7.1.0-1                  elasticsearch-7.x 
elasticsearch.x86_64                 7.1.1-1                  elasticsearch-7.x 
elasticsearch.x86_64                 7.2.0-1                  elasticsearch-7.x 

But, if I try to install elasticsearch-7.1.1 using yum install I got:

[root@centos7 vagrant]# yum install elasticsearch-7.1.1
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.tedra.es
 * extras: mirror.gadix.com
 * updates: mirror.gadix.com
Nothing to do

And, if I try to use upgrade-to, I found this interesting issue:

[root@centos7 vagrant]# yum upgrade-to elasticsearch-7.1.1
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.tedra.es
 * extras: mirror.gadix.com
 * updates: mirror.gadix.com
Package(s) elasticsearch-7.1.1 available, but not installed.
No packages marked for update

Package(s) elasticsearch-7.1.1 available, but not installed.

If I try just, yum install elasticsearch it let me upgrade to 7.2.0

What could be going on? why yum said elasticsearch is not installed? Look at the output of the following command:

[root@centos7 vagrant]# yum list installed | grep elasticsearch
elasticsearch.noarch               6.8.0-1                    @elasticsearch-6.x
kibana.x86_64                      6.8.0-1                    @elasticsearch-6.x
logstash.noarch                    1:6.8.0-1                  @elasticsearch-6.x

I hope someone can help me. Greetings and thank you very much.

Edit

Running with --verbose don't give us so much more information

Loading "fastestmirror" plugin
Config time: 0.005
Yum version: 3.4.3
rpmdb time: 0.000
Setting up Package Sacks
Loading mirror speeds from cached hostfile
 * base: mirror.tedra.es
 * extras: mirror.gadix.com
 * updates: mirror.gadix.com
pkgsack time: 0.009
Building updates object
up:Obs Init time: 0.069
up:simple updates time: 0.004
up:obs time: 0.001
up:condense time: 0.000
updates time: 0.148
Nothing to do

If I try to download the package manually and install it I can upgrade without any problem, but I would like to understand what happening with the repository.

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.1.1-x86_64.rpm
yum install elasticsearch-7.1.1-x86_64.rpm
  • Sometimes, running yum in --verbose gives clues, e.g. excluded, obsoleted packages and dependency resolution issues. Could you add that info? – Edward Jul 3 at 7:32
  • Thanks, Edward, I forgot to put that info because it does not contribution much information. I've added it anyway. – grg121 Jul 3 at 8:08
  • I've been busy trying to replicate your issue, but I can't. yum install elasticsearch-7.1.1 does the trick every time. Are you sure there aren't any exclude lines still present anywhere in the yum config tree? – Edward Jul 3 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.