How to install the tar.gz package under Linux

Source: Internet
Author: User

How to install the tar.gz package under Linux

The source code packages tar.gz and tar.bz2 are mostly installed through./configure; Make; make install; some software directly make; make install;

We can use. /configure -- help to view the functions of the configuration software. Most of the software is provided. /configure configures the functions of the software; a few do not, if not, do not use. /configure; directly make; make install;

. One of the most important parameters of/configure is -- prefix. With the -- prefix parameter, we can specify the software installation directory. If we don't need this software, simply delete the Software Directory;

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

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

If you do not need fcitx, you can directly Delete the/opt/fcitx directory;

In this example, if fcitx is customized to 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

========================================================== ======================================

1. What is the source code package software;

As the name suggests, the source code package is a visible software package of the source code. The software based on Linux and BSD systems is the most common. The software visible from the source in China is almost extinct. Most open source software is made abroad; fcitx, lumaqq, lumaqq, and scim are well-known open-source software in China;

However, the visible source code of the software does not mean that the software is open-source. We must take the software license as the standard. For example, some software is visible in the source code, however, he agrees that the user can only modify the content as agreed; for example, the vBB Forum program; therefore, whether a software is an open-source software requires two conditions; the first is that the source code is visible; second, there should be loose licenses, such as GPL certificates;

In the GNU Linux or BSD community, developers also provide source code packages while releasing the binary software package;

Ii. What is the use of source code?

If a software has source code, anyone can see how it was developed, like a bottle, such as the mold made by the bottle; what materials are needed; specific Purposes and detailed instructions for bottles. The open source code of the 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, if all the code is there, we can modify and customize the software to suit our needs. If the windows open source code is released with GPL, someone can create more than N Windows releases. Unfortunately, windows is not an open-source system;

Therefore, the use of the source code of the software is nothing more than the following two points;

1. The software is customized according to the user's needs;
2. Secondary Development; Note: developers must permit Secondary Development Based on the software license agreement;

3. How to install software packaged in the source code package;

1. packaging format of the source code package;

The source code is generally packaged in file.tar.gz file.tar.bz2 or file. SRC. rpm in the format of file.tar.gzand file.tar.bz2. The command is as follows;
[Root @ localhost beinan] # tar jxvf file.tar.bz2
[Root @ localhost beinan] # tar zxvf file.tar.gz

For the usage of file. SRC. rpm, see: Introduction to file. SRC. RPM usage

2. How to compile and install the source code package (MOST)

1) Unpack the software package and view the help document;

After unzipping a package, we can usually find the README (or reame) and install (or install); or DOC (or Doc) directories. The names are similar;

For example, we download a newer fcitx package, for example, a fcitx-3.2-050827.tar.bz2.

We will find the following files when uninstalling this software package;

[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 see the install and Doc directories of fcitx. They all tell us how to install them;

Sometimes the installation documents will be detailed on the developer's home page and troubleshooting of common problems, such as lumaqq.

2) Conditions for compiling and installing software;

First, we must install at least the development tools in Linux, such as GCC, Perl, Python, glibc, GTK, make, automake, and other development tools or basic packages; you also need to install some corresponding development packages, which are generally named Dev, such as kernel-devel, and some development libraries, such as those starting with Lib. If you compile the software, sometimes there are prompts about something missing, such as the development tools and libraries. Find and install the tools from the CD; sometimes the CD is not provided. Search for the corresponding software package by Google, sometimes the source code package may be used to compile and install the dependent package;

Sometimes the dependent package has already been installed in the system, but the system prompts that it cannot be found. What should I do? In this case, we need to set the environment variable pkg_config_path;

# Export pkg_config_path =/usr/lib/pkgconfig
Or
# Export pkg_config_path =/usr/local/lib/pkgconfig
Then let's run the compiled./configure; Make; make install, and try it;

For programs developed using Java tools, JRE or JDK is required. JDK already includes JRE. If we only require an environment where Java programs are running, you only need to install JRE. After JRE is installed, you can configure the Java environment variables. If it is a graphic interface program, click the mouse to OK;

Programs developed using Perl require the Perl environment. Therefore, you must install the Perl package. The same applies to Python;

3) Compile and install software;

The software package with tar.gz and tar.bz2 is mostly installed through./configure; Make; make install; some software is directly make; make install;

We can use. /configure -- help to view the functions of the configuration software. Most of the software is provided. /configure configures the functions of the software; a few do not, if not, do not use. /configure; directly make; make install;

. One of the most important parameters of/configure is -- prefix. With the -- prefix parameter, we can specify the software installation directory. If we don't need this software, simply delete the Software Directory;

For example, you can specify that fcitx is installed in the/opt/fcitx directory;
[Root @ localhost fcitx] #./configure -- prefix =/opt/fcitx

If you do not need fcitx, you can directly Delete the/opt/fcitx directory;

In this example, if fcitx is customized to 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 be called as long as fcitx is executed, configure the environment variable or create a fcitx link in/usr/bin;
[Root @ localhost beinan] # ln-S/opt/fcitx/bin/fcitx/usr/bin/fcitx

In general, most software does not provide the method of uninstalling the source code package. We can find the Software Installation Point to delete it. It mainly depends on where you installed it.

For how to set the environment variable path, see: In Fedora Core, why are some common commands unavailable? Solution: set path

Therefore, you can set the path as this;
Export Path = ". :/bin:/usr/local/bin:/usr/sbin:/usr/x11r6/bin:/sbin:/opt/fcitx/bin"

Of course, this is just an example. fcitx can automatically run on the desktop. See Http://www.fcitx.org/ The installation instructions on the official website; for example, it is just a bit easier to understand;

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

Install the software installed in the source code package in the/OPT directory, so that you do not 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;

Generally, use # perl file. pl for installation, such as the installation of VMware's Linux version;
[Root @ localhost vmware-distrib] # Perl vmware-install.pl.

Python file. py is also used for installation.

The general software packages include README, install, and Doc. For more information, see the installation documentation;

2) some installation programs are called in script mode; Use # sh file name

For example, the installation of the nvdia driver is like this;
[Beinan @ localhost ~] # Sh NFORCE-Linux-x86-1.0-0306-pkg1.run

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

Some are file. Bin files.
[Beinan @ localhost ~] # Chmod 755 file. Bin
[Beinan @ localhost ~] #./File. Bin

That's big enough ........

Note: The installation of the source code package and software in special formats is so much that it cannot be completed. We mainly refer to the software installation documents. When installing the software, if it is only a simple application, if there is an RPM package, try to use the RPM package; it is mainly convenient and easy to manage;

Appendix:

When installing software, it is best to use the system software package management tools provided by the respective releases. For fedora/RedHat, refer to the following articles;

0) rpm basics: introduction and application of RPM

1) fedora system management software package Tool System-config-packages to conveniently add and remove the software packages provided by the system installation disk. For details, see fedora Software Package Manager System-config-packages.

2) RedHat system management software package tool. The new system should be RedHat-config-packages, which is used in the same way as fedora Software Package Manager System-config-packages;

3) Online installation, removal, and upgrade of apt + synaptic software package. Usage: install or upgrade Fedora Core 4.0 software package online with apt + synaptic
4) install, upgrade, and remove Yum software package online. Usage: fedora/RedHat online installation and update software package, yum

5) Introduction to file. SRC. rpm

6) how to compile and install the source code package software

At present, apt and Yum are very mature. We recommend that you use apt or yum when installing the software. If you install the software package provided by the system disk, you can use system-config-packages or RedHat-config-packages.

Http://forum.ubuntu.org.cn/viewtopic.php? F = 50 & t = 156932

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.