有段时间没有来园子了,今天从 www.kernel.org 上面下载了一个 2.6.32.2 内核压缩包,下载

下来后发现是一个  .xz  结尾的文件,一看与通常的  .gz、.bz2等格式不一样,感觉可能利用系统现有

的压缩和解压缩工具可能不能解压,测试后果然不能通过gzip、bzip呼和bzip2等工具解压。

  就在Internet上捞了一下,知道整个这个格式是 LZMA 格式的压缩文件,就是说是利用LZMA压缩

算法生成的,而前面的压缩和解压缩工具不支持这个算法。于是就又捞了一把,说是可以用7zip工具来

解压,也可以用 XZ Utils工具进行解压。  于是就逛了一圈 XZ Utils的官网:http://tukaani.org/xz/

下载了一个xz-5.0.1.tar.gz 的源码包。解压后如下所示:

  1. [root@localhost setup_file]# cd xz-5.0.
  2. [root@localhost xz-5.0.]# ls
  3. ABOUT-NLS config.h COPYING dos lib NEWS tests
  4. aclocal.m4 config.h.in COPYING.GPLv2 Doxyfile libtool PACKAGERS THANKS
  5. AUTHORS config.log COPYING.GPLv3 Doxyfile.in m4 po TODO
  6. autogen.sh config.status COPYING.LGPLv2. extra Makefile README windows
  7. build-aux configure debug INSTALL Makefile.am src
  8. ChangeLog configure.ac doc INSTALL.generic Makefile.in stamp-h1

   里面有一个README文档,打开后查看里面的内容:

  1. . Compile XZ Utils with debugging code using configure switches
  2. --enable-debug and, if possible, --disable-shared. If you are
  3. using GCC, use CFLAGS='-O0 -ggdb3'. Don't strip the resulting
  4. binaries.

  这地方说,如果你需要编译带调试信息的代码,那么就需要在执行 ./configure 的时候带上 --enable-debug 选项。

不过一般不需要。

  然后接着往下看:

  1. . Try to reproduce the suspected bug. If you get "assertion failed"
  2. message, be sure to include the complete message in your bug
  3. report. If the application leaves a coredump, get a backtrace
  4. using gdb:
  5. $ gdb /path/to/app-binary # Load the app to the debugger.
  6. (gdb) core core # Open the coredump.
  7. (gdb) bt # Print the backtrace. Copy & paste to bug report.
  8. (gdb) quit # Quit gdb.

  这个地方说,如果在make 或者 make install 的时候遇到 中断错误,那么就可以执行下面的命令来

检查出错的原因。 一般编译的时候,不会出错,这一步也能省略。

  然后接着往下看:

  1. . Translating the xz tool
  2. --------------------------
  3.  
  4. The messages from the xz tool have been translated into a few
  5. languages. Before starting to translate into a new language, ask
  6. the author that someone else hasn't already started working on it.
  7.  
  8. Test your translation. Testing includes comparing the translated
  9. output to the original English version by running the same commands
  10. in both your target locale and with LC_ALL=C. Ask someone to
  11. proof-read and test the translation.
  12.  
  13. Testing can be done e.g. by installing xz into a temporary directory:
  14.  
  15. ./configure --disable-shared --prefix=/tmp/xz-test
  16. # <Edit the .po file in the po directory.>
  17. make -C po update-po
  18. make install
  19. bash debug/translations.bash | less
  20. bash debug/translations.bash | less -S # For --list outputs

  这个地方到了正题: 编译和安装 xz 工具。

  1、这里提到了一句,与 LC_ALL 区域的相关的问题,一般情况下,这个变量不需要修改,就算

不设置为 LC_ALL=C 也没有关系。一般情况下这个变量的值为空。

  2、编译第一步:执行  ./configure 文件

  1. ./configure --disable-shared --prefix=/tmp/xz-test

  这一句用来配置编译过程,  --disable-shared 的意思是禁止共享,

               --prefix=/tmp/xz-test  表示编译后将xz安装到 /tmp/xz-test 目录下。

  3、更新po文件,

  1. make -C po update-po

  这个命令的意思,没啥好解释的  -C po 指定Makefile的搜索路径, update-po 表示执行这个目标

  4、编译和安装

  1. make install

  执行这个命令后,就将xz工具编译后,并安装到  /tmp/xz-test 目录下。

  我就是这么做的,所以执行  /test/xz-test/bin/xz    --help 后显示如下:

  1. [root@localhost linux-2.6.32.61]# /tmp/xz-test/bin/xz --help
  2. Usage: /tmp/xz-test/bin/xz [OPTION]... [FILE]...
  3. Compress or decompress FILEs in the .xz format.
  4.  
  5. -z, --compress force compression
  6. -d, --decompress force decompression
  7. -t, --test test compressed file integrity
  8. -l, --list list information about .xz files
  9. -k, --keep keep (don't delete) input files
  10. -f, --force force overwrite of output file and (de)compress links
  11. -c, --stdout write to standard output and don't delete input files
  12. - ... - compression preset; default is ; take compressor *and*
  13. decompressor memory usage into account before using -!
  14. -e, --extreme try to improve compression ratio by using more CPU time;
  15. does not affect decompressor memory requirements
  16. -q, --quiet suppress warnings; specify twice to suppress errors too
  17. -v, --verbose be verbose; specify twice for even more verbose
  18. -h, --help display this short help and exit
  19. -H, --long-help display the long help (lists also the advanced options)
  20. -V, --version display the version number and exit
  21.  
  22. With no FILE, or when FILE is -, read standard input.
  23.  
  24. Report bugs to <lasse.collin@tukaani.org> (in English or Finnish).
  25. XZ Utils home page: <http://tukaani.org/xz/>

  如果你觉得麻烦,可以将路径: /tmp/xz-test/bin  添加到环境变量 PATH 中,或者临时导出一下也行。

  -d:  解压缩

  -z: 压缩文件

  -t: 测试文件的一致性

  -l: 列出文件的信息

命令如下执行:

  1. /tmp/xz-test/bin/xz -d linux-2.6.32.2.xz

  就可以解压你的xz文件了。

  今天这个话题就说到这,希望能给你的系统使用带来方便。

【Linux_Fedora_应用系列】_5_如何安装XZ Utils 解压缩工具以及利用 xz工具来解压缩.xz文件的更多相关文章

  1. 【Linux_Fedora_应用系列】_4_安装chrome浏览器

    在前面一篇文章中,我们讨论了在Linux Fedora 14下安装WMV解码器:[Linux_Fedora_应用系列]_3_如何利用Smplayer播放WMV格式的文件 在文章中介绍的方法同样适合FC ...

  2. 【Linux_Fedora_应用系列】_2_如何安装视频播放器和视频文件解码

    在前面的一篇博文中,我们进行了音乐播放器的安装和解码器的安装.[Linux_Fedora_应用系列]_1_如何安装音乐播放器和mp3解码 这里我们来进行视频播放器的安装.我们还是通过yum方式安装. ...

  3. Mac OS X 10.8.4下面XZ Utils(*.tar.xz)压缩解压缩命令工具的安装

    主要参考:http://bbs.chinaunix.net/thread-3610738-1-1.html 现在很多找到的软件都是tar.xz的格式的,xz 是一个使用 LZMA压缩算法的无损数据压缩 ...

  4. 【Linux_Fedora_应用系列】_1_如何安装音乐播放器和mp3解码

    因为安装环境的不同,Fedora在安装后会安装不同的软件包.通常在安装的时候有多种选择: 1.桌面环境: 适合个人日常使用,安装包含办公软件(Fedora 默认安装Open Office).娱乐影音软 ...

  5. 【Linux_Fedora_应用系列】_3_如何利用Smplayer播放WMV格式的文件

    在上一篇我们成功安装了视频播放器,并且成功安装里解码器[Linux_Fedora_应用系列]_2_如何安装视频播放器和视频文件解码 安装完的Smplayer的GUI的界面程序,可以播放FLV.AVI. ...

  6. Redis系列(1)之安装

    Redis系列(1)之安装 由于项目的需要,最近需要研究下Redis.Redis是个很轻量级的NoSql内存数据库,它有多轻量级的呢,用C写的,源码只有3万行,空的数据库只占1M内存.它的功能很丰富, ...

  7. Kali linux系列之 zmap 安装

    Kali linux系列之 zmap 安装 官方文档地址:https://zmap.io/ 准备:保证有比较顺畅的更新源,可以更新系统,下载安装包. 安装 第一步:sudo apt-get insta ...

  8. Open vSwitch系列之二 安装指定版本ovs

    在ovs学习过程中,如果自己想要安装一个ovs交换机其实一条简单的命令 apt  install openvswitch 就可以了,但是这种方法只能安装低版本的ovs.在特殊情况下需要安装指定版本,例 ...

  9. kubernetes系列03—kubeadm安装部署K8S集群

    本文收录在容器技术学习系列文章总目录 1.kubernetes安装介绍 1.1 K8S架构图 1.2 K8S搭建安装示意图 1.3 安装kubernetes方法 1.3.1 方法1:使用kubeadm ...

随机推荐

  1. [Maven]Eclipse插件之Maven配置及问题解析.

    前言:今天在自己环境装了Maven环境, 并且安装了Eclipse插件, 在查找插件过程中确实遇到一些问题, 好不容易找到一个  却又有问题.装好了插件之后, 用Eclipse创建Maven项目却出现 ...

  2. Fedora Static Configure

    Background Currenlty! I am work on fedora system, but the static-ip has required, but the fedora hav ...

  3. Atitit  代理与分销系统(1)  子代理 充值总额功能设计概览 sum() groubpy subagt

    Atitit  代理与分销系统(1)  子代理 充值总额功能设计概览 sum() groubpy subagt Keyword 分组与聚合操作. 一个for做分组...里面的做聚合... 数据g操作查 ...

  4. Atitit.gui api自动化调用技术原理与实践

    Atitit.gui api自动化调用技术原理与实践 gui接口实现分类(h5,win gui, paint opengl,,swing,,.net winform,)1 Solu cate1 Sol ...

  5. Android 图片文件操作、屏幕相关、.9图片的理解

     一:Android图片操作 1.存储bitmap到本地文件系统 public static void bitmapToFile(Bitmap bitmap, String uri) { if(!ex ...

  6. Eclipse 启动时提示“发现了以元素'd:skin'开头的无效内容,此处不应含有子元素“

    今天打开 Eclipse 时遇到了这个提示,如图所示: 关闭后发现控制台也有提示: [2016-04-19 11:11:20 - Android SDK] Error when loading the ...

  7. AntV 数据可视化解决方案发布

    今天蚂蚁金服发布了一套数据可视化规范AntV. AntV 是一套专业的数据可视化规范,这套规范的目的是为了让可视化的使用者更懂数据可视化.这套规范是蚂蚁金服在可视化建设过程中的理论沉淀,它可以很好得指 ...

  8. springMVC robots.txt 处理

    正常情况这样就好使 <mvc:resources mapping="/robots.txt" location="/lib/robots.txt"/> ...

  9. Android入门(十七)Android多线程

    原文链接:http://www.orlion.ga/670/ 一.在子线程中更新UI Android中不允许在子线程中更新UI,只能在主线程中更新,但是我们有时候必须在子线程中执行一些耗时的任务,然后 ...

  10. heroku部署java web项目

    一.开发 在本地eclipse创建maven web项目(此时可以当成正常的javaweb项目开发即可.注意添加servlet依赖,此时不用添加jetty依赖) 二.部署前准备 1.首先在pom.xm ...