elasticsearch,Ubuntu,elasticsearch" /> elasticsearch,Ubuntu,elasticsearch" />

Ubuntu E:子流程/usr/bin/dpkg返回错误代码(1)-elasticsearch

Ubuntu E:子流程/usr/bin/dpkg返回错误代码(1)-elasticsearch,ubuntu,elasticsearch,Ubuntu,elasticsearch,我试图卸载elasticsearch并重新安装它。当我用下面的命令删除它时,它显示了以下错误。 $ apt-get --purge autoremove elasticsearch Reading package lists... Done<br/> Building dependency tree<br/> Reading state information... Done<br/> The following packages will be REMOV

我试图卸载elasticsearch并重新安装它。当我用下面的命令删除它时,它显示了以下错误。

$ apt-get --purge autoremove elasticsearch

Reading package lists... Done<br/>
Building dependency tree<br/>
Reading state information... Done<br/>
The following packages will be REMOVED:<br/>
elasticsearch*<br/>
0 upgraded, 0 newly installed, 1 to remove and 2 not upgraded.<br/>
After this operation, 30.5 MB disk space will be freed.<br/>
Do you want to continue? [Y/n] y<br/>
(Reading database ... 37152 files and directories currently installed.)<br/>
Removing elasticsearch (2.4.5) ...<br/>
Stopping elasticsearch service...Failed to issue method call: Unit elasticsearch.service not loaded.<br/>
dpkg: error processing package elasticsearch (--purge):
subprocess installed pre-removal script returned error exit status 5
NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd<br/>

sudo systemctl daemon-reload<br/>
sudo systemctl enable elasticsearch.service<br/>
You can start elasticsearch service by executing<br/>

sudo systemctl start elasticsearch.service<br/>
Errors were encountered while processing:<br/>
** elasticsearch**<br/>
E: Sub-process /usr/bin/dpkg returned an error code (1)<br/>
$apt get——清除自动记忆elasticsearch
正在阅读软件包列表。。。完成
构建依赖关系树
正在读取状态信息。。。完成
将删除以下程序包:
elasticsearch*
0已升级,0已新安装,1已删除,2未升级。
执行此操作后,将释放30.5 MB的磁盘空间。
你想继续吗?[Y/n]Y
(正在读取数据库…37152个当前安装的文件和目录。)
移除elasticsearch(2.4.5)..
正在停止elasticsearch服务…无法发出方法调用:Unit elasticsearch.service未加载。
dpkg:处理包elasticsearch(--purge)时出错: 安装的子流程预删除脚本返回错误退出状态5 安装时未启动,请执行以下语句,使用systemd将elasticsearch服务配置为自动启动
sudo systemctl后台程序重新加载
sudo systemctl启用elasticsearch.service
您可以通过执行
启动elasticsearch服务 sudo systemctl启动elasticsearch.service
处理时遇到错误:
**弹性搜索**
E:子流程/usr/bin/dpkg返回错误代码(1)

安装jre解决了elasticsearch的相同错误。

我在Ubuntu 20.04中通过这种方式解决了这个问题

  • java版本
  • sudogedit/etc/environment
  • 在文件中,您必须
    请提及下面给出的路径JAVA_HOME=“/usr/lib/jvm/JAVA-(您的 java版本(可能是11/14/etc)-openjdk-amd64“
  • echo$JAVA_主页