   (doom-initialize-packages)
   (and (package-installed-p name)
        (let* ((plist (cdr (assq name doom-packages)))
-              (old-backend (doom-package-backend name t))
+              (old-backend (doom-package-backend name 'noerror))
               (new-backend (if (plist-get plist :recipe) 'quelpa 'elpa)))
          (not (eq old-backend new-backend)))))
 

(defun doom//packages-autoremove ()
  "Interactive command for auto-removing orphaned packages."
  (interactive)
  (let ((packages (doom-get-orphaned-packages)))
    (cond ((not packages)
           (message! (green "No unused packages to remove")))

          ((not (or (getenv "YES")
                    (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

;;; core/autoload/packages.el -*- lexical-binding: t; -*-

(require 'use-package)
(require 'quelpa)

(defvar doom--last-refresh nil)

;;;###autoload
(defun doom-refresh-packages (&optional force-p)
  "Refresh ELPA packages."
  (when force-p
    (doom-refresh-clear-cache))
  (unless (or (persistent-soft-fetch 'last-pkg-refresh "emacs")
