   (persistent-soft-store 'last-pkg-refresh nil "emacs"))
 
 ;;;###autoload
-(defun doom-package-backend (name)
-  "Get which backend the package NAME was installed with. Can either be elpa,
-quelpa or nil (if not installed)."
+(defun doom-package-backend (name &optional noerror)
+  "Get which backend the package NAME was installed with. Can either be elpa or
+quelpa. Throws an error if NOERROR is nil and the package isn't installed."
   (cl-assert (symbolp name) t)
-  (doom-initialize-packages)
-  (cond ((let ((plist (cdr (assq name doom-packages))))
-           (and (not (plist-get plist :pin))
-                (or (quelpa-setup-p)
-                    (error "Could not initialize quelpa"))
-                (or (assq name quelpa-cache)
-                    (plist-get plist :recipe))))
+  (doom-initialize)
+  (cond ((and (or (quelpa-setup-p)
+                  (error "Could not initialize quelpa"))
+              (assq name quelpa-cache))
          'quelpa)
         ((assq name package-alist)
          'elpa)
-        (t
+        ((not noerror)
          (error "%s package not installed" name))))
 
 ;;;###autoload


           (message! (bold (green "Finished!")))
           (doom//reload-load-path)))))

;;;###autoload
(defalias 'doom/install-package #'package-install)

                    (y-or-n-p
                     (format "%s packages will be deleted:\n\n%s\n\nProceed?"
                             (length packages)
                             (mapconcat
                              (lambda (sym)
                                (format
                                 "+ %s (%s)"
                                 sym
                                 (let ((backend (doom-package-backend sym)))
                                   (if (doom-package-different-backend-p sym)
                                       (if (eq backend 'quelpa)
                                           "QUELPA->ELPA"
                                         "ELPA->QUELPA")
                                     (if (eq backend 'quelpa)
                                         "QUELPA"
                                       "ELPA")))))
                              (sort (cl-copy-list packages) #'string-lessp)
                              "\n")))))
           (message! (yellow "Aborted!")))

          (t
