我试图卸载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/>
答案 0 :(得分:1)
elasticsearch的相同错误已由install jre解决。
答案 1 :(得分:1)
我在Ubuntu 20.04中通过这种方式解决了