错误信息:
各位大佬好,在下使用 emacs 时发现无法从源上拉取包的信息, package-refresh-list
的 backtrace 如下:
同时比较奇怪的是把配置中 http
改成 https
会导致 emacs
卡在 contacting host xxx:443
直至超时。
我的环境配置:
init.el
:
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
(when (>= emacs-major-version 24)
(require 'package)
(package-initialize)
(setq package-archives
'(("gnu" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/")
("melpa" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/"))))
(global-linum-mode 1)
(set-face-attribute 'default nil :height 120)
(defun open-init-file()
(interactive)
(find-file "~/.emacs.d/init.el"))
(global-set-key (kbd "<f2>") 'open-init-file)
;; (global-company-mode 1)
;; Map Alt key to Meta
(setq x-alt-keysym 'meta)
;; proxy
从 anaconda 安装的 emacs emacs --version
:
$ emacs --version
GNU Emacs 26.3
Copyright (C) 2019 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
OS: CentOS Linux release 7.4.1708 (Core)
从命令行直接检查是否能连接到源:
$ curl -i http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/
HTTP/1.1 200 OK
Server: nginx/1.16.1
Date: Mon, 28 Oct 2019 09:37:05 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 30100
Last-Modified: Sun, 27 Oct 2019 21:05:29 GMT
Connection: keep-alive
ETag: "5db60699-7594"
X-TUNA-MIRROR-ID: neomirrors
Strict-Transport-Security: max-age=31536000
Accept-Ranges: bytes
<!DOCTYPE HTML PUBLIC>
<html>
<head>
<title>GNU ELPA Packages</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" type="image/png" href="../favicon.png">
<link rel="stylesheet" href="//code.cdn.mozilla.net/fonts/fira.css">
<link rel="stylesheet" type="text/css" href="../layout.css">
<script src="../javascript/jquery.min.js" type="text/javascript"></script>
......
如果还需要我提供别的环境信息,请dalao们直接指出,提前感谢各位了🙏