Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I downloaded Maven from http://mirror.atlanticmetro.net/apac....9-bin.tar.bz2 and when I tried to unpack it I used the command "tar xvjf apache-maven-2.0.9-bin.tar.bz2" but got an error message says : tar: bzip2: Cannot exec: No such file or directory
tar: Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error exit delayed from previous errors
What would be the right command to extract that file?
Any help will be very much appreciated.
make sure you are in ther same directory as the tar file and use bzip2 then it will extrat to a tar file then use tar command. but the only reason you have that error is you are not in that directory or you missed typed. man bzip2
man tar.
Quote:
bunzip2 -d apache-maven-2.0.9-bin.tar.bz2
then go back and untar tar "
Quote:
tar -xfv apache-maven-2.0.9-bin.tar.bz2
but if you are using a xwindows then use your archiver in kde and roxroller i think it is in gnome.
make sure you are in ther same directory as the tar file and use bzip2 then it will extrat to a tar file then use tar command. but the only reason you have that error is you are not in that directory or you missed typed. man bzip2
man tar.
then go back and untar tar "
I'm sorry I'm very new to this.
How can I know if I'm in the same directory as the tar file?
I'm sorry I'm very new to this.
How can I know if I'm in the same directory as the tar file?
Usually the prompt will tell you where you are. Though admittedly it can vary from distro to distro and from shell to shell, so sometimes it's not so clear. You can then use the pwd command, it will always tell you where you are:
Code:
$ pwd
/home/i92gubo
You can use cd to change from one directory to another. The other part of the problem is knowing where did you download the file. Desktops usually hide details from you which I think is a bad thing (and the reason becomes obvious in this very same thread).
If you don't know where did you download the file you will need to check and find that. Try to look in your desktop or your file explorer or whatever, and see if you can find the path to the file somewhere on its properties, the navigation bar or whatever.
You can as well use the find command. For example, in your terminal you could do this (lines beginning with '#' are comments):
Code:
# The next line changes to your home dir, You are probably
# there, but just in case
cd ~
# this line tells find to search for a file called myfile.txt
# starting from the current dir (.) and going thru all the subdirs
find . -name myfile.txt
If find can find it then it should spit the patch to the file. You can then use cd to go into that dir, and ls to list the files.
.
./.viminfo
./.bash_history
./.profile
./.bashrc
find: apache-maven-2.0.9-bin.tar.bz2: No such file or directory
But when I type ls from the root, I found the "apache-maven-2.0.9-bin.tar.bz2", but for some reason I can not extract it.
Here's the list of files from the root:
Code:
gridport:/# ls
apache-maven-2.0.9-bin.tar.bz2 etc media root usr
bin home mirror.atlanticmetro.net sbin var
boot initrd mnt srv
dev lib opt sys
emul lib64 proc tmp
.
./.viminfo
./.bash_history
./.profile
./.bashrc
find: apache-maven-2.0.9-bin.tar.bz2: No such file or directory
You forgot the -name. However, your ls shows that the file is on the current directory. So just using "tar xf apache-maven-2.0.9-bin.tar.bz2" will extract it. If that doesn't work, try xjf instead of xf. If that doesn't work, use "tar -xvjf apache-maven-2.0.9-bin.tar.bz2" to add some versobity, and paste the output here.
Quote:
But when I type ls from the root, I found the "apache-maven-2.0.9-bin.tar.bz2", but for some reason I can not extract it.
Paste the output, errors, or whatever as said above. Otherwise we can only guess.
gridport:/# find. -name apache-maven-2.0.9-bin.tar.bz2
-bash: find.: command not found
And here are the outputs on your suggested commands:
Code:
gridport:/# tar xf apache-maven-2.0.9-bin.tar.bz2
tar: bzip2: Cannot exec: No such file or directory
tar: Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error exit delayed from previous errors
Code:
gridport:/# tar xjf apache-maven-2.0.9-bin.tar.bz2
tar: bzip2: Cannot exec: No such file or directory
tar: Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error exit delayed from previous errors
Code:
gridport:/# tar -xvjf apache-maven-2.0.9-bin.tar.bz2
tar: bzip2: Cannot exec: No such file or directory
tar: Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error exit delayed from previous errors
What seems to be the problem?
Thanks for helping me, I really appreciate it.
gridport:/# find. -name apache-maven-2.0.9-bin.tar.bz2
-bash: find.: command not found
You need to be very careful when typing, and even more if operating as root. It's the best advice I can give you.
Note that the same error is telling you what's happening. It can't find a command named "find.", because it doesn't exist. The command is "find", without a dot. The dot must be separated by a space because otherwise linux thinks it's part of the command name.
Code:
find . -name apache-maven-2.0.9-bin.tar.bz2
Try it and it should work.
Code:
gridport:/# tar xf apache-maven-2.0.9-bin.tar.bz2
tar: bzip2: Cannot exec: No such file or directory
tar: Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error exit delayed from previous errors
This can mean a number of things, but usually it means that bzip2 is not installed. Strange because it's a standard tool. Can you check your package manager and see if the bzip2 package is installed? I think the problem might lie there. If you don't know how to deal with your package manager (or you don't know what that is at all) let me know your distro and I or someone around will be able to tell you how to check if bzip2 is installed and how to install it.
For example, in debian or ubuntu it should be this if my memory is on today:
I'm sorry about that, it was really my first time so I'm depending on you.
Anyway, I installed the bzip as like what you said. And it works.
I tried again the:
Code:
tar xf apache-maven-2.0.9-bin.tar.bz2
And it seems it works now. My question probably the last (I hope), how would I know if the command above worked? What command should I use? And if I unpacked the apache maven means it was already installed? Please bear with me..thank you.
And it seems it works now. My question probably the last (I hope), how would I know if the command above worked?
If no error was shown, then it worked. If you now use ls you should see the contents of the tarball. It will probably be on a directory with a name that's similar to this of the tarball, but without tar.bz2 of course.
A note for future usage is that you can use xvf to get a more verbose output. That why tar will output all the files it's extracting, so you will see them as they are decompressed. That will make it easier to find them later.
If you can't find the extracted files or identify them, you can as well use "tar tvf filename.tar.bz2" to list the contents of the tarball without extracting it again, so you can see where the files went.
Quote:
And if I unpacked the apache maven means it was already installed? Please bear with me..thank you.
By no means. This is an apache extension, so you will probably need to put it somewhere on the apache directory tree and probably configure it or apache or both so they can work together.
I can't help with that part because I don't use apache, but lighttpd as my web server of choice.
However, inside the directory where the package has been decompressed you should be able to find some readme or install file explaining you how to proceed. That's true most times. Another place where you can find docs about a given program or extension is usually the web site from where you downloaded it.
If your ran command and tar did not give you any errors while exiting, then probably you extracted it. Also it would create a directory without .tar.bz2 extension.
You will need to install the package that you downloaded. You just unpacked it like you unrar or unzip in windows.
It looks from the name that it is a binary file and you will need to look into the permissions and run the file. For changing the permissions you will need chmod command. To change permissions to allow you to execute the file do
chmod +x apache-mavenxxx.bin
Then execute the file.
But it may not be a binary file and you may have to look into it if it is a directory. If it is, then there should be a script called configure. You will need to run this script to move ahead. If everything goes fine with this script then run make and sudo make install.
If no error was shown, then it worked. If you now use ls you should see the contents of the tarball. It will probably be on a directory with a name that's similar to this of the tarball, but without tar.bz2 of course.
I am glad to be of any help.
I already see the tarball without tar.bz2. Thank you so much for the help.
I hope the next time I need help, I can count on you again.
If your ran command and tar did not give you any errors while exiting, then probably you extracted it. Also it would create a directory without .tar.bz2 extension.
You will need to install the package that you downloaded. You just unpacked it like you unrar or unzip in windows.
It looks from the name that it is a binary file and you will need to look into the permissions and run the file. For changing the permissions you will need chmod command. To change permissions to allow you to execute the file do
chmod +x apache-mavenxxx.bin
Then execute the file.
But it may not be a binary file and you may have to look into it if it is a directory. If it is, then there should be a script called configure. You will need to run this script to move ahead. If everything goes fine with this script then run make and sudo make install.
Hi,
can you tell me exactly what command should I use to run the apache-maven-2.0.9?
Seems the
chmod +x apache-mavenxxx.bin
command could not access.
If you can see the file there without .tar.bz2 extension then change the permissions on that file or directory. Alternatively post the output of ls -l where the extracted package is saved so that someone here can point you in correct direction.
If you can see the file there without .tar.bz2 extension then change the permissions on that file or directory. Alternatively post the output of ls -l where the extracted package is saved so that someone here can point you in correct direction.
Oh, why is that the output was "total 0" when I tried the ls -l??
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.