Closed ghost closed 6 years ago
I don't know if system-packages
uses auth-sources
, but in case it does, I don't have anything in mine for localhost.
I don't think that use-package
statement will work. Did you omit a :config
?
Can you check the value of system-packages-use-sudo
and system-pacakges-package-manager
?
Also, I'm assuming that sudo apt-get update
and sudo apt-get upgrade
work from the command line?
:man_facepalming: Yes to both. I fixed my config, and it's working again. Thank you, and sorry for the noise.
Ah, I think I figured out what happened. After 1) changing the config to the following:
(use-package system-packages
:ensure t
:bind
("C-c s u" . system-packages-update)
("C-c s s" . system-packages-search)
:config
(setq system-packages-package-manager 'apt))
and 2) restarting Emacs, it was still not prompting for a sudo password. I then remembered that I recently installed nix on my machine. system-packages
was finding nix first, and setting system-packages-package-manager
to nix-env
, which does not use sudo. Then, I'm setting it in my :config
section to apt
, which does use sudo.
Here's my new config, which is working as expected:
(use-package system-packages
:ensure t
:bind
("C-c s u" . system-packages-update)
("C-c s s" . system-packages-search)
:config
(setq system-packages-package-manager 'apt)
(setq system-packages-use-sudo t))
I also tried setting system-packages-package-manager
to apt
in the :init
section. This method worked, but then Emacs wasn't picking up the variable's documentation string from system-packages.el
.
Thanks, and sorry again for the noise.
Yeah, if you change system-packages-package-manager
you also (might) have to change system-packages-use-sudo
. This is documented in the README, but should probably be more visible.
Glad you got it working!
I recently upgraded my system from Debian Stretch (stable) to Debian Buster (testing). I have not been able to get
system-packages-update
to work properly since this upgrade. The function does not prompt me for a sudo password as it once did, but instead fails with a permissions error:My configuration for
system-packages
is pretty minimal: