You are not logged in.
Pages: 1
What's the correct way to create a user who can execute makepkg? I'm seeing the following errors
sudo -u nobody makepkg -si
You do not have right permission for the directory
useradd maker
passwd
sudo -u maker makepkg -si
You do not have right permission for the directory
Last edited by atomikegg (2024-11-08 01:14:13)
Offline
makepkg -si
It will ask for sudo user credentials when it needs them.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
makepkg -si
It will ask for sudo user credentials when it needs them.
I get
Error.running makepkg as root is not allowed as it can cause permanent catastrophic damage to your system
Offline
do you try to run makepkg as root?
Online
do you try to run makepkg as root?
Yes. I get
Error: Running makepkg as root is not allowed as it can cause permanent catastrophic damage to your system
Offline
sanity check: do you have ANY regular user on the system?
Online
sanity check: do you have ANY regular user on the system?
Nope, that's why i posted "What's the correct way to create a user who can execute makepkg?"
thx
Offline
'nobody' can run makepkg out-of-the-box:
# su -s /bin/bash - nobody
$ cd /tmp
$ auracle clone tmux-git
$ cd tmux-git
$ makepkg
==> Making package: tmux-git 10201_3.4.r33.g3823fa2c-1 (Sun 03 Nov 2024 22:41:32 GMT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Cloning tmux git repo...
Cloning into bare repository '/tmp/tmux-git/tmux'...
remote: Enumerating objects: 55010, done.
remote: Counting objects: 100% (2095/2095), done.
remote: Compressing objects: 100% (857/857), done.
remote: Total 55010 (delta 1421), reused 1777 (delta 1237), pack-reused 52915 (from 1)
Receiving objects: 100% (55010/55010), 20.97 MiB | 22.96 MiB/s, done.
Resolving deltas: 100% (41540/41540), done.
==> Validating source files with md5sums...
tmux ... Skipped
==> Extracting sources...
-> Creating working copy of tmux git repo...
Cloning into 'tmux'...
done.
==> Starting prepare()...
configure.ac:45: installing 'etc/compile'
configure.ac:10: installing 'etc/config.guess'
configure.ac:10: installing 'etc/config.sub'
configure.ac:8: installing 'etc/install-sh'
configure.ac:8: installing 'etc/missing'
Makefile.am: installing 'etc/depcomp'
configure.ac: installing 'etc/ylwrap'
==> Starting pkgver()...
==> Updated version: tmux-git 10355_3.5.r77.g46f38466-1
==> Starting build()...
[...]
==> Tidying install...
-> Removing libtool files...
-> Purging unwanted files...
-> Removing static library files...
-> Stripping unneeded symbols from binaries and libraries...
-> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "tmux-git"...
-> Generating .PKGINFO file...
-> Generating .BUILDINFO file...
-> Generating .MTREE file...
-> Compressing package...
==> Creating package "tmux-git-debug"...
-> Generating .PKGINFO file...
-> Generating .BUILDINFO file...
-> Generating .MTREE file...
-> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: tmux-git 10355_3.5.r77.g46f38466-1 (Sun 03 Nov 2024 22:41:47 GMT)
However, if you're asking "how can the 'nobody' user access a directory in the root user's home directory", then abandon that line of questioning.
Also, if you want to use the '-i' and '-s' flags (as well as '-r') while 'sudo' is installed, you'll need a user that can call the pacman binary with at least '-S --asdeps *', '-U *', and '-R *' capabilities defined in the sudoers. I'd recommend against granting the 'nobody' user that level of access.
Mod note: Not a System Administration question, moving to NC.
Last edited by WorMzy (2024-11-03 22:52:28)
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
cryptearth wrote:sanity check: do you have ANY regular user on the system?
Nope, that's why i posted "What's the correct way to create a user who can execute makepkg?"
thx
well - then you should have a look here: https://wiki.archlinux.org/title/Users_ … management and https://wiki.archlinux.org/title/Genera … mendations
one command to add a new user is
useradd -m -s /bin/bash <username>
with
-m - create a user home directory and copy the skeleton structure
-s /bin/bash - set the users logon-shell to /bin/bash
if you have sudo installed and made the wheel group available you can add a
-G wheel
this will add the new user also to the sudo wheel group so it can call sudo
running a system without a regular user but only root is not something one should do
as for the permission error: you likely try to execute makepkg within /root - to which nobody doesn't have access to - note the cd to /tmp as in wormzy's code
Online
My apologies, I missed that you were logged in as root -- something I never, ever do unless I am using the install media.
Why were you trying to use sudo when you were already supper user?
So, the real answer is that you run makepkg as a normal user. Never as root, or with root privileges achieved through sudo.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
one command to add a new user is
useradd -m -s /bin/bash <username>
with
-m - create a user home directory and copy the skeleton structure
-s /bin/bash - set the users logon-shell to /bin/bash
if you have sudo installed and made the wheel group available you can add a
-G wheel
this will add the new user also to the sudo wheel group so it can call sudo
Thx. Aren't -m and -s set to defaults if not given?
In archinstall, i see this key:
!users
{
"username": "<USERNAME>",
"!password": "<PASSWORD>",
"sudo": false
}
https://archinstall.archlinux.page/installing/guided.html
Does setting "sudo" to `true` add the user to wheel?
I missed that you were logged in as root -- something I never, ever do
Thx, that's why i asked how to create a regular user who can run makepkg. I used archinstall, but skipped adding regular users during the process.
Why were you trying to use sudo when you were already supper user?
You mean, already root? I tried sudo with nobody and a regular user, not with root (plz see my first post). But i added neither to wheel, so i guess that's why it failed.
run makepkg as a normal user. Never as root, or with root privileges achieved through sudo.
@cryptearth says to use sudo with the normal user. No?
Offline
In archinstall, i see this key:
Nobody cares.
You've installed the system but for whatever reason not added an unprivileged user for regular use.
That's a big nono:
DO NOT LOG IN AS ROOT ON A REGULAR BASE!
The most straight forward way out of this is to create an unprivileged user.
This has nothing to do w/ archinstall and likewise is adding the new user to the wheel group or the sudoers completely unrelated to archinstall.
There's absolutely no reason to pick the most indirect and clumsy approach to add or control users.
You mean, already root? I tried sudo with nobody and a regular user, not with root (plz see my first post). But i added neither to wheel, so i guess that's why it failed.
No, it failed because those unprivileged users don't have access to a root owned path.
i asked how to create a regular user who can run makepkg
DO NOT LOG IN AS ROOT ON A REGULAR BASE!
You do not habitually log in as root and then downgrade to an unprivileged user whenever something randomly informs you that what you're about to do is really stupid and therefore not allowed.
You always log in a regular user and ONLY elevate to root if you REALLY have to, as limited as possible.
The sudo rights of that unprivileged user are controlled by the sudoers, adding the wheel group there and yourself to that group is a common approach but really not obligatory either.
https://wiki.archlinux.org/title/Sudo#Configuration
DO NOT LOG IN AS ROOT ON A REGULAR BASE!
@cryptearth says to use sudo with the normal user. No?
You don't run makepkg w/ sudo, makepkg needs to be run as unprivileged user.
But "makepkg -i" will at some point and by default use sudo to install the package.
DO NOT LOG IN AS ROOT ON A REGULAR BASE!
Offline
DO NOT LOG IN AS ROOT ON A REGULAR BASE!
Yep, that's why i asked:
What's the correct way to create a user who can execute makepkg?
This issue has already been addressed:
My apologies, I missed that you were logged in as root. Run makepkg as a normal user.
The topic is resolved.
Offline
@OP
I highly recommend you to familiarize yourself with the manual install guide and the general recommendations to get your system into a state its expected to when you come here and ask for help
otherwise what you ask and what we assume will always differ and either you have to always tell it upfront or we have to keep asking - with the latter one rather soon dies off into "dude - get your system in order" as although many here are happy to help none of us is eager to waste our free time with keep asking unknowns because someone doesn't understand how to setup arch properly because they thought "nah, manual way is too difficult - let's go with archinstall" without understanding the base concepts
Online
@OP
I highly recommend you to familiarize yourself with the manual install
I've manually reinstalled arch many times for a few years, but I do need to refresh myself on the process.
I know everyone here is a volunteer, and i appreciate all the help resolving this basic issue.
Last edited by atomikegg (2024-11-09 06:41:22)
Offline
Pages: 1