Trying to install homebrew in my new corporate pc.
facing this issue-
el$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
==> Checking for `sudo` access (which may request your password)...
Password:
Need sudo access on macOS (e.g. the user el needs to be an Administrator)!
P87111:~ el$
Checked System preferences->users and group
Seems like i am designated as an admin.
What could be a possible fix? Thanks.
This should be a comment but I don't have enough reputation.
Take a look at these duplicate posts - here and another one here.
The gist from both the aforementioned posts are as follows (three choices):
Choice 1: Install homebrew without root privileges:
For this, please read the homebrew's alternative install instructions for further information.
Choice 2: Make your user an administrator (using Terminal):
For this, first check if your user is an admin or not using sudo dseditgroup -o checknumber -m your-user-name admin. The output will be either Unable to find the user record or yes your-user-name is a member of admin. (If the latter, homebrew installation should work)
If the former, you need to make your user a member of admin using sudo dscl . -merge /Groups/admin GroupMembership your-user-name (more information about his command has been provided in this previous post.
Choice 3: Make your user an administrator (using System Preferences):
Go to System Preferences > Users & Groups & Current User > Check "Allow user to administer this computer".
Reboot in all cases
Related
I am using MacOS Catelina and i often have to run my terminal stuff with sudo otherwise they fail. like when i use Visual Studio and IONIC to add stuff to global or when it tries to create dir etc.
Is there a way to change the logged in user to run elevated commands in terminal without sudo ?
You either continue using sudo or switch current user to root (it's not a recommended way)
The user account named ”root” is a superuser with read and write
privileges to more areas of the system, including files in other macOS
user accounts. The root user is disabled by default. If you can log in
to your Mac with an administrator account, you can enable the root
user, then log in as the root user to complete your task.
The root user account is not intended for routine use. Its privileges
allow changes to files that are required by your Mac. To undo such
changes, you might need to reinstall your system software. You should
disable the root user after completing your task.
It's safer to use the sudo command in Terminal instead of enabling the
root user. To learn about sudo, open the Terminal app and enter man
sudo.
Taken from https://support.apple.com/en-us/HT204012
In tutorial of azure iot edge, there's a sample said that user is able to command "sudo" in Bash, however the other tutorial said that "Permissions are set as regular users without sudo access".
enter image description hereenter image description here
Also when I followed the tutorial command in azure bash(sudo), it didn't work, so I'm wondering if I've missed something?
By the way, the tutorials are all from the Microsoft.
This is mainly because you were running on a Debian system, which does not come with the sudo command to add it use the following steps:
su -
apt-get install sudo -y
After that you would need to play around with users and permissions. Give sudo right to your own user.
usermod -aG sudo yourusername
I accidently tried renamed my home folder on my mac. Never. Ever. Do. That! Homebrew no longer works... I get this error no matter what I try to install (or another github address).
Error: Permission denied # rb_sysopen - /private/tmp/github_api_headers20180921-5820-13099yc.
Nothing works, not even wget or mysql.
I tried uninstalling / re-installing but doesn't work.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
How can I fix homebrew? Is it necessary to wipe the whole computer?
Files under /Users/myuser should have ownership to myuser and group ownership to staff.
I don't know your specific settings but before to wipe out your system you could try to restore these basic ownerships with:
chown -R myuser:staff /Users/myuser
where myuser is the name of your user. As I said, I don't know anything about your specific settings so do this at your own risk.
I recently installed Arch Linux on my Raspberry Pi and, after logging in as root and creating myself a user account I tried to use the sudo command. This was the result:
[phillipus#alarmpi home]$ sudo mkdir Public
bash: sudo: command not found
After searching for the problem, I logged in as root and executed pacman -S sudo. This was followed by a long output and a confirmation of installation. Following this, I retried to use sudo both as root and as my user, both times getting the same response. Following another solution to the problem, I tried to add myself to /etc/sudoers, only to find out that it didn't exist.
I am not very experienced with Linux, so could you please try to explain your responses fully?
First, you need to install the sudo package to use sudo:
pacman -S sudo
After that, you need to edit the sudoers file and add your username to it.
You can add yor user to the wheel group using usermod -G wheel yourusername and uncomment the %wheel ALL=(ALL) ALLline in the sudoers file. For more information, have a look at Sudo - ArchWiki
I get this error while trying to install sass
Should I use sudo before the install statement?
rd-macbook-pro:~ redres$ gem install css_parser
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.
rd-macbook-pro:~ redres$
thanks, Rich
Yes you can use sudo or set gem path
mkdir -p /Users/redres/.gem/ruby/1.8
export GEM_PATH=/Users/redres/.gem/ruby/1.8
export GEM_HOME=/Users/redres/.gem/ruby/1.8
but i highly recommend to try using RVM https://rvm.io/rvm/install/
curl -L https://get.rvm.io | bash -s stable
to install and
rvm requirements
to get further information
If you aren't using a ruby version manager (like rvm or rbenv), you'll need to use sudo to install on system-level.
The reason of the error is because you are not logged in as the root user on terminal.
If you already have root use enable on your mac in terminal type (without the $)
$ su
If you dont have root user, you need to enable it using the following steps
From the Apple menu choose System Preferences….
From the View menu choose Users & Groups.
Click the lock and authenticate as an administrator account.
Click Login Options….
Click the “Edit…” or “Join…” button at the bottom right.
Click the “Open Directory Utility…” button.
Click the lock in the Directory Utility window.
Enter an administrator account name and password, then click OK.
Choose Enable Root User from the Edit menu.
Enter the root password you wish to use in both the Password and Verify fields, then click OK.
More at the same on http://support.apple.com/kb/ht1528
Atleast it works for me after getting stuck for couple of hours.