Tar command has me stumped...

I’m embarrassed to even have to ask this, as I have been using Linux for years, albeit not soley on the command line, as I am now…

I downloaded minidlna, which comes packaged as a .tar.gz file archive. When I extract it with “tar -xvf minidlna.xxxxx”, it extracts a “usr” directory and an “etc” in my home directory (as that is where the tar archive is when I extract it). How can I safely extract this tar archive and merge the resulting directories into my existing system? I attempted to use “cp -Ri etc/ /etc/” but the resulting filesystem looked like “/etc/etc/minidlna.conf” and the same happened for the “usr” directory (e.g. /usr/usr/xxxx).

This is so simple, but I’ve never had to deal with a tar archive packaged this way before.

Thanks for any insight, and any snickering that you could give me :slight_smile:

Hello there! Please reply to this post instead of my original question. For some reason, my Novell/Suse Forum accounts are completely messed up, and I had to create a new account, as my ‘vwgtiturbo’ account uses an email address I haven’t had in years (and no longer have access to). For whatever reason, the forum control panel wouldn’t let me change it, saying that my password was incorrect (although I had just logged in with that password).

Anyway, thanks for any insight!

first: the machine you wish to add minidlna to, what is the operating
system and version in use on that machine? please show us the terminal
output from


cat /etc/SuSE-release
uname -a

second: just unpacking a tarball should make only one directory (and
that one would be neither /usr nor /etc, so what happens if you issue
this command from a user terminal:


tar xzvf minidlna_1.0.22_src.tar.gz

and follow other bread crumbs (for example) here:
http://www.tuxfiles.org/linuxhelp/softinstall.html


DD
openSUSE®, the “German Automobiles” of operating systems

A so called tar file can contain anything. You seem to have a certain idea about what your tar file should contain. But apparently it contains different. You could first check what it contains by doing

tar tzvf minidlna_1.0.22_src.tar.gz

to get a list of the files archived there. And see if that corresponds with what you think (and ask yourself where that thinking is based upon, what to maker of the tar file told you?)

Gnu tar is different to traditional tar in that it usefully defaults to stripping the leading “/” from paths. You can restore the absolute path behaviour with the -P option.
e.g. “tar -xvPf minidlna.xxxxx”
but check with the* -tvPf* option sbefore using -xvPf.

vwgiturbo77 wrote:
> whatever reason, the forum control panel wouldn’t let me change it,
> saying that my password was incorrect (although I had just logged in
> with that password).

That’s just a bug with the forum software, don’t worry about it.

On 2011-10-26 07:16, vwgtiturbo wrote:
>
> I’m embarrassed to even have to ask this, as I have been using Linux for
> years, albeit not soley on the command line, as I am now…

Use a text mode file browser, Midnight Commander: mc. Yes, it opens tar
files, too.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

DenverD wrote:
> second: just unpacking a tarball should make only one directory

That’s not true. It can contain as many directories as you want.

> that one would be neither /usr nor /etc, so what happens if you issue
> this command from a user terminal:

That’s not true either. What has changed in modern tar is that it
automatically prevents the use of absolute paths, to avoid accidental or
deliberate corruption of systems.

So if you put ‘/usr’ into a tar file, it will unpack as just ‘usr’. And
that’s exactly what has happened here, I would guess. Somebody’s built
the tar archive to contain (hopefully part of) /usr and /etc and so when
unpacked, it creates two local directories called ‘usr’ and ‘etc’.

To the OP:

Its best to do as Henk suggests and use the t operation of tar to see
exactly what is in the tar file (BTW, no need for v option!) or else
simply look at what has been unpacked into those usr and etc directories.

You may be lucky and find that everything within those directories is
put into ‘local’ subdirectories. But quite likely, since the person who
created the tar file apparently doesn’t understand the etiquette of
preparing tar packages for linux systems, you’ll find it is trying to
add software directly to your /usr tree. That’s a bad idea and you
should put them somewhere else (/usr/local or /opt perhaps).

But perhaps a better idea is to read the reviews at
http://sourceforge.net/projects/minidlna/reviews/ where it says:

“I have packaged this for Red Hat/CentOS/Fedora & SUSE and it is
available in the openSUSE build service
(http:/software.opensuse.org/search)”

So perhaps look there instead of trying to install the tar file.

On 2011-10-26 12:25, Dave Howorth wrote:
> vwgiturbo77 wrote:
>> whatever reason, the forum control panel wouldn’t let me change it,
>> saying that my password was incorrect (although I had just logged in
>> with that password).
>
> That’s just a bug with the forum software, don’t worry about it.

He has to worry. Now he has two accounts, one with the old, useless email,
and one with the new. Now somebody has to manually remove one.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Carlos E. R. wrote:
> On 2011-10-26 12:25, Dave Howorth wrote:
>> vwgiturbo77 wrote:
>>> whatever reason, the forum control panel wouldn’t let me change it,
>>> saying that my password was incorrect (although I had just logged in
>>> with that password).
>> That’s just a bug with the forum software, don’t worry about it.
>
> He has to worry. Now he has two accounts, one with the old, useless email,
> and one with the new. Now somebody has to manually remove one.

Well he doesn’t have to worry. He has exactly one account that is useful
to him and a second one that he can ignore.

The admins may have to remove the extra account, if they care. But then
it’s a forum bug that caused the problem, so it seems fair that the
consequences fall on them.

On 10/26/2011 12:36 PM, Dave Howorth wrote:
> That’s not true. It can contain as many directories as you want.
>
> That’s not true either. What has changed in modern tar . . .

thank you Dave…you are correct on every count…i now admit that i
didn’t actually try using the “tar xzvf minidlna*” i gave in my post,
and that was wrong…

instead i downloaded the tarball and looked at it in mc (Midnight
Commander)…and mc (which i just LOVE) let me see what appeared to be
a normal *nix-style source tar ball…

and, WAIT!!

wait a moment: minidlna_1.0.22_src.tar.gz from sourceforge, placed in
~/test ran “tar xzvf minidlna_1.0.22_src.tar.gz” against it and it did
NOT produce either a ~/usr nor ~/etc directory…i think something is
rotten in the OP’s Denmark…because, instead i got the expected
(non-“modern”??) source directory of

~/test/minidlna-1.0.22

which contains all the expected useful guts:

<source>
INSTALL
LICENCE
Makefile
README

> So perhaps look there instead of trying to install the tar file.

YES! it exists there for openSUSE 11.4, so back to my first question
“the machine you wish to add minidlna to, what is the operating system
and version in use on that machine? please show us the terminal output
from . . .”

[please: don’t get me wrong, i learned some stuff here!]


DD
openSUSE®, the “German Automobiles” of operating systems

DenverD wrote:
> wait a moment: minidlna_1.0.22_src.tar.gz from sourceforge, placed in
> ~/test ran “tar xzvf minidlna_1.0.22_src.tar.gz” against it and it did
> NOT produce either a ~/usr nor ~/etc directory…i think something is
> rotten in the OP’s Denmark…because, instead i got the expected
> (non-“modern”??) source directory of
>
> ~/test/minidlna-1.0.22
>
> which contains all the expected useful guts:
>
> <source>
> INSTALL
> LICENCE
> Makefile
> README

Well caught. It seems like the OP hasn’t told all the facts about what
was downloaded and what was subsequently done.

OPs almost never do. They start reporting somewhere halfway and let others guess and assume. And the others then guess and/or assume often wrong. Thus advise that does not fit the probem, at least embarrasses the OP, at the most creates havoc.

Who is to blame. I think both the OP who does not tell all the details (and does not illustrate/prove what he tells with computer output) and we, the others, who fail to ask for all the details but are more eager to provide an answer then to study the problem.
Yes it is an interesting forum we live in :wink:

On 10/26/2011 01:30 PM, Dave Howorth wrote:
> The admins may have to remove the extra account

or just keep it, so they can continue to brag about the 62,626 members
here… :confused:


DD
openSUSE®, the “German Automobiles” of operating systems

Wow, thanks for all of the input! I was not expected such a turnout for what should be a simple question :slight_smile:

I am running opensuse 11.3, and did not find minidlna on the buildservice. Maybe my search term was wrong, but looking for “minidlna” and simply “dlna” returned zero results.

To avoid taking up much space to address each comment, I did test the tar extraction and a “usr/” and “etc/” was created in the directory that the tar archive resided in. HOWEVER, after looking at DenverD’s example, I realized that I downloaded the wrong tar archive. I downloaded the ‘static’ version, versus the ‘src’ version.

Good catch guys. I appreciate the watchful eye (for those that said the OP left something out!) and and now headed to download the CORRECT file.

Thanks again :slight_smile:

A small suggestion,

You don’t have to everything by CLI nowadays. If something is peculiar, ARK is installed by default on openSUSE.

Tony

On 10/26/2011 06:26 PM, vwgiturbo77 wrote:
>
> Thanks again :slight_smile:

welcome! info for NEXT time (or anyone who googles in)…here is a way
to search build service:

  • go here http://software.opensuse.org/search
  • spin the version to 11.3 (or whatever)
  • type in (for example) minidlna
  • click on “Search options”
  • click to add a check mark to “Include users’ home projects”
  • press the “Search” button
  • choose your poison and install with a “1-Click” or download the rpm of
    your choice…


DD
openSUSE®, the “German Automobiles” of operating systems

That’s why I couldn’t find it… I didn’t select the “User’s home projects” option… Thanks!

On 10/26/2011 07:46 PM, vwgiturbo77 wrote:
> That’s why I couldn’t find it… I didn’t select the “User’s home
> projects” option… Thanks!

yep, it is kinda ‘hidden’…and, there is a reason for that: (as far as
i know) it is as it says “Users home projects” and note it does not say
openSUSE community approved, certified as works as intended, guranteed
safe etc etc etc…

it could just as easily be something i ‘programmed’ and put in my home
folder (and, i’m not a programmer)!

now, as far as i know there have been no bad actors intentionally
planting problems there…but i always (if the packages is not in the
openSUSE repos) download source code directly from the source and
compile because i think that way i have a greater likelihood that all
the ills so installed are unintentional and not planned malicious…

if i install a pre-compiled package i wanna know it is from a very
trusted source…

but, some think i’m overly cautious…


DD
openSUSE®, the “German Automobiles” of operating systems

There’s no such thing as too cautious… hahaha