        (format (concat "\nPackage %s is unavailable. "
                        "Is the package name misspelled?\n")
                pkg-name))
-    (dolist
-        (dep (configuration-layer//get-package-deps-from-archive
-              pkg-name))
-      (if (package-installed-p (car dep))
-          (configuration-layer//activate-package (car dep))
-        (package-install (car dep))))
-    (package-install pkg-name)))
+    (let ((pkg-desc (assq pkg-name package-archive-contents)))
+      (dolist
+          (dep (configuration-layer//get-package-deps-from-archive
+                pkg-name))
+        (if (package-installed-p (car dep))
+            (configuration-layer//activate-package (car dep))
+          (package-install (car dep))))
+      (if pkg-desc
+          (package-install (cadr pkg-desc))
+        (package-install pkg-name)))))
 
 (defun configuration-layer//install-from-recipe (pkg)
   "Install PKG from a recipe."

(defun configuration-layer//install-package (pkg)
  "Unconditionally install the package PKG."
  (let* ((layer (when pkg (car (oref pkg :owners))))
         (location (when pkg (oref pkg :location))))
    (spacemacs-buffer/replace-last-line
     (format "--> installing %s: %s%s... [%s/%s]"
             (if layer "package" "dependency")
             pkg-name (if layer (format "@%S" layer) "")
             installed-count not-inst-count) t)
    (spacemacs//redisplay)
    (unless (package-installed-p pkg-name)
      (condition-case-unless-debug err
          (cond
           ((or (null pkg) (eq 'elpa location))

  (let* ((name-sym (if (listp pkg) (car pkg) pkg))
         (name-str (symbol-name name-sym))
         (location (when (listp pkg) (plist-get (cdr pkg) :location)))
         (min-version (when (listp pkg) (plist-get (cdr pkg) :min-version)))
         (step (when (listp pkg) (plist-get (cdr pkg) :step)))
         (excluded (when (listp pkg) (plist-get (cdr pkg) :excluded)))
         (toggle (when (and togglep (listp pkg)) (plist-get (cdr pkg) :toggle)))
