root@th:~# apt-get purge elasticsearch-7.17.8-amd64.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package elasticsearch-7.17.8-amd64.deb
E: Couldn't find any package by glob 'elasticsearch-7.17.8-amd64.deb'
E: Couldn't find any package by regex 'elasticsearch-7.17.8-amd64.deb'
root@th:~# locate elasticsearch-7.17.8-amd64.deb
root@th:~# find elasticsearch-7.17.8-amd64.deb
elasticsearch-7.17.8-amd64.deb
root@th:~# rm elasticsearch-7.17.8-amd64.deb
root@th:~# find elasticsearch-7.17.8-amd64.deb
find: ‘elasticsearch-7.17.8-amd64.deb’: No such file or directory
root@th:~# apt-get purge elasticsearch
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libunwind8 libvarnishapi2 linux-image-4.19.0-18-amd64
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
elasticsearch*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 526 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 153420 files and directories currently installed.)
Removing elasticsearch (7.17.8) ...
Stopping elasticsearch service... OK
Deleting log directory... OK
(Reading database ... 152336 files and directories currently installed.)
Purging configuration files for elasticsearch (7.17.8) ...
dpkg: warning: while removing elasticsearch, directory '/var/lib/elasticsearch' not empty so not removed
Processing triggers for systemd (241-7~deb10u8) ...
root@th:~# rm /var/lib/elasticsearch/
rm: cannot remove '/var/lib/elasticsearch/': Is a directory
root@th:~# apt install elasticsearch
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libunwind8 libvarnishapi2 linux-image-4.19.0-18-amd64
Use 'apt autoremove' to remove them.
The following NEW packages will be installed:
elasticsearch
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/315 MB of archives.
After this operation, 526 MB of additional disk space will be used.
Selecting previously unselected package elasticsearch.
(Reading database ... 152324 files and directories currently installed.)
Preparing to unpack .../elasticsearch_7.17.8_amd64.deb ...
Creating elasticsearch group... OK
Creating elasticsearch user... OK
Unpacking elasticsearch (7.17.8) ...
Setting up elasticsearch (7.17.8) ...
### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
### You can start elasticsearch service by executing
sudo systemctl start elasticsearch.service
Created elasticsearch keystore in /etc/elasticsearch/elasticsearch.keystore
Processing triggers for systemd (241-7~deb10u8) ...
root@th:~# ^C
root@th:~# find elasticsearch_7.17.8_amd64.deb
find: ‘elasticsearch_7.17.8_amd64.deb’: No such file or directory
root@th:~# find elasticsearch_7.17.8
find: ‘elasticsearch_7.17.8’: No such file or directory
root@th:~# ^C
root@th:~# systemctl daemon-reload
root@th:~# ^C
root@th:~# systemctl enable elasticsearch.service
Synchronizing state of elasticsearch.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable elasticsearch
Created symlink /etc/systemd/system/multi-user.target.wants/elasticsearch.service → /lib/systemd/system/elasticsearch.service.
root@th:~# ^C
root@th:~# service elasticsearch start
Job for elasticsearch.service failed because the control process exited with error code.
See "systemctl status elasticsearch.service" and "journalctl -xe" for details.
root@th:~# ^C
root@th:~# systemctl status elasticsearch.service
● elasticsearch.service - Elasticsearch
Loaded: loaded (/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2022-12-31 20:48:01 +08; 6s ago
Docs: https://www.elastic.co
Process: 3822 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
Main PID: 3822 (code=exited, status=1/FAILURE)
Dec 31 20:48:00 server systemd-entrypoint[3822]: at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:160)
Dec 31 20:48:00 server systemd-entrypoint[3822]: at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77)
Dec 31 20:48:00 server systemd-entrypoint[3822]: at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)
Dec 31 20:48:00 server systemd-entrypoint[3822]: at org.elasticsearch.cli.Command.main(Command.java:77)
Dec 31 20:48:00 server systemd-entrypoint[3822]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:125)
Dec 31 20:48:00 server systemd-entrypoint[3822]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)
Dec 31 20:48:00 server systemd-entrypoint[3822]: For complete error details, refer to the log at /var/log/elasticsearch/elasticsearch.log
Dec 31 20:48:01 server systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Dec 31 20:48:01 server systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Dec 31 20:48:01 server systemd[1]: Failed to start Elasticsearch.
root@th:~#