Debian 10 unable to usermod

I think Debian may be the one, but I have a few issues to resolve.

Firstly if anyone doesn’t know Debian has a non-free ISO which is amazing because you can easily get your wifi card working with that ISO

My situation is that I have horrible internet and have to download and move packages from starbucks to home, but with Debian I have some issue’s with sudo and usermod

And since usermod is not working I can’t set up ROCm properly

my source.list is

deb http://deb.debian.org/debian buster main contrib non-free
deb-src http://deb.debian.org/debian buster main contrib non-free

deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free
deb-src http://deb.debian.org/debian-security/ buster/updates main contrib non-free

deb http://deb.debian.org/debian buster-updates main contrib non-free
deb-src http://deb.debian.org/debian buster-updates main contrib non-free

deb https://dl.winehq.org/wine-builds/debian buster main
deb-src https://dl.winehq.org/wine-builds/debian buster main

I apt-get sudo, but apt-get usermod doesn’t work and then when I try to usermod the system is unable to locate

I need usermod to set up rocm

Then when it comes to sudo, I’m used to making my user a part of sudo group

I’m fine with doing su, some have said that’s what you should do, if that’s what I should do I’ll stick with it otherwise can I get help on making my user sudoer

usermod -a -G sudo : currently doesn’t work

lastly I need to copy downloaded packages too /var/cache/apt/archives on offline pc, but I need to be root and I believe Debian won’t allow you to login as root. If I need to do it through the terminal that’s fine, but can I get the commands?

I’m not aware of how to copy files from one location to another using the terminal, but I’m open to learning it.

Thanks for the help

1 Like
/sbin/usermod -aG sudo $USER

You’ll need to prefix /sbin/ for shutdown and reboot commands as well.

I believe that’s for the first iteration. When I reboot after installing sudo and editing sudoers. I can sudo shutdown -r now and it works without issue.

3 Likes

/sbin/usermod -aG sudo $USER

gets No such file or directory

weird I see usermod file in file manager

lol miss typo okay I can sudo now

I’m not ready to do that next step now, but should usermod command work at this point?

also I still need copy files to /var/cache/apt/archives but need to be root

Will need to reboot if you’ve added your user to the sudo group.

Minor correction, full path in Debian is /usr/sbin/usermod. I believe the /sbin/usermod is a hardlink.

/usr/sbin is not included in non-root user’s path in Debian. This is intentional.

Either adding it to path, or using ‘su -’ to inherit root’s paths is the officially correct solution.

Debian, unlike Ubuntu, preserves a dedicated root user on the default install rather than assuming all management will be done via sudo.

I still need copy files to /var/cache/apt/archives

You never need to do this. You should not do that, actually. Let apt manage apt things.

To install packages manually use dpkg -i package.deb rather than adding them to your apt archive. (Adjusting package.deb to your .deb files, of course)

To resolve dependencies of packages manually installed that way use sudo apt install -f

1 Like

I believe apt-get -d install package gets you all dependencies which I did

I’ve done dpkg -i before which is fine

so if you don’t think it’s a good idea to manually install to

/var/cache/apt/archives

thought it might have been fun making my archive act like a repo, but if you say it’s no go I’m fine with that.

All the packages I downloaded with apt-get -d install are all separated per package

I’m not sure if usermod fully works, but I’ll found out when I get to the step on my offline install, thanks for the help.

/sbin/usermod -aG sudo $USER

sudo shutdown -r now

works like a charm

I just came to say I did that with the standard ISO also… just tethering the wi-fi from the phone and editing apt-sources to main contrib non-free

nice

Have to add /sbin to your path iirc, there are also others that aren’t added, had to add one for python pygments too.

That should be part of the sudo command. When you invoke sudo, it modifies your path.

I had to add it when I installed Deb 10, but yes, it should be as you say with sudo.

I installed it on my home workstation few days after initial release, also around three weeks ago on my workstation at work. Same both times, resolved after adding it to my path.

Sudo doesn’t work at first, but

/sbin/usermod -aG sudo $USER

as stated before gets the job done without even apt-get sudo

and then usermod works as well

2 Likes