In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article focuses on "Linux source package compilation and installation methods", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn the "Linux source package compilation and installation method" bar!
The use of the source code 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.
LINUX is open source, look at how stubborn everyone is, ha ha, well, the following text begins, I sent it to bed!
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
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.
Set the environment variable PATH. I won't talk much nonsense about this. Everyone should know it.
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"
For 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
At this point, I believe that everyone on the "Linux source package compilation and installation method" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.