Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run upt subcommand that requires sudo #38

Closed
glsee opened this issue Mar 17, 2024 · 1 comment
Closed

Unable to run upt subcommand that requires sudo #38

glsee opened this issue Mar 17, 2024 · 1 comment

Comments

@glsee
Copy link

glsee commented Mar 17, 2024

I installed UPT via cargo. And I'm using Ubuntu under WSL2.
When I attempt to run show subcommand, it works:

Details
❯ upt show tldr
Package: tldr
Version: 0.6.4-1build6.3
Priority: optional
Section: universe/doc
Source: haskell-tldr
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Haskell Group <pkg-haskell-maintainers@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 2903 kB
Depends: libc6 (>= 2.34), libcmark0.30.2 (>= 0.30.2), libffi8 (>= 3.4), libgmp10, git
Conflicts: tldr-py (<< 0.7.0-2~)
Homepage: https://github.com/psibi/tldr-hs#readme
Download-Size: 573 kB
APT-Sources: http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
Description: Haskell tldr client
 Haskell tldr client with support for updating and viewing tldr pages.
 .
 The TLDR pages are a community effort to simplify the beloved man
 pages with practical examples.  See https://tldr.sh/

But when I tried to run install:

❯ upt install tldr
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

So I ran it with sudo:

❯ sudo upt install tldr
sudo: upt: command not found

What is it that I need to do here to allow upt to be run with sudo?
I think I'm missing something obvious but not mentioned in the documentation.
Thanks!

@sigoden
Copy link
Owner

sigoden commented Mar 17, 2024

Check if upt is in the directory of sudo's secure_path.

sudo cat /etc/sudoers | grep secure_path=

If not, move upt to any directory on secure_path.

@sigoden sigoden closed this as completed Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants