What’s the recommended way to install packages on a fresh Debian system?

0
2
Asked By MellowCedar42 On

I've just installed the latest Debian release with KDE and want to start installing software, beginning with Podman. I created both a root account and a regular user account, then logged into KDE with the regular account. I expected to use sudo for administrative commands, but running `sudo apt-get -y install podman` reports that my user is not in the sudoers file. Why wasn't my account given sudo access, and what is the proper Debian workflow for installing packages? Should I switch to root, configure sudo, or use another approach? Also, is it okay to use `apt-get` as shown in Podman's documentation, or should I use `apt` instead?

3 Answers

Answered By QuietMaple19 On

Debian supports both commands. `apt` is generally nicer for interactive terminal use, while `apt-get` remains supported and is often preferred in scripts or documentation because its behavior and output are more stable. The Podman command using `apt-get` is fine; the important part is having administrative privileges. You may want to omit `-y` the first time so you can review what will be installed.

CobaltMango5 -

Right—`apt-get` hasn’t been deprecated. `apt` is a more user-friendly, higher-level interface intended mainly for interactive use.

Answered By BriskOtter7 On

If you set a root password during installation, Debian may leave your regular account without sudo access. You can switch to root with `su`, install sudo if necessary, and add your user to the `sudo` group. After logging out and back in, `sudo apt-get install podman` should work. Using root for this one-time setup is normal; you don’t need to run your desktop session as root.

MellowCedar42 -

That makes sense. I’ll use `su` to configure sudo rather than logging into the graphical desktop as root.

Answered By SunnyQuill88 On

Another option is to keep using `su` for administrative commands instead of setting up sudo. However, sudo is usually more convenient and records which regular user performed each administrative action. Debian’s installer commonly grants sudo access automatically only when no root password is configured; explicitly creating a root password can result in the regular user not being added to the sudo group.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.