To install the latest Eglot in an Emacs version that does not bundle Eglot, use M-x package-install.
Often, a newer Eglot version exists that has fixed a longstanding bug,
has more LSP features, or just better supports a particular language
server. Recent Eglot versions can self-update via the command
M-x eglot-upgrade-eglot. This will replace any currently
installed version with the newest one available from the ELPA archives
configured in package-archives
.
You can also update Eglot through other methods, such as
use-package
(see Installing packages in use-package User Manual), package-install
,
list-packages
or the newer package-upgrade
(see Packages in GNU Emacs Manual). However, do read the
docstrings of the command you intend to use before you use it, as some
of them may not work in exactly the same way across Emacs versions,
meaning your configuration may be not portable.