Find the answer to your Linux question:
Results 1 to 9 of 9
Dear Sir, I would like to appreciate your doing best in answering Newbies questions. I have been using distro Red Hat Linux 9 for about two months. It was going ...
  1. #1
    Just Joined!
    Join Date
    May 2008
    Posts
    3

    no such file or directory

    Dear Sir,
    I would like to appreciate your doing best in answering Newbies questions. I have been using distro Red Hat Linux 9 for about two months. It was going very well. I do my best to learn eveything about GNU/Linux from several Forums, magazines, Googling,etc.
    I like to update and install new programs that are compatible with Red Hat. I install many rpm files and gz and bz2 files by reading the necessary instructions and Readme. But lately, I face a strange problem. I cannot install any program any more because it says (cannot open : No such file or directory) althourgh they are downloaded in the same directory(/home/loner/Downloads) Herewith you could find what is written in my shell [[harbey@localhost harbey]$ mkdir /usr/local/src
    mkdir: cannot create directory `/usr/local/src': File exists
    [harbey@localhost harbey]$ cd /usr/local/src
    [harbey@localhost src]$ ls
    [harbey@localhost src]$ tar -zxvf httrack-3.42-2.tar.gz
    tar (child): httrack-3.42-2.tar.gz: Cannot open: No such file or directory
    tar (child): Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Error exit delayed from previous errors
    [harbey@localhost src]$ su
    Password:
    [root@localhost src]# tar -zxvf httrack-3.42-2.tar.gz
    tar (child): httrack-3.42-2.tar.gz: Cannot open: No such file or directory
    tar (child): Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Error exit delayed from previous errors
    [root@localhost src]#].
    I am really sorry to take some of your effort and valuable time. But I read so much and I could not find the solution for this problem.
    Best regards and until hearing from you, I remain,
    Yours sincerely,
    harbey

  2. #2
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,344
    Does that file actually exist in your current working directory? Is it listed when you run ls?

  3. #3
    Linux User dxqcanada's Avatar
    Join Date
    Sep 2006
    Location
    Canada
    Posts
    259
    The tar command will assume that your file is somewhere in your Environment path.
    Example:
    Code:
    dennis@nc4200 ~ $ env | grep -i ^path
    PATH=/usr/kde/3.5/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.1.2:/usr/qt/3/bin:/usr/games/bin
    If the file is not in one of the directories specified ... then you will need to specify the path for the file.

    If the file is in the /usr/src/ directory the prefix the file name with "./"
    example:
    Code:
    # tar -zxvf ./httrack-3.42-2.tar.gz
    If the file is somewhere else you will need to qualify the full path.
    example:
    Code:
    # tar -zxvf /home/buddy/httrack-3.42-2.tar.gz



    Men occasionally stumble over the truth,
    but most of them pick themselves up
    and hurry off as if nothing had happened.

    Winston Churchill


    ... then the Unix-Gods created "man" ...

  4. #4
    Just Joined!
    Join Date
    May 2008
    Posts
    3

    no such file or directory

    Dear Daark.child,
    Thank you very much for your quick reply. As for your question, I say yes they are all in my working directory but unfortunately the (ls) displays only the names. When I try to get more information, it still says that there is no such file or directory, it is something strange.
    Dear dxqcanada,
    Thanks a lot. I tried your solutions but unfortuantely it stills tell me that there is no such file or directory. Anyhow .I am sorry to bother you all.
    I think it is better for me to reinstall Red Hat Linux 9 again. It may solve this problem.
    Best regards.
    Yours sincerely,
    harbey

  5. #5
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    2,941
    Quote Originally Posted by harbeyma View Post
    Herewith you could find what is written in my shell [[harbey@localhost harbey]$ mkdir /usr/local/src
    mkdir: cannot create directory `/usr/local/src': File exists
    [harbey@localhost harbey]$ cd /usr/local/src
    [harbey@localhost src]$ ls
    [harbey@localhost src]$ tar -zxvf httrack-3.42-2.tar.gz
    tar (child): httrack-3.42-2.tar.gz: Cannot open: No such file or directory
    tar (child): Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Error exit delayed from previous errors
    [harbey@localhost src]$ su
    Password:
    [root@localhost src]# tar -zxvf httrack-3.42-2.tar.gz
    tar (child): httrack-3.42-2.tar.gz: Cannot open: No such file or directory
    tar (child): Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Error exit delayed from previous errors
    [root@localhost src]#].
    I am really sorry to take some of your effort and valuable time. But I read so much and I could not find the solution for this problem.
    Best regards and until hearing from you, I remain,
    Yours sincerely,
    harbey
    Quote Originally Posted by harbeyma View Post
    As for your question, I say yes they are all in my working directory but unfortunately the (ls) displays only the names. When I try to get more information, it still says that there is no such file or directory, it is something strange.
    .... I think it is better for me to reinstall Red Hat Linux 9 again. It may solve this problem.
    Best regards.
    Yours sincerely,
    harbey
    From the output you originally posted you have nothing in /usr/local/src this appears to be why you are having problems .... reinstalling Linux will not help. You can try the command again after su command ... but it is likely ls will return no files.

    Ed: you can check where the file is located using something like
    Code:
    find / -name httrack*
    you need to cd to the directory and use ./httrack* rather than httrack* in the tar command as indicated in previous post from dxqcanada.
    Last edited by Jonathan183; 05-24-2008 at 06:13 PM. Reason: remove path info

  6. #6
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    Quote Originally Posted by dxqcanada View Post
    The tar command will assume that your file is somewhere in your Environment path.
    Example:
    Code:
    dennis@nc4200 ~ $ env | grep -i ^path
    PATH=/usr/kde/3.5/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.1.2:/usr/qt/3/bin:/usr/games/bin
    If the file is not in one of the directories specified ... then you will need to specify the path for the file.
    Eh? PATH is used to locate executable files, so it's found the tar binary from one of the entries in PATH. tar won't assume anything from PATH to find any filenames you give as command line arguments.

  7. #7
    Just Joined!
    Join Date
    May 2008
    Posts
    3

    no such file or directory

    Dear Sirs,
    Thank you very much for helping to solve my computer's problem. Sorry to say that nothing worked. I think that I made mistakes during my training on Red Hat Linux 9. Or it may be due to swicthdesk from gnome to kde.
    Then I tried and downloaded several programs from Internet and installed easily.Therefore I deleted all the programs that were not identified in my working directory. Now everything goes well. I had to not reinstall my distro.
    Thanks again.
    Best regards.
    Yours sincerely,
    harbey

  8. #8
    Linux User netstrider's Avatar
    Join Date
    Jul 2005
    Location
    South Africa
    Posts
    474
    harbeyma,

    Is your file located in /home/loner/Downloads or /usr/local/src?

    Post the output of
    Code:
    ls -A /home/loner/Downloads
    and
    Code:
    ls -A /usr/local/src
    please.

  9. #9
    Linux User dxqcanada's Avatar
    Join Date
    Sep 2006
    Location
    Canada
    Posts
    259
    Quote Originally Posted by scm View Post
    Eh? PATH is used to locate executable files, so it's found the tar binary from one of the entries in PATH. tar won't assume anything from PATH to find any filenames you give as command line arguments.
    Ah, I stand corrected.

    The PATH is only used by the shell to search for executable files.



    Men occasionally stumble over the truth,
    but most of them pick themselves up
    and hurry off as if nothing had happened.

    Winston Churchill


    ... then the Unix-Gods created "man" ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...