How to fix : Cannot extract through symlink

926 views
Skip to first unread message

Manish Jain

unread,
Dec 21, 2017, 9:38:07 AM12/21/17
to freebsd-...@freebsd.org
Hi,

Whenever I try to install any rpm under my Linuxulator (linux_base-c7),
I get the error: cannot extract through <sym>

<sym> can be bin / sbin / lib / lib64, which are symbolic links to
usr/<sym> (under the path /compat/linux/)

Each time I am faced with this problem, I have to delete <sym> and copy
the actual directory in its place. But this is far less than ideal.

1) Is there some way I can avoid the above mess ?
2) If not, there was a time under Unix when hard-linking a directory was
possible. Is there some hack by which I could hard-link directories
under FreeBSD ?

--
Thanks & Regards,
Manish Jain
_______________________________________________
freebsd-...@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questi...@freebsd.org"

Arthur Chance

unread,
Dec 21, 2017, 11:06:58 AM12/21/17
to Manish Jain, freebsd-...@freebsd.org
On 21/12/2017 14:37, Manish Jain wrote:
> Hi,
>
> Whenever I try to install any rpm under my Linuxulator (linux_base-c7),
> I get the error: cannot extract through <sym>
>
> <sym> can be bin / sbin / lib / lib64, which are symbolic links to
> usr/<sym> (under the path /compat/linux/)
>
> Each time I am faced with this problem, I have to delete <sym> and copy
> the actual directory in its place. But this is far less than ideal.
>
> 1) Is there some way I can avoid the above mess ?
> 2) If not, there was a time under Unix when hard-linking a directory was
> possible. Is there some hack by which I could hard-link directories
> under FreeBSD ?

Looking at the manual for link(2), hard linking directories is
explicitly forbidden by the kernel.

Many moons ago under SunOS I tried hard linking directories just to see
what happened. Believe me, it's not a place you want to be, especially
not if the link went up the file hierarchy.

--
An amusing coincidence: log2(58) = 5.858 (to 0.0003% accuracy).

Tijl Coosemans

unread,
Dec 21, 2017, 2:01:25 PM12/21/17
to Manish Jain, freebsd-...@freebsd.org
On Thu, 21 Dec 2017 14:37:43 +0000 Manish Jain <bourne....@hotmail.com> wrote:
> Whenever I try to install any rpm under my Linuxulator (linux_base-c7),
> I get the error: cannot extract through <sym>
>
> <sym> can be bin / sbin / lib / lib64, which are symbolic links to
> usr/<sym> (under the path /compat/linux/)
>
> Each time I am faced with this problem, I have to delete <sym> and copy
> the actual directory in its place. But this is far less than ideal.
>
> 1) Is there some way I can avoid the above mess ?
> 2) If not, there was a time under Unix when hard-linking a directory was
> possible. Is there some hack by which I could hard-link directories
> under FreeBSD ?

Try extracting with tar -P, but please read the tar manual because -P
does other things like preserving absolute paths.

Tijl Coosemans

unread,
Dec 21, 2017, 3:33:47 PM12/21/17
to Manish Jain, freebsd-...@freebsd.org
On Thu, 21 Dec 2017 19:59:58 +0100 Tijl Coosemans <ti...@FreeBSD.org> wrote:
> On Thu, 21 Dec 2017 14:37:43 +0000 Manish Jain <bourne....@hotmail.com> wrote:
>> Whenever I try to install any rpm under my Linuxulator (linux_base-c7),
>> I get the error: cannot extract through <sym>
>>
>> <sym> can be bin / sbin / lib / lib64, which are symbolic links to
>> usr/<sym> (under the path /compat/linux/)
>>
>> Each time I am faced with this problem, I have to delete <sym> and copy
>> the actual directory in its place. But this is far less than ideal.
>>
>> 1) Is there some way I can avoid the above mess ?
>> 2) If not, there was a time under Unix when hard-linking a directory was
>> possible. Is there some hack by which I could hard-link directories
>> under FreeBSD ?
>
> Try extracting with tar -P, but please read the tar manual because -P
> does other things like preserving absolute paths.

Instead of using -P perhaps it's better to extract into a temporary
directory and move bin, sbin, lib, and lib64 to usr there. Then copy
everything to /compat/linux. That's essentially what we do in the
ports tree.
Reply all
Reply to author
Forward
0 new messages