I am trying to install Boost on an unix cluster machine following the Boost instructions
I downloaded boost_1_43_0.tar.bz2 and was then instructed to execute the following command:
tar --bzip2 -xf /path/to/boost_1_43_0.tar.bz2
However it didn't work and this is the output I get:
tar --bzip2 -xf
/path/to/boost_1_43_0.tar.bz2
tar: /path/to/boost_1_43_0.tar.bz2:
Cannot open: No such file or directory
tar: Error is not recoverable: exiting
now
tar: Child returned status 2
tar: Error exit delayed from previous
errors
You don't literally write /path/to/boost_1_43_0.tar.bz2.
If the archive is in the current directory, you write ./boost_1_43_0.tar.bz2, for instance. Or if you saved it in the /tmp directory, the command would be tar --bzip2 -xf /tmp/boost_1_43_0.tar.bz2.
Instructions that use /path/to/some/file to indicate that you need to use your own path are pretty common. You'll need to be careful about reading the commands before you execute them in the future, too.
By /path/to/boost_1_43_0.tar.bz2 they mean the path to the downloaded file, wherever you happened to save it on your machine. So if you downloaded it in /home/Elpezmuerto, the path would be /home/Elpezmuerto/boost_1_43_0.tar.bz2.
Related
I am creating a .deb package that would run a shell script as preinst.
The shell script needs some input files, which would be available at where I have the .deb package, as below.
Package_located_directory $ >
mydebpackage.deb
inputfile1
inputfile2
I would just transfer all the files to the different machine at any location and install it with dpkg -i mydebpackage.deb
I tried using pwd in the preinst to get the current deb file located directory.
So, I can get the path of the inputfiles from the preinst script.
But if I run pwd from preinst , it is giving me / instead of the package located directory.
Also I tried passing pwd from the PIPE to achieve this, as below,
pwd | dpkg -i mydebpackage.deb
But I do not want to depend on the user input for the path.
Please guide me for getting the current deb package located directory path from inside of preinst script.
it's better to use postinst and modify the file on your system.
for example : Modify the file /etc/test/test.txt in postinst file
I am trying to compile R locally using a bash file, but it fails and shows the following error:
tar: command not found
cd: R-3.2.5: No such file or directory
./configure: No such file or directory
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target `install'. Stop.
R-3.2.5/lib64/R/bin/R: No such file or directory
sed: command not found
mv: command not found
tar: command not found
Bellow is the bash file I am submitting:
#!/bin/bash
tar -xzvf R-3.2.5.tar.gz
cd R-3.2.5
./configure --prefix=$(pwd)
make
make install
cd ..
R-3.2.5/lib64/R/bin/R -e 'install.packages(c("BGLR"),
repos="http://cran.cnr.berkeley.edu/", dependencies = TRUE)'
sed -i '/^R_HOME_DIR=/c R_HOME_DIR=$(pwd)/R' R-3.2.5/lib64/R/bin/R
mv R-3.2.5/lib64/R ./
tar -czvf R.tar.gz R/
When I run the same command lines directly on terminal it works fine, but when I try to run them using a bash file it fails.
Does anyone have an idea how to make it work?
The bash instance used to run the script doesn't seem to have the $PATH variable correctly set, so it can't find tar and the other commands.
Try replacing the 1st line with #!/bin/bash -l. Add echo Path: $PATH as the 2nd line and see if one of the directory listed actually contains tar. You should get something like /bin:/sbin:/usr/bin/.
I have a file (reviews_dataset.tar.gz) that contains many files which contains data. I am required to extract the files in this archive and then perform some basic commands on the file. So far I have created a directory named (CW) and found a command tar zxvf fileNameHere.tgz but when I run this it of course cannot find my file as I have not "downloaded it" into my directory yet? How do I get this file into my directory so that I can then extract it? Sorry if this is poorly worded I am extremely new to this.
You must either run the command from the directory your file exists in, or provide a relative or absolute path to the file. Let's do the latter:
cd /home/jsmith
mkdir cw
cd cw
tar zxvf /home/jsmith/Downloads/fileNameHere.tgz
You should use the command with the options preceded by dash like this:
tar -zxvf filename.tar.gz
If you want to specify the directory to save all the files use -C:
tar -zxf filename.tar.gz -C /root/Desktop/folder
There are double compressed files with extension xxx.zip.gz
On gunzip - xxx.zip file is created of size 0.25 GB
On unzip after gunzip - xxx.zip file extension does not change
Output of unzip :
Archive: xxx.zip
inflating: xxx.txt
also
echo $? shows 0
so, even though zip command completed successfully and still the file remains with zip extension , any help ?
OS - SunOS 5.10
You're finding the xxx.txt is being created, right?
unzip and gunzip have different "philosophies" about dealing with their archive. gunzip gets rid of the .gz file, while unzip leaves its zip file in place. So in your case, zip is working as designed.
I think the best you can do is
unzip -q xxx.zip && /bin/rm xxx.zip
This will only delete the zip file if unzip exits without error. The -q option makes unzip quiet, so you won't get the status messages you included above.
edit
as you asked when zip file itself is +10 GB in size, then unzip does not succeed
Assuming that you are certain there is enough diskspace to save the expanded orig file, then it's hard to say. How big is the expanded file? Over 2GB? SunOS5 I believe, used to have file-size limitation at 2GB, requiring a 'large-file' support to be added into kernel and utilities. I don't have access to Sun anymore so can't confirm. I think you'll find places to look with apropos largefile (assuming your $MANPATH is setup correctly).
But the basic test for did the unzip work correctly would be something like
if unzip "${file}" ; then
echo "clean unzip for ${file}, deleting the archive file" >&2
/bin/rm "${file}"
else
echo "error running unzip for ${file}, archive file remains in place" >&2
fi
(Or I don't understand your use case). Feel free to post another question showing ls -l xxx.zip.gz xxx.zip and other details to help reconstruct your expected workflow.
IHTH.
When I attempt to extract a huge tar archive, I get the following error:
"filename: No such file or directory found"
Any suggestions on what could be going wrong?
This may happen if the disk is full. If you extract using:
tar -xvf <filename.tar>
you may see the following message before any No such file or directory found:
mkdir failed: Disk quota exceeded
why dont you try to test your tar file first!
file yourfile.tar
(it should say its a tar file if it's not broken)
Then...
tar -tvf yourfile.tar
It should give a listing of the contents of your tar file without actually writing it to disk. Just to check the integrity of it.
Also, if your file is larger tan 2GB it is posible that your tar binary wont work, try gtar instead!
with that info, you can go further...
regards,
Daniel.