LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   tar file problem in lfs (https://www.linuxquestions.org/questions/linux-from-scratch-13/tar-file-problem-in-lfs-4175728342/)

lfshunna 08-24-2023 12:13 PM

tar file problem in lfs
 
why am i getting this error what is the solution for this i am really a newbie to lfs i watched and tried the kernotex videos i watched on the internet but i got stuck in 5 chapters 5.2. Binutils-2.40 - Pass 1 given error like Try 'tar --help' or 'tar --usage' for more information.
lfs:/mnt/lfs/sources$ tar - zvf '/mnt/lfs/sources/util-linux-2.38.1.tar.xz'
tar: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options
Try 'tar --help' or 'tar --usage' for more information.

Try 'tar --help' or 'tar --usage' for more information.
lfs:/mnt/lfs/sources$ tar - zvf '/mnt/lfs/sources/util-linux-2.38.1.tar.xz'
tar: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options
Try 'tar --help' or 'tar --usage' for more information.
lfs:/mnt/lfs/sources$

sorry for this silly question i just wanted to understand lfs why am i getting this error

fedoralinuxjunkie 08-24-2023 03:49 PM

Hey there,

Are you trying to extract the archive? If so, you need to change the command to
Code:

tar -xvf '/mnt/lfs/sources/util-linux-2.38.1.tar.xz'
to extract it. You could also run it without the "-" like this:
Code:

tar xvf '/mnt/lfs/sources/util-linux-2.38.1.tar.xz'
& it will work just as well. What's happening here is as follows: The x option tells tar to extract the archive. The v option tells tar to print the filename currently being extracted (or being put into a tar archive) to the console. The f option specifies the filename that tar needs to work with, & is used when both extracting & creating tar archives. The z option shouldn't be necessary here being I think it only applies when creating a tar archive (the z option runs the archive through the gzip compressor). Hopefully this clears things up for you.


All times are GMT -5. The time now is 01:44 AM.