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

0
3
Asked By MellowCedar42 On

I 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, and I log into KDE with the regular account. I understand that it's generally better not to use the root account for everyday work and that administrative commands can be run through sudo, but sudo currently fails with an error saying that my user is not in the sudoers file. The Podman documentation uses `sudo apt-get -y install podman`. Why wasn't my user given sudo access, and what is the proper Debian approach for installing packages and configuring administrative privileges?

3 Answers

Answered By QuietHarbor7 On

When you set a root password during Debian installation, the installer usually leaves the regular account without sudo access. You can switch to root with `su -`, install sudo if necessary, and add your user to the `sudo` group with `usermod -aG sudo username`. Log out and back in afterward so the new group membership takes effect. You can then run package commands as your regular user with sudo. Using `su` for administrative commands is also valid, but sudo records which user performed each action.

MellowCedar42 -

That makes sense. I’ll use the root account once to install and configure sudo, then return to using my regular account for everyday work.

Answered By AmberNotebook6 On

`apt-get` is not deprecated. It’s still appropriate for scripts and documentation, while `apt` is a more user-friendly command intended mainly for interactive use. Either can install packages, so the Podman command should work once you have administrative privileges. For interactive use, you could run `sudo apt install podman`; consider leaving off `-y` so you can review the packages and changes before confirming.

Answered By PracticalBirch19 On

Debian’s installer behaves differently depending on whether you create a root password. If you leave the root password empty, Debian typically disables direct root login and grants the first regular user sudo access. Since you created a root password, you’ll need to configure sudo yourself or continue using `su` when elevated privileges are required.

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.