My init.el uses this to initialize packages:
(package-initialize)
(add-to-list \'package-archives \'(\"gnu\" . \"http://elpa.gnu.org/packages/\"))
(
I installed emacs on Arch Linux, opened it, ran package-refresh-contents and got this issue. After a while, I realized I had no init file. If this is your case, create your init file with emacs ~/.emacs.d/init.el and then add the following content:
(package-initialize)
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
Save it with C-x C-s and run package-refresh-contents again. This time it will work.