sigoden/upt

Unable to run upt subcommand that requires sudo

glsee opened this issue · 1 comments

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!

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.