1

I'm a recent Vim "convert" (and yet love most of it), still I have an issue with installing packages using cygwin/emacs.

The related configurations are (I have $http(s)_proxy set up as environment variables in my .bashrc):

;;; init.el
;; This sets up the load path so that we can override it
(package-initialize nil)
(package-initialize t)
(setq package-enable-at-startup nil)
(org-babel-load-file "~/Repos/orgfiles/emacs-setup.org")

From emacs-setup.org:

(require 'package)
  (setq package-list '(
  ;;; list of packages
  ))
 (add-to-list 'package-archives
    '("melpa" . "http://melpa.milkbox.net/packages/") t)
  (add-to-list 'package-archives
    '("org" . "http://orgmode.org/elpa/") t)
  (add-to-list 'package-archives
    '("marmalade" . "http://marmalade-repo.org/packages/") t)
  (package-initialize)
  ; fetch the list of packages available
  (unless package-archive-contents
    (package-refresh-contents))
  ; install the missing packages
  (dolist (package package-list)
    (unless (package-installed-p package)
      (package-install package)))

(This was copy pasted from several places from the interwebs...)

My problems are the following:

  • I quiet often (but not always) get the following errors in *Messages*:

     Contacting host: elpa.gnu.org:80
     Failed to download `gnu' archive.
     Contacting host: melpa.milkbox.net:80
     Failed to download `melpa' archive.
     Contacting host: orgmode.org:80
     Failed to download `org' archive.
     Contacting host: marmalade-repo.org:80
     Failed to download `marmalade' archive.
    
  • when I'm able to download the (e.g.) melpa archive and mark a package for installation, quiet often the installed package contains 0 sized package file(s) after which seemed to be a succesful installation. E.g.: most recently:

     $ ls -l auto-complete-chunk-20140225.146/
     total 2.0K
     -rw-r--r-- 1 zsbotykai None   0 Feb 16 10:54 auto-complete-chunk.el
     -rw-r--r-- 1 zsbotykai None 410 Feb 16 10:54 auto-complete-chunk-autoloads.el
     -rw-r--r-- 1 zsbotykai None 172 Feb 16 10:54 auto-complete-chunk-pkg.el
    

    So above: auto-complete-chunk.el is empty after the *Messages* install log shows:

     Install package `auto-complete-chunk-20140225.146'? y
     Contacting host: melpa.milkbox.net:80
     Generating autoloads for auto-complete-chunk.el...done
     Saving file /home/zsbotykai/.emacs.d/elpa/auto-complete-chunk-20140225.146/auto-complete-chunk-autoloads.el...
     Wrote /home/zsbotykai/.emacs.d/elpa/auto-complete-chunk-20140225.146/auto-complete-chunk-autoloads.el
    

Could you please point me out and/or show the direction where/what/how should I investigate the root cause of this?

1 Answer 1

3

Looks like although setting $http_proxy outside of emacs (as mentioned, in .bashrc) is not enough.

After setting the proxy in the init file:

(setq url-proxy-services '(("no_proxy" . "work\\.com")
                           ("http" . "proxy.work.com:911")))

the problem had gone.

1
  • 1
    When you get the chance, you should accept your own answer as the correct one so that the questions appears as "answered".
    – nanny
    Mar 18, 2015 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.