Fully describe the installation and application of the Linux source code package

Source: Internet
Author: User

Before giving you a detailed introduction to the Linux source code package, first let everyone know about the source code package software, and then give a comprehensive introduction to the Linux source code package, hoping to be useful to everyone. As the name suggests, the Linux source code package is a visible software package of source code. Software Based on Linux and BSD systems is the most common. Software visible in domestic sources is almost extinct. Most open-source software is made abroad; fcitx, lumaqq, Lumaqq, and scim are well-known open-source software in China;

What is the Linux source code package?

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 release the binary software package while, we will also provide source code packages;

What is the use of Linux 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;

How to install software packaged with the Linux source code package;

1. packaging format of Linux 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 Linux 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 directory and INSTALL (or install); or doc or DOC directory. We can see that the name is almost the same;
For example, we download a relatively new fcitx software 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 directory installation documents of fcitx. They all tell us how to INSTALL them. Sometimes the installation documents will be detailed on the developer's homepage, 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 Linux 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 the package 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, and then we will run the compiled./configure; make install. 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 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 for uninstalling the Linux source code package. We can find the Installation Point to delete the software. 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 be automatically run on the desktop, please refer to the installation instructions on the http://www.fcitx.org official site; for example, just let you understand a little better; 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
Install the software installed in the Linux 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 Based on python development, also use python file. py to INSTALL General software packages have README and INSTALL or DOC documentation, see the document installation;

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 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

Note: The installation of the Linux 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 Linux 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.

  1. Allows you to use the Linux operating system to accelerate remote logon.
  2. Easily solve grub errors in Linux
  3. A Brief Introduction to Linux rescue
  4. Slab allocator in Linux
  5. Description of tr commands in Linux

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.