How to untar a .tar.xz file












1














I tried to run:



tar -zxvf name.tar.xz


but all I got was:



tar: Child returned status 2
tar: Error is not recoverable: exiting now









share|improve this question
























  • What do you call a normal install? A tar.xz is just a compressed archive of files.
    – Majenko
    Dec 13 '15 at 14:25










  • I tried tar -zxvf name.tar.xz
    – IlikeBananas
    Dec 13 '15 at 14:26










  • Try replacing the z with J
    – Majenko
    Dec 13 '15 at 14:27






  • 2




    What happens with tar --xz -xvf name.tar.xz?
    – muru
    Dec 13 '15 at 16:06






  • 2




    Possible duplicate of How do I uncompress a tarball that uses .xz?
    – zenith
    May 27 '17 at 9:18
















1














I tried to run:



tar -zxvf name.tar.xz


but all I got was:



tar: Child returned status 2
tar: Error is not recoverable: exiting now









share|improve this question
























  • What do you call a normal install? A tar.xz is just a compressed archive of files.
    – Majenko
    Dec 13 '15 at 14:25










  • I tried tar -zxvf name.tar.xz
    – IlikeBananas
    Dec 13 '15 at 14:26










  • Try replacing the z with J
    – Majenko
    Dec 13 '15 at 14:27






  • 2




    What happens with tar --xz -xvf name.tar.xz?
    – muru
    Dec 13 '15 at 16:06






  • 2




    Possible duplicate of How do I uncompress a tarball that uses .xz?
    – zenith
    May 27 '17 at 9:18














1












1








1







I tried to run:



tar -zxvf name.tar.xz


but all I got was:



tar: Child returned status 2
tar: Error is not recoverable: exiting now









share|improve this question















I tried to run:



tar -zxvf name.tar.xz


but all I got was:



tar: Child returned status 2
tar: Error is not recoverable: exiting now






tar






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 13 '15 at 16:32









kos

25.2k869119




25.2k869119










asked Dec 13 '15 at 14:24









IlikeBananas

26118




26118












  • What do you call a normal install? A tar.xz is just a compressed archive of files.
    – Majenko
    Dec 13 '15 at 14:25










  • I tried tar -zxvf name.tar.xz
    – IlikeBananas
    Dec 13 '15 at 14:26










  • Try replacing the z with J
    – Majenko
    Dec 13 '15 at 14:27






  • 2




    What happens with tar --xz -xvf name.tar.xz?
    – muru
    Dec 13 '15 at 16:06






  • 2




    Possible duplicate of How do I uncompress a tarball that uses .xz?
    – zenith
    May 27 '17 at 9:18


















  • What do you call a normal install? A tar.xz is just a compressed archive of files.
    – Majenko
    Dec 13 '15 at 14:25










  • I tried tar -zxvf name.tar.xz
    – IlikeBananas
    Dec 13 '15 at 14:26










  • Try replacing the z with J
    – Majenko
    Dec 13 '15 at 14:27






  • 2




    What happens with tar --xz -xvf name.tar.xz?
    – muru
    Dec 13 '15 at 16:06






  • 2




    Possible duplicate of How do I uncompress a tarball that uses .xz?
    – zenith
    May 27 '17 at 9:18
















What do you call a normal install? A tar.xz is just a compressed archive of files.
– Majenko
Dec 13 '15 at 14:25




What do you call a normal install? A tar.xz is just a compressed archive of files.
– Majenko
Dec 13 '15 at 14:25












I tried tar -zxvf name.tar.xz
– IlikeBananas
Dec 13 '15 at 14:26




I tried tar -zxvf name.tar.xz
– IlikeBananas
Dec 13 '15 at 14:26












Try replacing the z with J
– Majenko
Dec 13 '15 at 14:27




Try replacing the z with J
– Majenko
Dec 13 '15 at 14:27




2




2




What happens with tar --xz -xvf name.tar.xz?
– muru
Dec 13 '15 at 16:06




What happens with tar --xz -xvf name.tar.xz?
– muru
Dec 13 '15 at 16:06




2




2




Possible duplicate of How do I uncompress a tarball that uses .xz?
– zenith
May 27 '17 at 9:18




Possible duplicate of How do I uncompress a tarball that uses .xz?
– zenith
May 27 '17 at 9:18










3 Answers
3






active

oldest

votes


















9














The z flag of GNU tar (which is the version of tar shipped with Ubuntu) is used to speciy that the archive being processed is compressed using gzip, which is usually indicated by the .tar.gz (or, more rarely, .tgz) extension. In GNU tar, it is an error to use the z flag if the archive is not compressed with gzip, as you experience now.



Archives using the .tar.xz extension are compressed with xz, and the corresponding flag in GNU tar is J. Hence, replacing z with J in your command should solve your problem. In addition, you may get a "command not found" error if the xz tools are not installed on your system, which can be remedied by installing the xz-utils package.






share|improve this answer





















  • Alternatively, use the a flag to automatically determine the appropriate (de-)compressor from the archive file name.
    – David Foerster
    Dec 13 '15 at 23:38












  • @DavidFoerster No, the a flag is only used when creating archives. When extracting, it is sufficient to just not use any filetype-related flag at all.
    – fkraiem
    Dec 13 '15 at 23:58










  • Cool! I didn't know that, but I just tried it.
    – David Foerster
    Dec 14 '15 at 10:58



















1














.xz is "A compression format using LZMA2 to yield very high compression ratios" and should be extracted with ar (ar is installed by default as part of GNU utils).




The GNU ar program creates, modifies, and extracts from archives. An archive is a single file holding a collection of other files in a structure that makes it possible to retrieve the original individual files (called members of the archive).




There are more tools (like tar) but whatever other tool you use: make sure that that tool supports this ->




The original files' contents, mode (permissions), timestamp, owner, and group are preserved in the archive, and can be restored on extraction.







share|improve this answer































    0














    I had a 'tar.xz', so I used unxz myfile.tar.xz to uncompress the file, so I got the archive file myfile.tar. Then using the regular tar command on an archive file, I could extract the contents tar xvf myfile.tar.






    share|improve this answer





















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f709109%2fhow-to-untar-a-tar-xz-file%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      9














      The z flag of GNU tar (which is the version of tar shipped with Ubuntu) is used to speciy that the archive being processed is compressed using gzip, which is usually indicated by the .tar.gz (or, more rarely, .tgz) extension. In GNU tar, it is an error to use the z flag if the archive is not compressed with gzip, as you experience now.



      Archives using the .tar.xz extension are compressed with xz, and the corresponding flag in GNU tar is J. Hence, replacing z with J in your command should solve your problem. In addition, you may get a "command not found" error if the xz tools are not installed on your system, which can be remedied by installing the xz-utils package.






      share|improve this answer





















      • Alternatively, use the a flag to automatically determine the appropriate (de-)compressor from the archive file name.
        – David Foerster
        Dec 13 '15 at 23:38












      • @DavidFoerster No, the a flag is only used when creating archives. When extracting, it is sufficient to just not use any filetype-related flag at all.
        – fkraiem
        Dec 13 '15 at 23:58










      • Cool! I didn't know that, but I just tried it.
        – David Foerster
        Dec 14 '15 at 10:58
















      9














      The z flag of GNU tar (which is the version of tar shipped with Ubuntu) is used to speciy that the archive being processed is compressed using gzip, which is usually indicated by the .tar.gz (or, more rarely, .tgz) extension. In GNU tar, it is an error to use the z flag if the archive is not compressed with gzip, as you experience now.



      Archives using the .tar.xz extension are compressed with xz, and the corresponding flag in GNU tar is J. Hence, replacing z with J in your command should solve your problem. In addition, you may get a "command not found" error if the xz tools are not installed on your system, which can be remedied by installing the xz-utils package.






      share|improve this answer





















      • Alternatively, use the a flag to automatically determine the appropriate (de-)compressor from the archive file name.
        – David Foerster
        Dec 13 '15 at 23:38












      • @DavidFoerster No, the a flag is only used when creating archives. When extracting, it is sufficient to just not use any filetype-related flag at all.
        – fkraiem
        Dec 13 '15 at 23:58










      • Cool! I didn't know that, but I just tried it.
        – David Foerster
        Dec 14 '15 at 10:58














      9












      9








      9






      The z flag of GNU tar (which is the version of tar shipped with Ubuntu) is used to speciy that the archive being processed is compressed using gzip, which is usually indicated by the .tar.gz (or, more rarely, .tgz) extension. In GNU tar, it is an error to use the z flag if the archive is not compressed with gzip, as you experience now.



      Archives using the .tar.xz extension are compressed with xz, and the corresponding flag in GNU tar is J. Hence, replacing z with J in your command should solve your problem. In addition, you may get a "command not found" error if the xz tools are not installed on your system, which can be remedied by installing the xz-utils package.






      share|improve this answer












      The z flag of GNU tar (which is the version of tar shipped with Ubuntu) is used to speciy that the archive being processed is compressed using gzip, which is usually indicated by the .tar.gz (or, more rarely, .tgz) extension. In GNU tar, it is an error to use the z flag if the archive is not compressed with gzip, as you experience now.



      Archives using the .tar.xz extension are compressed with xz, and the corresponding flag in GNU tar is J. Hence, replacing z with J in your command should solve your problem. In addition, you may get a "command not found" error if the xz tools are not installed on your system, which can be remedied by installing the xz-utils package.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Dec 13 '15 at 16:31









      fkraiem

      8,69331728




      8,69331728












      • Alternatively, use the a flag to automatically determine the appropriate (de-)compressor from the archive file name.
        – David Foerster
        Dec 13 '15 at 23:38












      • @DavidFoerster No, the a flag is only used when creating archives. When extracting, it is sufficient to just not use any filetype-related flag at all.
        – fkraiem
        Dec 13 '15 at 23:58










      • Cool! I didn't know that, but I just tried it.
        – David Foerster
        Dec 14 '15 at 10:58


















      • Alternatively, use the a flag to automatically determine the appropriate (de-)compressor from the archive file name.
        – David Foerster
        Dec 13 '15 at 23:38












      • @DavidFoerster No, the a flag is only used when creating archives. When extracting, it is sufficient to just not use any filetype-related flag at all.
        – fkraiem
        Dec 13 '15 at 23:58










      • Cool! I didn't know that, but I just tried it.
        – David Foerster
        Dec 14 '15 at 10:58
















      Alternatively, use the a flag to automatically determine the appropriate (de-)compressor from the archive file name.
      – David Foerster
      Dec 13 '15 at 23:38






      Alternatively, use the a flag to automatically determine the appropriate (de-)compressor from the archive file name.
      – David Foerster
      Dec 13 '15 at 23:38














      @DavidFoerster No, the a flag is only used when creating archives. When extracting, it is sufficient to just not use any filetype-related flag at all.
      – fkraiem
      Dec 13 '15 at 23:58




      @DavidFoerster No, the a flag is only used when creating archives. When extracting, it is sufficient to just not use any filetype-related flag at all.
      – fkraiem
      Dec 13 '15 at 23:58












      Cool! I didn't know that, but I just tried it.
      – David Foerster
      Dec 14 '15 at 10:58




      Cool! I didn't know that, but I just tried it.
      – David Foerster
      Dec 14 '15 at 10:58













      1














      .xz is "A compression format using LZMA2 to yield very high compression ratios" and should be extracted with ar (ar is installed by default as part of GNU utils).




      The GNU ar program creates, modifies, and extracts from archives. An archive is a single file holding a collection of other files in a structure that makes it possible to retrieve the original individual files (called members of the archive).




      There are more tools (like tar) but whatever other tool you use: make sure that that tool supports this ->




      The original files' contents, mode (permissions), timestamp, owner, and group are preserved in the archive, and can be restored on extraction.







      share|improve this answer




























        1














        .xz is "A compression format using LZMA2 to yield very high compression ratios" and should be extracted with ar (ar is installed by default as part of GNU utils).




        The GNU ar program creates, modifies, and extracts from archives. An archive is a single file holding a collection of other files in a structure that makes it possible to retrieve the original individual files (called members of the archive).




        There are more tools (like tar) but whatever other tool you use: make sure that that tool supports this ->




        The original files' contents, mode (permissions), timestamp, owner, and group are preserved in the archive, and can be restored on extraction.







        share|improve this answer


























          1












          1








          1






          .xz is "A compression format using LZMA2 to yield very high compression ratios" and should be extracted with ar (ar is installed by default as part of GNU utils).




          The GNU ar program creates, modifies, and extracts from archives. An archive is a single file holding a collection of other files in a structure that makes it possible to retrieve the original individual files (called members of the archive).




          There are more tools (like tar) but whatever other tool you use: make sure that that tool supports this ->




          The original files' contents, mode (permissions), timestamp, owner, and group are preserved in the archive, and can be restored on extraction.







          share|improve this answer














          .xz is "A compression format using LZMA2 to yield very high compression ratios" and should be extracted with ar (ar is installed by default as part of GNU utils).




          The GNU ar program creates, modifies, and extracts from archives. An archive is a single file holding a collection of other files in a structure that makes it possible to retrieve the original individual files (called members of the archive).




          There are more tools (like tar) but whatever other tool you use: make sure that that tool supports this ->




          The original files' contents, mode (permissions), timestamp, owner, and group are preserved in the archive, and can be restored on extraction.








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Oct 31 '16 at 11:18

























          answered Oct 31 '16 at 11:12









          Rinzwind

          203k27388522




          203k27388522























              0














              I had a 'tar.xz', so I used unxz myfile.tar.xz to uncompress the file, so I got the archive file myfile.tar. Then using the regular tar command on an archive file, I could extract the contents tar xvf myfile.tar.






              share|improve this answer


























                0














                I had a 'tar.xz', so I used unxz myfile.tar.xz to uncompress the file, so I got the archive file myfile.tar. Then using the regular tar command on an archive file, I could extract the contents tar xvf myfile.tar.






                share|improve this answer
























                  0












                  0








                  0






                  I had a 'tar.xz', so I used unxz myfile.tar.xz to uncompress the file, so I got the archive file myfile.tar. Then using the regular tar command on an archive file, I could extract the contents tar xvf myfile.tar.






                  share|improve this answer












                  I had a 'tar.xz', so I used unxz myfile.tar.xz to uncompress the file, so I got the archive file myfile.tar. Then using the regular tar command on an archive file, I could extract the contents tar xvf myfile.tar.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Dec 5 at 23:25









                  Vahid Mir

                  1216




                  1216






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f709109%2fhow-to-untar-a-tar-xz-file%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Quarter-circle Tiles

                      build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

                      Mont Emei