How to uninstal xcode when the tool uninstall-devtool is not there - xcode

How do you uninstall xcode (7.4) ?
Most articles on the net mention a command
sudo /Developer/Library/uninstall-devtools --mode=all
but I dont have that program. Here's what I have
macimage:~ user1$ sudo ls -la /Library/Developer/
total 0
drwxr-xr-x 3 root admin 102 Aug 1 2014 .
drwxr-xr-x+ 67 root admin 2278 Sep 9 14:59 ..
drwxr-xr-x 4 root admin 136 Jul 24 2014 CommandLineTools
macimage:~ user1$
macimage:~ user1$ sudo ls -la /Developer/
ls: /Developer/: No such file or directory
macimage:~ user1$

Related

TAR override the contents of the directory

My understanding of tar command that it will override the content of the file if file exist. Otherwise it would keep as existing.
[root#something~]# ls -al /etc/init.d/
total XX
drwxr-xr-x. 2 root root 83 Jun 14 2018 .
drwxr-xr-x. 10 root root 127 Jun 6 2017 ..
-rwxr-xr-x. 1 root root 7293 Jan 2 2018 network
-rw-r--r--. 1 root root 1160 Feb 20 2018 README
[root#something~]# tar tvf /tmp/env_pkg_1.tar
drwxr-xr-x staff 0 2020-05-29 19:42 etc/
drwxr-xr-x user/staff 0 2020-05-29 18:04 etc/init.d/
-rw-r--r-- user/staff 3383 2020-05-29 18:04 etc/init.d/sshd
[root#something~]# cd /
[root#something /]# tar xf /tmp/env_pkg_1.tar
[root#something/]# ls -al /etc/init.d/
total 16
drwxr-xr-x 2 XXXXXX XXXXXX 18 May 29 18:04 .
drwxr-xr-x. 85 XXXXXX XXXXXX 8192 May 29 19:42 ..
-rw-r--r-- 1 XXXXXX XXXXXX 3383 May 29 18:04 sshd
I am not understand why tar is replacing the entire contents of /etc/init.d
Any inputs would be helpful ?
I belive that /etc/init.d is a link to /etc/rc.d/init.d.
When you untarred that file, it overwrote the link with a directory. All of your files are still in /etc/rc.d/init.d.
To fix your situation, remove /etc/init.d, relink it, and add a h to the tar command:
rm -rf /etc/init.d
cd /etc
ln -s ./rc.d/init.d
cd /
tar xhf /tmp/env_pkg_1.tar
You can use -k or --keep-old-files, so it does not touch any files that are already within the destination. Judging by your output in /etc/init.d/ you want to keep network and README and next to them extract sshd, so in your case, they do not overlap.
Alternatively --keep-newer-files will have tar replace files that are newer from the tar archive, than what's on the destination..

Can't run go permission denied?

david#raspberrypi:~ $ go env
-bash: /usr/bin/go: Permission denied
this is my bash.rc
export GOPATH=$HOME/go
$HOME/.bashrc
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
if i run ls-lah in my david#raspberry pi, i get the following:
david#raspberrypi:~ $ ls -lah
total 28K
drwxr-xr-x 3 david david 4.0K Mar 2 22:20 .
drwxr-xr-x 4 root root 4.0K Mar 2 20:03 ..
-rw------- 1 david david 3.1K Mar 2 21:48 .bash_history
-rw-r--r-- 1 david david 220 Mar 2 20:03 .bash_logout
-rw-r--r-- 1 david david 3.6K Mar 2 22:15 .bashrc
lrwxrwxrwx 1 david root 11 Mar 2 21:31 go -> /usr/lib/go
drwxr-xr-x 2 david david 4.0K Mar 2 20:25 .nano
-rw-r--r-- 1 david david 675 Mar 2 20:03 .profile
I am assuming that the user you're logged in as doesn't have permissions to run go.
To find that out, run the following
$ which go
/usr/local/go/bin/go
$ ls -l $(which go)
-rwxr-xr-x 1 root wheel 12896684 Jan 24 01:28 /usr/local/go/bin/go
From the above we know that the owner is root and group owner is wheel.
Now run echo $USER to see if who is logged in user.
Since you're getting permission denied to run go as $USER, you may want to add the user into the group mentioned in ls -l. So, run the below.
$ usermod -aG $USER wheel
And reboot the system! Then try go env again to see if it works.
-a is for append
-G is for which groups to append
usermod docs
Remember wheel is the group owner that I got while running ls -l. Yours might be different.
This usermod command is for ubuntu. In your case, it is raspberry pi so raspbian OS. Find out the correct options as it changes from OS to OS.

chown: /usr/local: Operation not permitted - issue with brew update /usr/local is not writable - MacOS 10.13.1 high sierra

I am unable to do brew update because I can’t chown /usr/local:
$ brew update
Error: /usr/local is not writable. You should change the ownership
and permissions of /usr/local back to your user account:
sudo chown -R $(whoami) /usr/local
based on this: https://github.com/Homebrew/brew/issues/385
I tried these 2 chown command but it didnt work:
$ sudo chown -R $(whoami) $(brew --prefix)
chown: /usr/local: Operation not permitted
$ sudo chown -R $(whoami) /usr/local
chown: /usr/local: Operation not permitted
Here is my /usr/local listing:
$ cd /usr/local
$ ls -al
total 56
drwxr-xr-x 23 root wheel 736 Dec 2 15:24 .
drwxr-xr-x# 9 root wheel 288 Oct 26 00:22 ..
-rw-r--r-- 1 megasap wheel 0 Dec 2 15:11 .com.apple.installer.keep
drwxr-xr-x 16 megasap admin 512 Jan 11 14:08 .git
drwxr-xr-x 5 megasap admin 160 Dec 2 15:24 .github
-rw-r--r-- 1 megasap admin 1112 Aug 11 2016 .gitignore
-rw-r--r-- 1 megasap admin 253 Aug 11 2016 .travis.yml
-rw-r--r-- 1 megasap admin 291 Aug 11 2016 .yardopts
-rw-r--r-- 1 megasap admin 3161 Aug 11 2016 CODEOFCONDUCT.md
drwxr-xr-x 35 megasap admin 1120 Jan 11 11:35 Cellar
-rw-r--r-- 1 megasap admin 1241 Jan 26 2016 LICENSE.txt
drwxr-xr-x 9 megasap admin 288 Dec 2 15:25 Library
-rw-r--r-- 1 megasap admin 5451 Aug 11 2016 README.md
drwxr-xr-x 262 megasap admin 8384 Jan 11 23:09 bin
drwxr-xr-x 11 megasap admin 352 Dec 2 15:25 etc
drwxr-xr-x 57 megasap staff 1824 Dec 2 15:25 include
drwxr-xr-x 102 megasap staff 3264 Dec 2 15:25 lib
drwx------ 4 megasap wheel 128 Dec 2 15:24 libexec
drwxr-xr-x 3 megasap admin 96 Dec 2 15:23 n
drwxr-xr-x 34 megasap admin 1088 Dec 2 15:25 opt
drwxr-xr-x 8 megasap admin 256 Dec 2 15:24 sbin
drwxr-xr-x 16 megasap admin 512 Dec 2 15:25 share
drwxr-xr-x 8 megasap admin 256 Dec 2 15:25 var
I'm using macOS 10.13.1 high sierra.
Reinstalling Homebrew worked for me
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
You may want to try:
sudo chown -R $(whoami) $(brew --prefix)/*
For more see: https://github.com/Homebrew/brew/issues/3228
Apparently this is due to mac's "system integrity configuration". To get around this you need to reboot your machine into recovery mode (restart your machine and hold down ⌘+R) go into Utilities > Terminal and type the command:
csrutil disable
reboot
And then run your chown command. I guess its recommended to reenable this after changing permissions to re-enable the security.
Full disclosure, I haven't tried this myself - I'll give it a go later today since its a massive PITA. For the record, I'm only attempting to install python3.
Original information
On Mac, I have to give "Full Disk Access" to the terminal using the below page -
https://macreports.com/terminal-says-operation-not-permitted-on-mac-fix/
uninstall and install Homebrew using https://github.com/Homebrew/install

/usr/local/bin doesn't exist when trying to add symlink for SublimeText3

I have been researching this question for 2 hours now and have done everything in all of the answers for creating a symlink for SublimeText3 in macOS Sierra using iTerm2. I have tried all of the following:
input: ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
returns: ln: /usr/local/bin/subl: No such file or directory
input: ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
returns: ln: /Users/david/bin/subl: No such file or directory
I have tried creating /usr/local/bin/subl and then executing the above commands but when I use mkdir /usr/local/bin it returns File exists but when I try to run the ln command, I get the same return as examples 1 and 2.
In usr/local it shows: bin remotedesktop but when I try cd bin it returns -bash: cd: bin: No such file or directory and when I look for it in Finder it I get the following error message: The operation can’t be completed because the original item for “bin” can’t be found.
Here is my $PATH: echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
I'm hoping someone can either help me or point in the direction of an answer I missed, because so far none of the answers have worked for me.
When I ran echo b | xxd
this was the result:
00000000: 486f 6d65 6272 6577 2062 696e 206c 6962 Homebrew bin lib
00000010: 2073 6269 6e0a sbin.
Results of running: ls -l /usr/local | cat -vet | pbcopy
total 0$
drwxr-xr-x 2 root wheel 68 Sep 8 22:04 Cellar$
drwxrwxr-x 2 david admin 68 Sep 8 22:04 Frameworks$
drwxr-xr-x 2 root wheel 68 Sep 8 22:04 Homebrew$
drwxrwxr-x 3 david admin 102 Sep 9 00:14 bin$
drwxrwxr-x 2 david admin 68 Sep 8 22:04 etc$
drwxrwxr-x 2 david admin 68 Sep 8 22:04 include$
drwxrwxr-x 2 david admin 68 Sep 8 22:04 lib$
drwxr-xr-x 2 root wheel 68 Sep 8 22:04 opt$
drwxr-xr-x 3 root wheel 102 Jun 12 17:38 remotedesktop$
drwxrwxr-x 2 david admin 68 Sep 8 22:04 sbin$
drwxrwxr-x 3 david admin 102 Sep 8 22:04 share$
drwxrwxr-x 2 david admin 68 Sep 8 22:04 var$

what is ~/.npm dir for?

I have installed the global npm package jslint and it lives here
$ ls -la /usr/local/bin/jslint
lrwxr-xr-x 1 lust admin 40 Feb 12 15:31 /usr/local/bin/jslint -> ../lib/node_modules/jslint/bin/jslint.js
$ ls -la /usr/local/lib/node_modules/jslint/bin
total 8
drwxr-xr-x 3 lust staff 102 Apr 16 2012 .
drwxr-xr-x 10 lust staff 340 Feb 12 15:31 ..
-rwxr-xr-x 1 lust staff 2330 Apr 16 2012 jslint.js
$ which jslint
/usr/local/bin/jslint
$ head -3 /usr/local/bin/jslint
#!/usr/bin/env node
var linter = require("../lib/linter");
So it is without any doubt whatsoever at this point that jslint is in fact being run from this dir and not here:
$ ls -la .npm/jslint/0.1.9/package/bin/
total 8
drwxr-xr-x 3 lust staff 102 Apr 16 2012 .
drwxr-xr-x 9 lust staff 306 Feb 12 15:31 ..
-rwxr-xr-x 1 lust staff 2330 Apr 16 2012 jslint.js
There appear to be two copies of the package, one in /usr/local/ and one in ~/.npm. Why is there one in .npm and is it safe for me to remove it?
~/.npm is a cache that npm uses to avoid re-downloading the same package multiple times. There's no harm in removing it. You can empty it with the command:
npm cache clean

Resources