sudo symbolic link between directories

4 views
Skip to first unread message

thufir

unread,
Mar 17, 2012, 5:42:25 AM3/17/12
to ubuntu...@lists.ubuntu.com
To make a symbolic link between directories, am I doing this correctly?


thufir@dur:~$
thufir@dur:~$ ls opt
foo
thufir@dur:~$
thufir@dur:~$ ls bin
bar
thufir@dur:~$
thufir@dur:~$ ln -s opt bin
thufir@dur:~$
thufir@dur:~$ ls opt
foo
thufir@dur:~$
thufir@dur:~$ ls bin
bar opt
thufir@dur:~$
thufir@dur:~$ ls /opt/ActiveTcl-8.5/
bin demos doc include lib license-at8.5-thread.terms licenses man
MANIFEST_at8.5.txt README-8.5-thread.txt
thufir@dur:~$


That seems ok, so that now ~/bin has ~/opt contents, specifically file
foo. This is a dry run, before adding /opt/ActiveTcl-8.5/bin to /usr/bin
in the pattern, so that I don't destroy the directory.

(The point of this is so that when I compile ruby as per http://
beginrescueend.com/integration/tk/ that the compiled ruby has tk
correctly. It seems required to use ActiveTcl in this scenario.)


thanks,

Thufir


--
ubuntu-users mailing list
ubuntu...@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

thufir

unread,
Mar 17, 2012, 8:05:07 AM3/17/12
to ubuntu...@lists.ubuntu.com
On Sat, 17 Mar 2012 09:42:25 +0000, thufir wrote:

> To make a symbolic link between directories


Well, I guess it's not possible to link two existing directories:

"Just to clarify: I don't know of any filesystems where you can make
something that is both a directory and a symlink (I don't think it's
possible at all)..."

http://stackoverflow.com/questions/9277235/unix-symlink-in-directories-
when-the-directory-is-created-and-when-is-not

So, I don't understand, then, what these directions mean:

"Create as administrator (sudo) one link in /usr/bin to the command that
you'd like to call (for example with8.5 and tclsh8.5). One time that you
had create the links you can run directly tclsh8.5 or wish8.5 in one
terminal."

http://community.activestate.com/node/7489


I suppose the question is how to put the contents of /opt/ActiveTcl-8.5/
bin/ into /usr/bin, yet it doesn't seem that any of the four forms for
linking support that functionality, as a link is a file and not a
directory.

Just create a whole bunch of links to files in /opt/ActiveTcl-8.5/bin/?
That seems a bit off, there must be a better way.

Karl Auer

unread,
Mar 17, 2012, 5:46:00 PM3/17/12
to ubuntu...@lists.ubuntu.com
On Sat, 2012-03-17 at 09:42 +0000, thufir wrote:
> To make a symbolic link between directories, am I doing this correctly?
> That seems ok, so that now ~/bin has ~/opt contents, specifically file
> foo. This is a dry run, before adding /opt/ActiveTcl-8.5/bin to /usr/bin
> in the pattern, so that I don't destroy the directory.

Is ~/opt the same as /opt? If not, there is confusion in your plan
between the two. Or maybe not, in which case I don't understand what's
going on :-)

It doesn't feel right to me. You'll end up with /usr/bin/bin, or
possibly /usr/bin/ActiveTcl-8.5/bin. It also doesn't seem right that you
should have to construct this complicated arrangement just to help ruby
compile.

> (The point of this is so that when I compile ruby as per http://
> beginrescueend.com/integration/tk/ that the compiled ruby has tk
> correctly. It seems required to use ActiveTcl in this scenario.)

It seems likely that it would be possible (and preferable) to tell the
compile where ActiveTcl is, i.e., in /opt/ActiveTcl-8.5 instead of
wherever it expects it by default. I don't know about ruby specifically,
but these things are often compiled with tools like configure, where
command line options let you say where the various components are
installed.

A nice thing to do with things like this, where releases come often and
you may need to switch between versions, is to have all your versions
stored somewhere handy like this:

/wherever/ActiveTcl-8.5
/wherever/ActiveTcl-8.4
/wherever/ActiveTcl-8.3

... then have a link to the version you are using:

ln -s /wherever/ActiveTcl-8.5 /opt/ActiveTcl

That way you can put "/opt/ActiveTcl" in paths, scripts whatever, and
change the version by just changing one link, i.e. without having to go
and change all your other configurations (paths, scripts, whatever).

Regards, K.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (ka...@biplane.com.au)
http://www.biplane.com.au/kauer

GPG fingerprint: AE1D 4868 6420 AD9A A698 5251 1699 7B78 4EEE 6017
Old fingerprint: DA41 51B1 1481 16E1 F7E2 B2E9 3007 14ED 5736 F687

signature.asc

Ric Moore

unread,
Mar 17, 2012, 10:10:43 PM3/17/12
to Ubuntu user technical support, not for general discussions
On 03/17/2012 05:46 PM, Karl Auer wrote:
> On Sat, 2012-03-17 at 09:42 +0000, thufir wrote:
>> To make a symbolic link between directories, am I doing this correctly?
>> That seems ok, so that now ~/bin has ~/opt contents, specifically file
>> foo. This is a dry run, before adding /opt/ActiveTcl-8.5/bin to /usr/bin
>> in the pattern, so that I don't destroy the directory.
>
> Is ~/opt the same as /opt? If not, there is confusion in your plan
> between the two. Or maybe not, in which case I don't understand what's
> going on :-)
>
> It doesn't feel right to me. You'll end up with /usr/bin/bin, or
> possibly /usr/bin/ActiveTcl-8.5/bin. It also doesn't seem right that you
> should have to construct this complicated arrangement just to help ruby
> compile.

What about using alternatives? That would be one way to go. Ric

--
My father, Victor Moore (Vic) used to say:
"There are two Great Sins in the world...
..the Sin of Ignorance, and the Sin of Stupidity.
Only the former may be overcome." R.I.P. Dad.
http://linuxcounter.net/user/44256.html

thufir

unread,
Mar 18, 2012, 2:03:49 AM3/18/12
to ubuntu...@lists.ubuntu.com
On Sun, 18 Mar 2012 08:46:00 +1100, Karl Auer wrote:

> It seems likely that it would be possible (and preferable) to tell the
> compile where ActiveTcl is, i.e., in /opt/ActiveTcl-8.5 instead of
> wherever it expects it by default.


It's a permissions thing, RVM is (generally) run as user, who doesn't
have access to /opt.


-Thufir

thufir

unread,
Mar 18, 2012, 2:11:04 AM3/18/12
to ubuntu...@lists.ubuntu.com
On Sat, 17 Mar 2012 22:10:43 -0400, Ric Moore wrote:

>> It doesn't feel right to me. You'll end up with /usr/bin/bin, or
>> possibly /usr/bin/ActiveTcl-8.5/bin. It also doesn't seem right that
>> you should have to construct this complicated arrangement just to help
>> ruby compile.
>
> What about using alternatives? That would be one way to go. Ric

I don't think /usr/bin/ActiveTcl-8.5/bin would even work. I'd like to:

"Create as administrator (sudo) one link in /usr/bin to the command that
you'd like to call (for example with8.5 and tclsh8.5). One time that you
had create the links you can run directly tclsh8.5 or wish8.5 in one
terminal."

http://community.activestate.com/node/7489


so that when RVM compiles ruby tk is included. It's enough of a PITA
that I wonder perhaps Gentoo emerge doesn't have a point.

-Thufir

Karl Auer

unread,
Mar 18, 2012, 2:17:05 AM3/18/12
to ubuntu...@lists.ubuntu.com
On Sun, 2012-03-18 at 06:03 +0000, thufir wrote:
> On Sun, 18 Mar 2012 08:46:00 +1100, Karl Auer wrote:
> > It seems likely that it would be possible (and preferable) to tell the
> > compile where ActiveTcl is, i.e., in /opt/ActiveTcl-8.5 instead of
> > wherever it expects it by default.
> It's a permissions thing, RVM is (generally) run as user, who doesn't
> have access to /opt.

Are you sure? /opt is usually accessible to all - or does RVM run
chrooted?

If it runs chrooted, you'll find that symbolic links aren't enough -
you'll have to use hard links or multiply mounted filesystems, and that
is all starting to look very ugly.

signature.asc

Karl Auer

unread,
Mar 18, 2012, 2:25:04 AM3/18/12
to ubuntu...@lists.ubuntu.com
On Sun, 2012-03-18 at 06:11 +0000, thufir wrote:
> "Create as administrator (sudo) one link in /usr/bin to the command that
> you'd like to call (for example with8.5 and tclsh8.5). One time that you
> had create the links you can run directly tclsh8.5 or wish8.5 in one
> terminal."
>
> http://community.activestate.com/node/7489

On that page the same responder mentions a seemingly MUCH better
alternative - add ActiveTcl to your path!

export PATH=$PATH:/opt/ActiveTcl-8.5
... do stuff...

> so that when RVM compiles ruby tk is included. It's enough of a PITA
> that I wonder perhaps Gentoo emerge doesn't have a point.

It's unclear from your descriptions whether ruby requires access
libraries to compile, or whether the compile scripts just want to run
some tcl commands. If the latter, setting the path should work.

Regards, K.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (ka...@biplane.com.au)
http://www.biplane.com.au/kauer

GPG fingerprint: AE1D 4868 6420 AD9A A698 5251 1699 7B78 4EEE 6017
Old fingerprint: DA41 51B1 1481 16E1 F7E2 B2E9 3007 14ED 5736 F687

thufir

unread,
Mar 21, 2012, 4:08:09 AM3/21/12
to ubuntu...@lists.ubuntu.com
Reply all
Reply to author
Forward
0 new messages