You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

安装Elasticsearch 7失败:依赖冲突问题求助

Fixing Elasticsearch 6 → 7 RPM Upgrade Issues

Hey there, let's work through the problems you ran into while upgrading Elasticsearch from 6 to 7 using RPM packages. I notice two key issues in your output: a GPG signature warning and a dependency conflict error. Here's how to resolve them and complete the upgrade properly.

1. First, Fix the GPG Signature Warning

That NOKEY warning pops up because your system doesn't recognize Elastic's official signing key. Let's import it first to avoid security warnings and potential issues later:

sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch

2. Resolve the Dependency Conflict Error

The error elasticsearch < 7.0.0 is obsoleted by elasticsearch-0:7.0.0-1.x86_64 happens because you used rpm --install—this command is for fresh installs, not upgrades. Since you already have Elasticsearch 6 installed, you need to use the upgrade flag instead.

Use the -Uvh flag to upgrade your existing installation. This will replace the old version while preserving your configuration files (though you’ll want to check for breaking changes in ES7 afterward):

sudo rpm -Uvh elasticsearch-7.0.0-x86_64.rpm

Option 2: Uninstall Old Version First (If Upgrade Fails)

If the direct upgrade hits unexpected snags, you can uninstall the old version first—make sure to back up your data and config files first!:

  • Stop the Elasticsearch service:
    sudo systemctl stop elasticsearch
    
  • Back up your data directory (default is /var/lib/elasticsearch) and config file (/etc/elasticsearch/elasticsearch.yml):
    sudo cp -r /var/lib/elasticsearch /var/lib/elasticsearch_backup
    sudo cp /etc/elasticsearch/elasticsearch.yml /etc/elasticsearch/elasticsearch.yml.backup
    
  • Uninstall the old version:
    sudo rpm -e elasticsearch
    
  • Install the new RPM:
    sudo rpm --install elasticsearch-7.0.0-x86_64.rpm
    

3. Post-Upgrade Steps

After installing ES7:

  • Review your elasticsearch.yml file—ES7 has several breaking changes from ES6 (e.g., removed type mappings, adjusted network settings). You’ll need to update any deprecated settings.
  • Start the Elasticsearch service and check its status:
    sudo systemctl start elasticsearch
    sudo systemctl status elasticsearch
    
  • Verify the upgrade worked by checking the version:
    curl -XGET 'http://localhost:9200/'
    

Quick Recap of Your Original Issue

Your core problem was using rpm --install instead of rpm -Uvh for an upgrade. The RPM installer saw the existing ES6 package and threw a conflict because ES7 obsoletes all older versions. Adding the upgrade flag tells RPM to replace the old package instead of trying to install alongside it.

内容的提问来源于stack exchange,提问作者Andy Bajka

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.12 05:20:14