how to manually install packages from MELPA?

2.1k Views Asked by At

So, I have been trying to install use-package by(package-install 'use-package) but I keep getting the error use-package is unavailable. I have also tried to install other packages but they are also unavailable.

I was wondering if could go to the MELPA page, find the package(eg use-package) and download. Is there a way to configure your init.el such that packages can be used/installed without any variation consisting of (package-install 'use-package)?

2

There are 2 best solutions below

0
On

I figured this out; it is useful given Emac's misbehavior.

As an example consider installing the use-package:


git clone https://github.com/jwiegley/use-package.git ~/.emacs.d/site-lisp/use-package

cd ~/.emacs.d/site-lisp/use-package

make

and then adding this to your init.el:


(add-to-list 'load-path "~/.emacs.d/site-lisp/use-package")
(require 'use-package)

(with-eval-after-load 'info
  (info-initialize)
  (add-to-list 'Info-directory-list
               "~/.emacs.d/site-lisp/use-package/"))
1
On

Try M-x + package-refresh-contents Also, use the melpa-stable instead.

(setq package-archives '(("melpa-stable" . "https://stable.melpa.org/packages/")))

I recommend doing it because You will encounter this error pretty often and manually building those packages each time is a bad thing to do. Also, M-x is Alt+x. ( M is meta key and in most keyboard, alt is the meta key).