Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the differences between tar.gz and tar.bz2

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what is the difference between tar.gz and tar.bz2". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the difference between tar.gz and tar.bz2".

Most of the software is packaged in tar.gz and tar.bz2, mostly installed through. / configure; make;make install; some software is directly make;make install

We can check the function of the configuration software through. / configure-- help; most software provides the function of. / configure configuration software; a few do not, if not, do not use. / configure; just make;make install it

. / configure one of the more important parameters is-- prefix, with the-- prefix parameter, we can specify the software installation directory; when we do not need this software, just delete the software directory

For example, we can specify that fcitx is installed in the / opt/fcitx directory

[root@localhost fcitx] #. / configure-prefix=/opt/fcitx

If we don't need fcitx, we can delete the / opt/fcitx directory directly.

So in this example, if fcitx is customized and installed into the / opt/fcitx directory, the complete installation method should be:

[root@localhost fcitx] # tar jxvf fcitx-3.2-050827.tar.bz2

[root@localhost fcitx] # cd fcitx

[root@localhost fcitx] #. / configure-prefix=/opt/fcitx

[root@localhost fcitx] # make

[root@localhost fcitx] # make install

=

What is the source package software

As the name implies, the source package is the visible software package of the source code, and the software based on Linux and BSD systems is the most common; the software visible from domestic sources is almost extinct; most of the open source software is produced abroad; the more famous open source software in China are fcitx;lumaqq;Lumaqq and scim.

However, just because the source code of the software is visible does not mean that the software is open source, and we have to follow the license of the software; for example, some software is visible in source code, but he agrees that users can only modify it according to his agreement; for example, the vbb forum program; so whether a software is open source software must have two conditions: one is that the source code is visible; the other is to have a loose license, such as GPL certificate, etc.

In the GNU Linux or BSD community, developers will provide us with source code packages as well as binary software packages

Second, what is the use of source code?

If a software has source code, anyone can see how it was developed, just like a bottle, such as what the mold made by the bottle is, what materials are needed, the specific use and the detailed instructions for the bottle, and so on. The open source of software is similar. When developers give us the software, they will also tell us how the software is developed; as long as our level is high enough and all the code is there, we can modify and customize the software to suit our needs; if Windows is open source and released as GPL, someone can still create a Windows distribution with more than N; unfortunately, Windows is not an open source system.

So the source code of the software is nothing more than the following two points

1. The software is customized according to the needs of users.

2. Secondary development; Note: the developer must license the secondary development according to the license agreement of the software.

Third, how to install the software packaged in the source package

1. The packaging format of the source package

The source code is generally packaged in file.tar.gz file.tar.bz2 or file.src.rpm; the unpacking commands in file.tar.gz and file.tar.bz2 formats are as follows

[root@localhost beinan] # tar jxvf file.tar.bz2

[root@localhost beinan] # tar zxvf file.tar.gz

For the use of file.src.rpm, see "introduction to how to use file.src.rpm"

2. How to compile and install the source package; (most)

1) unlock the package and view the help documentation

When we unpack a package and enter the unzipped package, we can usually find README (or reame) and INSTALL (or install); or doc (or DOC) directory; just look at the name and know something similar.

For example, we download a relatively new fcitx software package, such as fcitx-3.2-050827.tar.bz2.

When we unlock this package, we will find the following files

[root@localhost fcitx] # tar jxvf fcitx-3.2-050827.tar.bz2

[root@localhost fcitx] # cd fcitx

[root@localhost fcitx] # ls

Aclocal.m4 config.guess configure debian INSTALL Makefile.in src xpm

AUTHORS config.h.in configure.in depcomp install-sh missing THANKS

Autogen.sh config.rpath COPYING doc lib mkinstalldirs TODO

ChangeLog config.sub data fcitx.spec.in Makefile.am README tools

So we can look at the installation documentation of fcitx's INSTALL and doc directories; it all tells us how to install

Sometimes the installation documentation will have detailed instructions on the developer's home page, as well as the handling of common problems, such as LumaQQ

2) conditions for compiling and installing software

First of all, we have to install at least development tools in the Linux system, such as gcc; perl;python;glibc;gtk;make; automake and other development tools or basic packages; and also install some corresponding development packages, usually with file names including dev, such as kernel-devel; and some development libraries, such as those that begin with lib. If you are sometimes prompted to lack something when compiling software, the bigger ones are these development tools and libraries, etc.; just find out the installation from the CD; sometimes the CD is not provided, please use google to search for the corresponding software package, and sometimes you may use the package that the source package compilation and installation depends on.

Sometimes the dependent package is already installed in the system, but the system prompts me what to do if I can't find it. At this point, we just need to set the environment variable of PKG_CONFIG_PATH.

# export PKG_CONFIG_PATH=/usr/lib/pkgconfig

Or

# export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

And then we'll run the compiled. / configure; make; make install, try it.

Programs developed with tools developed by java use jre or jdk; jdk already includes jre, so if we just ask for an environment in which java programs run, we only need to install jre; install jre and configure the environment variables of java can be used. If it is a graphical interface program, a click of the mouse will OK.

Programs developed with perl require a perl environment, so you have to install the perl package, and so does python.

3) the method of compiling and installing software

Most of the software is packaged in tar.gz and tar.bz2, mostly installed through. / configure; make;make install; some software is directly make;make install

We can check the function of the configuration software through. / configure-- help; most software provides the function of. / configure configuration software; a few do not, if not, do not use. / configure; just make;make install it

. / configure one of the more important parameters is-- prefix, with the-- prefix parameter, we can specify the software installation directory; when we do not need this software, just delete the software directory

For example, we can specify that fcitx is installed in the / opt/fcitx directory

[root@localhost fcitx] #. / configure-prefix=/opt/fcitx

If we don't need fcitx, we can delete the / opt/fcitx directory directly.

So in this example, if fcitx is customized and installed into the / opt/fcitx directory, the complete installation method should be:

[root@localhost fcitx] # tar jxvf fcitx-3.2-050827.tar.bz2

[root@localhost fcitx] # cd fcitx

[root@localhost fcitx] #. / configure-prefix=/opt/fcitx

[root@localhost fcitx] # make

[root@localhost fcitx] # make install

Call fcitx, which should be

[beinan@localhost ~] # / opt/fcitx/bin/fcitx

If you want fcitx to call simply by executing fcitx, configure the environment variable, or make a link to fcitx in / usr/bin

[root@localhost beinan] # ln-s / opt/fcitx/bin/fcitx / usr/bin/fcitx

In general, it is said, but most software does not provide a method to uninstall the source package; we can find the installation point of the software to delete. It mainly depends on where you install it.

To set the environment variable PATH, see: "where are some common commands in Fedora Core?" The solution sets the PATH "

So your PATH can be set up like this

Export PATH= ".: / bin:/usr/bin:/usr/local/bin:/usr/sbin:/usr/X11R6/bin:/sbin:/opt/fcitx/bin"

Of course, this is just an example. Fcitx can run automatically on the desktop. Please see the installation instructions on the official http://www.fcitx.org site. For example, it is just for everyone to understand.

To give another example, for example, I want to install mlterm; and specify the installation directory as / opt/mlterm; http://mlterm.sourceforge.net

#. / configure-prefix=/opt/mlterm

# make

# make install

Specify that the software installed by the source package is installed in the / opt directory, so that you will not only know where the software is installed; it is also convenient to uninstall

3. Other types of software

1) installation of programs based on perl and python

In general, install with # perl file.pl; for example, install the Linux version of VMware

[root@localhost vmware-distrib] # perl vmware-install.pl

Based on python development, you also have to use python file.py to install

General software packages have README and INSTALL or DOC documentation, see the documentation to install

2) some installers are script calls; use # sh filename

For example, the installation of NVdia driver is like this.

[beinan@localhost] # sh NFORCE-Linux-x86-1. 0-0306-pkg1.run

Of course, it can also be installed through chmod 755 NFORCE-Linux-x86-1.0-0306-pkg1.run, and then. / NFORCE-Linux-x86-1.0-0306-pkg1.run

Some are based on file.bin files.

[beinan@localhost ~] # chmod 755 file.bin

[beinan@localhost ~] #. / file.bin

Probably so.

Postscript: the source code package and special format software installation is written so much, no matter how much is not finished. We mainly follow the installation documentation of the software; when installing the software, if it is a simple application, if you have a rpm package, use the rpm package as much as possible; it is mainly convenient and easy to manage

Appendix:

When installing software, it is best to use the system package management tools provided by their respective distributions. For Fedora/Redhat, you can refer to the following article

0) RPM basic "introduction and Application of RPM"

1) Fedora system management software package tool system-config-packages, it is convenient to add and remove software packages provided by the system installation disk. For more information, please see "Fedora package Manager system-config-packages".

2) Redhat system management software package tool, the new system should be redhat-config-packages, the usage is the same as "Fedora package manager system-config-packages"

3) tools for online installation, removal and upgrade of apt+synaptic software package; usage: "install or upgrade Fedora core 4.0software package online with apt+synaptic"

4) tools for online installation, upgrade and removal of yum software package; usage: "Fedora/Redhat online installation update package, yum article"

5) "introduction to the use of file.src.rpm"

6) "how to compile and install source package software"

At present, apt and yum are very mature. It is recommended that we use apt or yum to install the software. If we install the software package provided by the system disk, we can use system-config-packages or redhat-config-packages.

Thank you for your reading, the above is the content of "what is the difference between tar.gz and tar.bz2". After the study of this article, I believe you have a deeper understanding of the difference between tar.gz and tar.bz2, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report