Jimmy Yuen Ho Wong writes: > Reproduction: > > 0. (setq custom-file (const user-emacs-directory "custom.el")) > 1. M-x package-vc-install company > 2. M-x package-vc-install company RET y > 3. C-x C-f ~/.emacs/custom.el > 4. Observe that `company` has been listed twice under > `package-selected-packages`. > > Expectation: > > Installing the same package twice should not result in its duplication > in `package-selected-packages`. An easy fix would be just to ensure that package-selected-packages is always deduplicated before assigning the value: