How to resolve Not found, Failed to verify signature in Emacs unable to include Go development package (Ubuntu 18.04)

The title is long.

For those who couldn't do package-install with emacs. It is premised that you have done "Introduction of necessary go package" in the following reference blog.

reference

https://qiita.com/bussorenre/items/3e80e59d517db8aebf46

Emacs version check

emacs --version

If you have version 26 or above, you do not need to do the following.

Those who are 25 or less need to upgrade. (If you know, you can also get the key and update it.)

Emacs version upgrade

It seems that the signing key may not match if the version of Emacs package-install is old. In this case, you will not be able to connect to the repository that manages the package.

You can solve this problem by using a newer version of Emacs.

sudo add-apt-repository ppa:kelleyk/emacs
sudo apt update
sudo apt install emacs26

Let's install the latest version of emacs. It seems that there are up to 27 now, so you can use it as you like.

sudo apt remove --autoremove emacs25*

Delete the old Emacs. Change the version specified for emacs25 * according to the value confirmed first.

Play with Init.el

If you are rewriting init.el, change that file. If you don't remember writing init.el itself, create a new file below.

cd ~/.emacs.d/
vim init.el

Add the following statement at the beginning. If it has already been written, this step is unnecessary.

(package-initialize)
(setq package-archives
      '(("gnu" . "http://elpa.gnu.org/packages/")
        ("melpa" . "http://melpa.org/packages/")
        ("org" . "http://orgmode.org/elpa/")))

The package to be introduced this time is registered in a repository called melpa. Since it does not connect by default, it was necessary to set it as the connection destination.

package-install Let's update the package list. Start Emacs and do the following:

M-x package-refresh-contents

If you don't know what M-x is, just press Alt + x for the time being. Specifically, follow the steps below.

--Start emacs --Press Alt + x (M-x) --You will see M-x at the bottom, so enter package-refresh-contents and Enter

Then type the following command

M-x package-install flycheck
M-x package-install company-go

--Press Alt + x (M-x) --You will see M-x at the bottom, so enter package-install and Enter --Install package: will appear, so enter flycheck and Enter --Same for company-go

Finally

Create a file named golang-conf.el in the same location where you created init.el earlier. For the contents, refer to the site described in Reference. please.

Thank you for your hard work! If you've set it up properly, you should see syntax highlighting when you open your Go file.

Recommended Posts

How to resolve Not found, Failed to verify signature in Emacs unable to include Go development package (Ubuntu 18.04)
Ubuntu unable to log in
How to include Spring Tool in Eclipse 4.6.3?