Fail to install Elastic-Agent

First of all, I installed Elastic Agent by DEB successfully, but I realize that cannot upgrade, so I uninstall Elastic Agent and remove installation layout of Elastic Agent.
And now when I install by Linux Tar, it fails and shows this error.

Hi @pntmky Welcome to the community!

First please do not post images of text, they are hard to read, (some people can not read them at all) the can not be searched or debugged please post the text and format it.

Exactly How did you remove the elastic agent?

And did you stop it before ... perhaps it is still running... did you check?

Is there still an old /usr/bin/elastic-agent ?

I removed elastic agent by command "rm -r" and folder /usr/bin/elastic-agent has been removed

I think you should have used the package remove... Perhaps you should refer to the documention

Perhaps run the uninstall manually

sudo /opt/Elastic/Agent/elastic-agent uninstall

I follow this guide to uninstall Elastic Agent. In step 4, I manually remove Elastic Agent files from my system, because I'm not sure where the files are installed, so I remove all files in installation layout locations by rm -r command. And now I cann't install Elastic Agent by Linux Tar since installation layout locations have been removed.

I suspect perhaps you removed more than you should have...

That is not a folder...

It's not clear what actually you have removed...

Are you still getting the same error?

Check the permissions on

/usr/bin/elastic-agent does not exist any more after I removed, I try to recreate it and copy content from other machine installed Elastic Agent successfully "#!/bin/sh
exec /opt/Elastic/Agent/elastic-agent $@", but after that, it appears a new error that is "/usr/bin/elastic-agent: 2: exec: /opt/Elastic/Agent/elastic-agent: not found
Error: enroll command failed for unknown reason: exit status 127". I continuously copy /opt/Elastic/Agent to create a new file but it fails, because it allows copy only data folder, vault folder and other files include elastic-agent cannot be copied, and I think each machine has a unique file elastic-agent. How do you know to create it again?

I do not believe You can create it copy it by hand... I am not what you did when you cleaned up...

Perhaps reinstall via the deb package and then try to in remove using the deb package.

Then try again

Thanks for your supporting, I uninstall by command apt-get --purge and check status to check for certain it stops and reinstall by Linux tar

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.