# elpa-mirror **Repository Path**: better_fly/elpa-mirror ## Basic Information - **Project Name**: elpa-mirror - **Description**: Create local emacs package repository. 15 seconds to install 115 packages. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-10-31 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README * elpa-mirror (v2.1.1) [[http://melpa.org/#/elpa-mirror][file:http://melpa.org/packages/elpa-mirror-badge.svg]] [[http://stable.melpa.org/#/elpa-mirror][file:http://stable.melpa.org/packages/elpa-mirror-badge.svg]] Create local Emacs package repository from *installed packages* so package upgrade never breaks. CLI program tar is required. It's bundled with Linux, macOS, and Windows 10. Please note if you are using Window 7 or older Windows 10 (less than build 17063) , you can still get =tar= by installing [[https://www.cygwin.com/][Cygwin]] or [[https://www.msys2.org/][MSYS2]]. Since v2.1.1, only Emacs 24.4 and higher versions are supported. * Why - Emacs Lisp compile file (*.elc) is not portable for different versions of Emacs. So =emacs.d= copied from higher version of Emacs might crash in lower version of Emacs - Package installation is fast. 15 seconds to install 115 packages - The repository could be hosted on USB/Dropbox/GitHub. So you can install packages behind corp firewall - Tested with Emacs v24.4, v24.5, v25.3, v26, v27 on OSX/Cygwin/Windows/Linux * Install - Download =elpa-mirror.el= to somewhere (say =~/.emacs.d/site-lisp/elpa-mirror/=) - Add below code into your ~/.emacs, #+BEGIN_SRC elisp (add-to-list 'load-path "~/.emacs.d/site-lisp/elpa-mirror") (require 'elpa-mirror) #+END_SRC * Usage =M-x elpamr-create-mirror-for-installed= to create local repository. To use the repository =~/myelpa/=, insert below code into your =~/.emacs=, #+BEGIN_SRC sh # myelpa is the ONLY repository now, dont forget trailing slash in the directory (setq package-archives '(("myelpa" . "~/myelpa/"))) #+END_SRC To update existing local repository, run =M-x elpamr-create-mirror-for-installed= again. BTW, you can run =elpa-mirror.el= as a independent script, #+begin_src bash mkdir -p ~/myelpa && emacs --batch -l ~/.emacs.d/init.el -l ~/any-directory-you-prefer/elpa-mirror.el --eval='(setq elpamr-default-output-directory "~/myelpa")' --eval='(elpamr-create-mirror-for-installed)' #+end_src * Tips ** Change output directory, #+BEGIN_SRC elisp (setq elpamr-default-output-directory "~/myelpa") #+END_SRC ** Repository on Dropbox Insert below code into =~/.emacs=: #+BEGIN_SRC elisp ;; all-to-list will not override default elpa. ;; So now you have two repositories. ;; One is GNU elpa. Another is myelpa (add-to-list 'package-archives '("myelpa" . "https://dl.dropboxusercontent.com/u/858862/myelpa/")) #+END_SRC ** Repository on GitHub My repository is [[https://github.com/redguardtoo/myelpa]]. Insert below code into =.emacs=: #+BEGIN_SRC elisp (add-to-list 'package-archives '("myelpa" . "https://raw.githubusercontent.com/redguardtoo/myelpa/master/")) #+END_SRC * Report bug - Insert =(setq elpamr-debug t)= into =.emacs= - Reproduce bug and report at [[https://github.com/redguardtoo/elpa-mirror]]