How can I install GTK on MacOS (Big sur)? - macos

I have tried running this on my MacBook:
brew install gtk+3
but the following appears:
Error: The following directories are not writable by your user:
/usr/local/lib/pkgconfig
You should change the ownership of these directories to your user.
sudo chown -R $(whoami) /usr/local/lib/pkgconfig
And make sure that your user has write permission.
chmod u+w /usr/local/lib/pkgconfig
I would appreciate some help.

Read the error's you got run: sudo chown -R $(whoami) /usr/local/lib/pkgconfig
change the whoami to your user name,
Then run: chmod u+w /usr/local/lib/pkgconfig

Related

Reset /usr/local/bin ownership as rootless on macos ventura

I set /usr/local/bin directory using the sudo chown -R root /usr/local/bin for the permission on the current user session.
Before I set this permission, I was getting the following output when I used the ls -ld /usr/local/bin command:
$ myuser> ls -ld /usr/local
/usr/local/bin
Now I get the following output with the above command:
$ myuser> ls -ld /usr/local/bin
drwxr-xr-x# 16 root wheel 512 Feb 16 00:03 /usr/local/bin
What can I do to undo the change?
You can run :
sudo chown -R $(id -un):$(id -gn) /usr/local/bin
or even better :
sudo chown -R $(id -un):$(id -gn) /usr/local/*
in case you have other directories in /usr/local which belong to root.

MacOS, insecure files/directory (zsh compinit)

My shell tells me the following:
❯ compaudit
There are insecure files:
/usr/local/share/zsh/site-functions/_brew
I tried fixing this using $ sudo chmod -R 755 /usr/local/share/zsh/site-functions/_brew and $ sudo chown -R root:staff /usr/local/share/zsh/site-functions/_brew but that didnt help.
The only other solution I have found was to add ZSH_DISABLE_COMPFIX=true into my ~./zshrc file. But isnt that just a workaround to ignore the problem?
I found the solution:
The file that was making problems (/usr/local/share/zsh/site-functions/_brew) was linking to another file (/usr/local/Homebrew/completions/zsh/_brew).
So I ran these 2 commands and I was fine:
$ sudo chmod -R 755 /usr/local/Homebrew/completions/zsh/_brew
$ sudo chown -R root:staff /usr/local/Homebrew/completions/zsh/_brew
Change directory (cd) into
/usr/local/share/zsh/site-functions/_brew
and then run
sudo chmod -R 755 /usr/local/share/zsh/site-functions/_brew
This worked for me.

macOS - Permission denied # apply2files - /usr/local/lib/node_modules/expo-cli/node_modules/extglob/lib/.DS_Store?

I was installing the starship via homebrew, but I am getting this error:
Permission denied # apply2files - /usr/local/lib/node_modules/expo-cli/node_modules/extglob/lib/.DS_Store
Any solution for fixing this error?
Thanks.
This issue appeared after upgrading macOS to Mojave 10.14.X onwards.
Therefore, you need to reset the permissions in /usr/local:
sudo chown -R $(whoami):admin /usr/local/* \
&& sudo chmod -R g+rwx /usr/local/*
Source: https://github.com/Homebrew/homebrew-core/issues/45009#issuecomment-543795948
You can change owner by :
sudo chown -R ${LOGNAME}:staff /usr/local/lib/node_modules
If you are getting the above error during brew cleanup “Permission denied # apply2files”, one of the solutions which worked in my case was to reset permissions to /usr/local. You will have to rewrite permission to the current user. In your terminal copy and paste:
sudo chown -R $(whoami):admin /usr/local/* \
&& sudo chmod -R g+rwx /usr/local/*
Then rerun the command. The permission error should go.
Hope it may help someone in the future. Good luck
Change permission of the node_modules directory by running
sudo chown -R ${LOGNAME}:staff /usr/local/lib/node_modules
You can run the command:
sudo chmod 755 /usr/local/lib/node_modules/expo-cli/node_modules/extglob/lib/.DS_Store
first
sudo chown -R $(whoami):admin /usr/local/* \
&& sudo chmod -R g+rwx /usr/local/*
the reinstall all the packages with
brew list --formula | xargs brew reinstall
this part may take few minutes but worked great for me
This work for me.
Remove and reinstall brew.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
In my case, It works with
sudo chown -R douglas.mesquita:admin /usr/local/lib/node_modules
what worked for me, simply delete the directory with
sudo rm -rf %error file path%

Makefile running command with whoami

I am trying to use a makefile to setup my machine. I am trying to setup FZF and have the following code. However, it seems to be replacing that command with empty space instead of the user I am logged as. I have SSH'd into the Pi, so not sure if that is the cause or if it's something else.
linuxfxf:
sudo mkdir -p /usr/local/opt
sudo chown -R $(whoami) /usr/local/opt
$ is a special character for make: it introduces a make variable. If you want to run a recipe and have the shell see the $ you have to escape it:
linuxfxf:
sudo mkdir -p /usr/local/opt
sudo chown -R $$(whoami) /usr/local/opt
Or you could use the old-school syntax `whoami` instead.

How to fix file system problems in Laravel

I want to ask when I move the Laravel project to VPS an error like this appears.
https://i.postimg.cc/mr4bB9WX/Screenshot-18.jpg
What I have done is:
$ sudo chown -R $USER:www-data storage
$ sudo chown -R $USER:www-data bootstrap/cache
$ chmod -R 775 storage
$ chmod -R 775 bootstrap/cache
# composer update
go to your project folder and open terminal.
run this command
sudo chmod -R 777 theme/gallery
You may do it like like so.
sudo chmod -R 755 theme/gallery

Resources