eRROR:不可用的软件包“ use-package-”是不可用的(emacs 27.1)

问题描述 投票:0回答:1

我在配置init.el之后启动emacs时收到此消息:

error: Package ‘use-package-’ is unavailable

eDit

:所以我试图解决这个问题,我了解到,如果这样做:

(require 'package)
(add-to-list 'package-archives
         '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(unless package-archive-contents
  (package-refresh-contents))

它起作用!问题是当我尝试安装使用包装时。然后它返回:

Failed to verify signature: bind-key-2.4.1.tar.sig

我的配置是:

;; Configuração básica do Emacs (setq inhibit-startup-message t) ; Desabilita a tela inicial do Emacs (tool-bar-mode -1) ; Oculta a barra de ferramentas (menu-bar-mode -1) ; Oculta a barra de menu (scroll-bar-mode -1) ; Oculta a barra de rolagem (tooltip-mode -1) ; Oculta dicas (global-display-line-numbers-mode t) ; Exibe numeração de linhas (column-number-mode t) ; Exibe coluna atual na modeline ;; Alertas visuais (setq visible-bell t) ;; Espaçamento das bordas laterais (set-fringe-mode 10) ;; Outros (delete-selection-mode t) ; O texto digitado substitui a seleção ;; Rolagem mais suave (setq mouse-wheel-scroll-amount '(2 ((shift) . 1)) ; 2 linhas por vez mouse-wheel-progressive-speed nil ; Não acelera a rolagem mouse-wheel-follow-mouse 't ; Rola a janela sob o mouse scroll-step 1) ; Rola 1 linha com teclado ;; Quebras de linha (global-visual-line-mode t) ;; Organizando os backups (setq backup-directory-alist '(("." . "~/.saves"))) ;; Definição temporária do tema (load-theme 'tango-dark t) ;; Fonte padrão (set-face-attribute 'default nil :font "Monospace" :height 140) ;; Tipo de cursor (setq-default cursor-type 'box) ;; Função para criar um novo buffer (defun debmx-new-buffer () "Cria um novo buffer 'sem nome'." (interactive) (let ((debmx/buf (generate-new-buffer "sem-nome"))) (switch-to-buffer debmx/buf) (funcall initial-major-mode) (setq buffer-offer-save t) debmx/buf)) ;; Modo inicial (setq initial-major-mode 'prog-mode) (setq initial-buffer-choice 'debmx-new-buffer) ;; Verifica e inicia o package.el (require 'package) ;; Definição de repositórios (setq package-archives '(("melpa" . "https://melpa.org/packages/") ("elpa" . "https://elpa.gnu.org/packages/"))) ;; Inicialização do sistema de pacotes (package-initialize) (unless package-archive-contents (package-refresh-contents)) ; Instalação do use-package (unless (package-installed-p 'use-package) (package-install 'use-package)) (require 'use-package) (setq use-package-always-ensure t) ;; Instalação do auto-update (use-package auto-package-update :custom (auto-package-update-interval 7) (auto-package-update-prompt-before-update t) (auto-package-update-hide-results t) :config (auto-package-update-maybe) (auto-package-update-at-time "21:00")) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(ispell-dictionary "brasileiro") '(package-selected-packages '(auto-package-update use-package cmake-mode))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. )

我已经抬头看着堆栈和reddit,涉及签名密钥,但没有任何效果。

	
我的开始是:

(require 'package) (setq package-enable-at-startup nil) (setq package-archives '(("elpa" . "https://elpa.gnu.org/packages/") ("melpa" . "https://melpa.org/packages/"))) (package-initialize) (package-refresh-contents) ;; I always ensure package-refresh-contents at start ;; Bootstrap `use-package` (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) (require 'use-package) (setq use-package-always-ensure t) ;; load my-init.org (org-babel-load-file (expand-file-name "~/.emacs.d/myinit.org")) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(ispell-dictionary "brasileiro") '(package-selected-packages '(auto-package-update use-package cmake-mode))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. ) (put 'downcase-region 'disabled nil)

然后在同一文件夹中,我放置了
init.el

(然后可以使用看起来更好的org模式,并且可以使用tab折叠和脚本的部分展开部分 - 对保持概述非常有用)。 因此,在您的情况下将包含:

emacs use-package init-file
1个回答
0
投票

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.