Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > OS X > OS X 10.8 Mountain Lion

Reply
 
Thread Tools Search this Thread Display Modes
Old Jun 8, 2013, 12:14 PM   #1
idch
macrumors newbie
 
Join Date: Jun 2013
/usr/bin/tar not found (brew install wont work)

I wanted to brew install nginx and got error

Code:
Error: Failure while executing: tar xf /Library/Caches/Homebrew/pcre-8.32.tar.bz2
So I checked my /usr/bin/tar - and got not found

But!


Code:
ln -s /usr/bin/tar /bin/tar
ln: /bin/tar: File exists
and

Code:
ls -ld /usr/bin/tar
lrwxr-xr-x  1 root  wheel  21  5 июн 15:22 /usr/bin/tar -> /usr/local/bin/bsdtar

Can you please help me? How could I fix this?
idch is offline   0 Reply With Quote
Old Jun 8, 2013, 12:16 PM   #2
Intell
macrumors P6
 
Intell's Avatar
 
Join Date: Jan 2010
Location: Inside
Do "sudo ln -s /bin/tar /usr/bin/tar" to create a symlink.
__________________
Last edited by Intell; Yesterday at 3:16 AM.
Intell is offline   0 Reply With Quote
Old Jun 8, 2013, 12:18 PM   #3
idch
Thread Starter
macrumors newbie
 
Join Date: Jun 2013
I got answer:

Code:
sudo ln -s /bin/tar /usr/bin/tar
Password:
ln: /usr/bin/tar: File exists
But

Code:
/usr/bin/tar --version
-bash: /usr/bin/tar: No such file or directory
And brew install still gives the same error:

Code:
brew install nginx
==> Installing nginx dependency: pcre
==> Downloading ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.32.tar.bz2
Already downloaded: /Library/Caches/Homebrew/pcre-8.32.tar.bz2
Error: Failure while executing: tar xf /Library/Caches/Homebrew/pcre-8.32.tar.bz2
idch is offline   0 Reply With Quote
Old Jun 8, 2013, 01:10 PM   #4
idch
Thread Starter
macrumors newbie
 
Join Date: Jun 2013
Actually, even sudo can't see /usr/bin/tar

Code:
sudo su
sh-3.2# /usr/bin/tar --version
sh: /usr/bin/tar: No such file or directory
idch is offline   0 Reply With Quote
Old Jun 8, 2013, 04:29 PM   #5
chrfr
macrumors 68020
 
Join Date: Jul 2009
Quote:
Originally Posted by idch View Post
Actually, even sudo can't see /usr/bin/tar

Code:
sudo su
sh-3.2# /usr/bin/tar --version
sh: /usr/bin/tar: No such file or directory
I'd reinstall the OS; who knows what else is missing.
chrfr is offline   0 Reply With Quote
Old Jun 8, 2013, 04:32 PM   #6
idch
Thread Starter
macrumors newbie
 
Join Date: Jun 2013
I suppose there is no way to reinstall tar?

Google gave me nothing. Apparently I did something with tar when installing homebrew and rails earlier (when I wasn't aware of problems of some commands in terminal).
idch is offline   0 Reply With Quote
Old Jun 8, 2013, 06:05 PM   #7
ScottishCaptain
macrumors 6502a
 
Join Date: Oct 2008
Quote:
Originally Posted by chrfr View Post
I'd reinstall the OS; who knows what else is missing.
This.

Something is seriously messed up. I don't have tar in /bin, it's in /usr/bin. And /usr/bin should be in $PATH, so I have no idea why you're messing with symlinks.

It would probably be quicker to just re-install everything. Something somewhere has deleted or moved files around on your computer. The extent to which things have been scrambled is impossible to determine, unless you have backups you can compare to.

-SC
__________________
2010 Mac Pro (MacPro5,1), 2*2.93ghz, 64GB, 4x2TB, Apple RAID Card, 5970 GPU, 2xSD, Eizo CG276W
ScottishCaptain is offline   0 Reply With Quote
Old Jun 8, 2013, 06:13 PM   #8
subsonix
macrumors 68030
 
Join Date: Feb 2008
This is one reason I use Macports, everything in it's subdirectory is self contained and isolated from the rest of the OS.
subsonix is offline   0 Reply With Quote
Old Jun 8, 2013, 07:12 PM   #9
Intell
macrumors P6
 
Intell's Avatar
 
Join Date: Jan 2010
Location: Inside
Macports is just awful. While it may all be shoved off in its own directory, that makes for poor integration with the rest of the OS. homebrew at least tries to adhere to a BSD directory structure. The constant need to be a super user just to do anything with its odd port command is horrid. Then to uninstall it, you might as well wipe the system. Uninstalling homebrew is extremely easy. This problem wasn't caused by homebrew. To alter the tar binary like the OP's, super user permissions were required. Something homebrew refuses to work when evoked.
__________________
Last edited by Intell; Yesterday at 3:16 AM.
Intell is offline   0 Reply With Quote
Old Jun 8, 2013, 07:26 PM   #10
subsonix
macrumors 68030
 
Join Date: Feb 2008
Quote:
Originally Posted by Intell View Post
Macports is just awful. While it may all be shoved off in its own directory, that makes for poor integration with the rest of the OS. homebrew at least tries to adhere to a BSD directory structure.
Excuse me? Macports closely mimics the BSD packet manager known as ports.

Quote:
Originally Posted by Intell View Post
The constant need to be a super user just to do anything with its odd port command is horrid. Then to uninstall it, you might as well wipe the system. Uninstalling homebrew is extremely easy. This problem wasn't caused by homebrew. To alter the tar binary like the OP's, super user permissions were required. Something homebrew refuses to work when evoked.
I'm sorry, but Macports would never touch or rely on anything that is used by the OS like /usr/bin. That's the point.

Homebrew is convenient I'll give you that, but there is a point behind the stuff you think is horrid.
subsonix is offline   0 Reply With Quote
Old Jun 8, 2013, 07:43 PM   #11
Intell
macrumors P6
 
Intell's Avatar
 
Join Date: Jan 2010
Location: Inside
Macports' implementation of its layout doesn't conform to Mac OS X branch of BSD very well and it bringing in duplicate binaries can cause problems with some shell scripts. It may be good for those the migrate to Mac OS X from UNIX or a UNIX like OS, but not for those that start out on Mac OS X with little to no prior UNIX experience. Macports in the past has completely dirtied up various /usr/ directories on multiple systems of mine. Mostly when trying to upgrade it or remove it. Something homebrew is not capable of due to its non-super user status.
__________________
Last edited by Intell; Yesterday at 3:16 AM.
Intell is offline   0 Reply With Quote
Old Jun 8, 2013, 07:50 PM   #12
subsonix
macrumors 68030
 
Join Date: Feb 2008
Quote:
Originally Posted by Intell View Post
Macports' implementation of its layout doesn't conform to Mac OS X branch of BSD very well and it bringing in duplicate binaries can cause problems with some shell scripts.
Using /opt is a well established practice.

http://www.pathname.com/fhs/pub/fhs-...FTWAREPACKAGES

Quote:
Originally Posted by Intell View Post
It may be good for those the migrate to Mac OS X from UNIX or a UNIX like OS, but not for those that start out on Mac OS X with little to no prior UNIX experience.
Why do you say this? As I said, Homebrew is convenient, but there are reasons behind what you think is horrid. Requiring superuser status separates user privileges, it seems like an inane thing to whine about.

Anyway, let's not argue about this please, both alternatives are there to be used, pick your preferred one.
subsonix is offline   0 Reply With Quote
Old Jun 8, 2013, 07:58 PM   #13
Intell
macrumors P6
 
Intell's Avatar
 
Join Date: Jan 2010
Location: Inside
Quote:
Originally Posted by subsonix View Post
Using /opt is a well established practice.

http://www.pathname.com/fhs/pub/fhs-...FTWAREPACKAGES

Anyway, let's not argue about this please, both alternatives are there to be used, pick your preferred one.
One last thing. Using /opt is not established on Mac OS X's branch of BSD.
__________________
Last edited by Intell; Yesterday at 3:16 AM.
Intell is offline   0 Reply With Quote
Old Jun 8, 2013, 08:01 PM   #14
subsonix
macrumors 68030
 
Join Date: Feb 2008
Quote:
Originally Posted by Intell View Post
One last thing. Using /opt is not established on Mac OS X's branch of BSD.
Of course it is, you add /opt if you install software packages! That is the point, it's not there, much like /usr/local is not there on a fresh install.

This is all decided on to get some consistency (losely) in the file hierarchy standard, it's years (decades) of experience and thought that has been put in to that.
subsonix is offline   0 Reply With Quote
Old Jun 8, 2013, 08:06 PM   #15
Intell
macrumors P6
 
Intell's Avatar
 
Join Date: Jan 2010
Location: Inside
To a Mac user, /opt is completely unknown. They install packages in /Applications via Installer. Just creating extra things at the root of the drive causes confusion to the end user. Thus why it isn't there. If UNIX packages are installed to a hidden by default directory, there is much less chance of the end user deleting the stray directory. Starting with 10.7, /usr/local is there on a fresh installation, just empty. It was also there for 10.0-10.2, but had some stuff in it.
__________________
Last edited by Intell; Yesterday at 3:16 AM.
Intell is offline   0 Reply With Quote
Old Jun 8, 2013, 08:09 PM   #16
subsonix
macrumors 68030
 
Join Date: Feb 2008
Quote:
Originally Posted by Intell View Post
To a Mac user, /opt is completely unknown. They install packages in /Applications via Installer. Just creating extra things at the root of the drive causes confusion to the end user. Thus why it isn't there. If UNIX packages are installed to a hidden by default directory, there is much less chance of the end user deleting the stray directory.
Please, how is that different from Homebrew, if someone decides to install a package manager they surely are aware of the root directory.

Quote:
Originally Posted by Intell View Post
Starting with 10.7, /usr/local is there on a fresh installation, just empty. It was also there for 10.0-10.2, but had some stuff in it.
Doesn't make sense that it had stuff in it. But I remain skeptical that it's there by default now, we had a discussion about this in the programming forum a while back, and everyone seems to agree that it's not there on a fresh install. Anyway, moot point.
subsonix is offline   0 Reply With Quote
Old Jun 8, 2013, 08:14 PM   #17
Intell
macrumors P6
 
Intell's Avatar
 
Join Date: Jan 2010
Location: Inside
Quote:
Originally Posted by subsonix View Post
Please, how is that different from Homebrew, if someone decides to install a package manager they surely are aware of the root directory.
homebrew has its files in a hidden directory. Often people blindly follow instructions they found in the internet to get something working. If those instructions include installing Macports to get to something, the /opt directory would be created. Once they're done following the instructions, they'll likely see the new "mysterious" folder. To most unenlightened end users, they'll think it is something bad and remove it. Only removing it could break the end result of the instructions they were following. With homebrew, it's all hidden away from the unknowing end user.
__________________
Last edited by Intell; Yesterday at 3:16 AM.
Intell is offline   0 Reply With Quote
Old Jun 8, 2013, 08:17 PM   #18
subsonix
macrumors 68030
 
Join Date: Feb 2008
Quote:
Originally Posted by Intell View Post
homebrew has its files in a hidden directory. Often people blindly follow instructions they found in the internet to get something working. If those instructions include installing Macports to get to something, the /opt directory would be created. Once they're done following the instructions, they'll likely see the new "mysterious" folder. To most unenlightened end users, they'll think it is something bad and remove it. Only removing it could break the end result of the instructions they were following. With homebrew, it's all hidden away from the unknowing end user.
Ridiculous, so your main objection now is that Macports doesn't use: chflags hidden /opt in the install script just to save the user from him/her self. Ok then.

Like I said this is a well established practice. And if you want to follow the Mac standard way so religiously why doesn't Homebrew install to /Applications.
subsonix is offline   0 Reply With Quote
Old Jun 8, 2013, 08:19 PM   #19
Intell
macrumors P6
 
Intell's Avatar
 
Join Date: Jan 2010
Location: Inside
I have other objections to it as well, but you've requested that we not discuss those.
__________________
Last edited by Intell; Yesterday at 3:16 AM.
Intell is offline   0 Reply With Quote
Old Jun 8, 2013, 08:21 PM   #20
subsonix
macrumors 68030
 
Join Date: Feb 2008
Quote:
Originally Posted by Intell View Post
I have other objections to it as well, but you've requested that we not discuss those.
Well you are wrong! And btw, I politely requested that we should not discuss it period (to much of a Vi vs Emacs type of discussion), but you picked one last thing to go on about. I, unlike you, don't think about these things in absolute terms, that is, use what ever you prefer.
subsonix is offline   0 Reply With Quote
Old Jun 8, 2013, 08:30 PM   #21
Intell
macrumors P6
 
Intell's Avatar
 
Join Date: Jan 2010
Location: Inside
Well then, I very much dislike how it messes with my PATH variables. Often obliterating them. I don't like how it doesn't clean up after itself, but leaves garbage and broken symlinks throughout my /usr/ folders. I don't like how some of its binaries override the default ones. I don't like how it requires super user to simply search for available packages (they may have fixed this one). I don't like its lack of certain packages that homebrew and fink have or how they're often broken on 32-bit only Macs. I don't like how its binaries cannot be easily integrated with non-PATH shells things like Applescript. I don't like how tcsh doesn't work without spewing errors at every command once its installed.
__________________
Last edited by Intell; Yesterday at 3:16 AM.
Intell is offline   0 Reply With Quote
Old Jun 8, 2013, 08:32 PM   #22
subsonix
macrumors 68030
 
Join Date: Feb 2008
I'm sorry man, but this hasn't been my experience. I'm also sorry for the OP who's suggested fix was to reinstall OS X.

Now, please let's end this. I'm sure nothing I say will change your mind.
subsonix is offline   0 Reply With Quote
Old Jun 8, 2013, 08:34 PM   #23
Intell
macrumors P6
 
Intell's Avatar
 
Join Date: Jan 2010
Location: Inside
Can we at least agree that fink is not the recommenced choice for obtaining UNIX and UNIX-like packages?
__________________
Last edited by Intell; Yesterday at 3:16 AM.
Intell is offline   0 Reply With Quote
Old Jun 8, 2013, 09:06 PM   #24
chrfr
macrumors 68020
 
Join Date: Jul 2009
Quote:
Originally Posted by ScottishCaptain View Post
This.

Something is seriously messed up. I don't have tar in /bin, it's in /usr/bin. And /usr/bin should be in $PATH, so I have no idea why you're messing with symlinks.
By default in 10.8.x, /usr/bin/tar is a symlink to /usr/bin/bsdtar, not /usr/local/bin/bsdtar, nor is tar in /bin. Something changed that somewhere along the line in the OP's system. I'd still lean toward a reinstall (not a format and reinstall) as it'll probably be quicker than figuring out all of what else may have been changed and should fix this.
chrfr is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > OS X > OS X 10.8 Mountain Lion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Help with permissions usr/bin/tar garikfox OS X 10.8 Mountain Lion 2 Oct 1, 2013 02:27 AM
Help pls. What have I done? /usr/bin/sudo sunshinee27 OS X 5 Sep 24, 2013 11:50 AM
Ubuntu: Install app in usr/bin fivetoadsloth Windows, Linux & Others on the Mac 0 Apr 9, 2013 09:11 PM
Always open file with this application with /usr/bin/? frank131 OS X 2 Sep 6, 2012 10:55 PM
/usr/local/bin - all my files were removed saka MacBook Pro 1 Aug 7, 2012 12:52 PM

Forum Jump

All times are GMT -5. The time now is 09:40 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC