Any environment this blog.
Theme Linux package manager
A software management tool
1 2rpm compile and install the package management 3yum management
Two software compiler and run
Application binary interface 1ABI
ABI: Application Binary Interface Application Binary Interface program.
Well a binary program compiled to run on the operating system, it must comply with interface standards.
Not compatible with Windows and Linux. Because different format binaries.
ELF (Executable and Linkable Format) is the linux. PE (Portable Executable) is the windows.
Note that I am now using a graphical interface virtual machine
[root@centos71 ~]# ll total 8 -rw-------. 1 root root 1922 Jan 10 12:15 anaconda-ks.cfg drwxr-xr-x. 2 root root 6 Jan 10 14:19 Desktop drwxr-xr-x. 2 root root 6 Jan 10 14:19 Documents drwxr-xr-x. 2 root root 6 Jan 10 14:19 Downloads -rw-r--r--. 1 root root 1953 Jan 10 12:45 initial-setup-ks.cfg drwxr-xr-x. 2 root root 6 Jan 10 14:19 Music drwxr-xr-x. 2 root root 6 Jan 10 14:19 Pictures drwxr-xr-x. 2 root root 6 Jan 10 14:19 Public drwxr-xr-x. 2 root root 6 Jan 10 14:19 Templates drwxr-xr-x. 2 root root 6 Jan 10 14:19 Videos [root@centos71 ~]# ls anaconda-ks.cfg Desktop Documents Downloads initial-setup-ks.cfg Music Pictures Public Templates Videos
Linux binary interface application
ELF (Executable and Linkable Format) is a format for Linux
[root@centos71 ~]# file /bin/cat /bin/cat: ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=797f79d6d2dc5a84cdc3c21df400f65569ce9a92, stripped
Binary interface windows application
Copy windows inside ocam software on a virtual machine
If you want to run Linux programs inside windows or linux running windows programs in which you must use to virtualized.
Library-level virtualization: Linux: WINE, Windows: Cywin
[root@centos71 ~]# rz [root@centos71 ~]# ls anaconda-ks.cfg Desktop Documents Downloads initial-setup-ks.cfg Music oCam.exe Pictures Public Templates Videos [root@centos71 ~]# file *.exe oCam.exe: PE32 executable (GUI) Intel 80386, for MS Windows
2API:Application Programming Interface
Linux operating system in which programs are written in C language. Wrote the text to be parsed into binary to run on the operating system.
POSIX:Portable OS
Procedure of processing: source code -> Pretreatment -> Compiler -> Assembler -> Links
Static compiler: .a
Dynamic compilation: .so
As frequently used commands are actually binary program. According to the above process are generated.
[root@centos71 ~]# file /bin/ls /bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs),
for GNU/Linux 2.6.32, BuildID[sha1]=c5ad78cfc1de12b9bb6829207cececb990b3e987, stripped [root@centos71 ~]# file /bin/mv /bin/mv: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs),
for GNU/Linux 2.6.32, BuildID[sha1]=68e3aede2af1dadfbfddc9c44bb6b73e9f53dbfb, stripped [root@centos71 ~]# file /bin/rmdir /bin/rmdir: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs),
for GNU/Linux 2.6.32, BuildID[sha1]=1c559c20eca21dfc2ec31fffbdf6c5700b29911e, stripped
Three binary applications
Part 1 of the application binary
Part of the application binary: binary files, library files, configuration files, help files
Note that the library can not use the program will not run. Large-scale software have a special configuration file. Profile options equivalent function commands.
For example, there bash configuration files, which are home directory.
[root@centos71 ~]# ls -a . anaconda-ks.cfg .bash_logout .bashrc .config .dbus Documents .esd_auth
initial-setup-ks.cfg Music Pictures .tcshrc Videos .Xauthority .. .bash_history .bash_profile .cache .cshrc Desktop Downloads .ICEauthority .local
oCam.exe Public Templates .viminfo
Help file generally, even ls there.
In addition there are other documents, such as data files. Such as installing web server software, will provide web services to provide such documentation page. Log file records the occurrence of the event.
When installing software on Linux is the beginning of the source code to compile. c scripting language you want to use gcc tool compiled into binary to run.
In order to reduce the difficulty of ordinary users to use the software, the releases will release a package manager for software to manage, does not need to be compiled to run the software.
Just open the installation software has been installed on it to go on the windows. In Linux there is a unified file suffixes to organize the software.
2 binary program depends libraries
When the binary program running is to rely on some of the library
In normal use of the system libraries, the library will automatically load the file into memory.
ldd /PATH/TO/BINARY_FILE
[root@centos71 ~]# ldd /bin/cat linux-vdso.so.1 => (0x00007ffc7b2b6000) libc.so.6 => /lib64/libc.so.6 (0x00007f0a60de1000) /lib64/ld-linux-x86-64.so.2 (0x00007f0a611ae000) [root@centos71 ~]# ll /lib64/libc.so.6 lrwxrwxrwx. 1 root root 12 Jan 10 11:45 /lib64/libc.so.6 -> libc-2.17.so
3 View and manage the native load libraries
Note that this subdirectory for the next blog, received here.
ldconfig to load the library file
/ Sbin / ldconfig -p: display the machine has cached all the available library file name and file path mapping relationships
ldconfig -v to see all the library files are loaded into memory in use.
[root@centos71 ~]# ldconfig -v | wc ldconfig: Can't stat /libx32: No such file or directory ldconfig: Path `/usr/lib' given more than once ldconfig: Path `/usr/lib64' given more than once ldconfig: Can't stat /usr/libx32: No such file or directory 959 2867 41578 [root@centos71 ~]# ldconfig -v | head ldconfig: Can't stat /libx32: No such file or directory ldconfig: Path `/usr/lib' given more than once ldconfig: Path `/usr/lib64' given more than once ldconfig: Can't stat /usr/libx32: No such file or directory /usr/lib64/dyninst: libsymtabAPI.so.9.3 -> libsymtabAPI.so.9.3.1 libsymLite.so.9.3 -> libsymLite.so.9.3.1 libstackwalk.so.9.3 -> libstackwalk.so.9.3.1 libpcontrol.so.9.3 -> libpcontrol.so.9.3.1 libpatchAPI.so.9.3 -> libpatchAPI.so.9.3.1 libparseAPI.so.9.3 -> libparseAPI.so.9.3.1 libinstructionAPI.so.9.3 -> libinstructionAPI.so.9.3.1 libdyninstAPI_RT.so.9.3 -> libdyninstAPI_RT.so.9.3.1 libdyninstAPI.so.9.3 -> libdyninstAPI.so.9.3.1
Profile: /etc/ld.so.conf, /etc/ld.so.conf.d/*.conf
Cache files: /etc/ld.so.cache
If you do file a third-party modules, so that the file extension is. Let others use will be loaded into memory so that others call.
Configuration files can be written to a file /etc/ld.so.conf.d established following the end of the conf.
Reference can check which files have been there.
Under their own software, on the specified file path, then at the end of /etc/ld.so.conf.d build a conf file, in this document which is written on the path, the system can be found.
The library can be found is to generate a separate configuration file.
[root @ centos71 App] # cd /etc/ld.so.conf.d/ [root @ centos71 ld.so.conf.d] # LS dyninst-x86_64.conf Kernel-3.10.0-862.el7.x86_64. libiscsi-x86_64.conf MariaDB-conf x86_64.conf [root @ centos71 ld.so.conf.d] # CAT MariaDB-x86_64.conf written path. / usr / lib64 / MySQL [root @ centos71 ld.so.conf.d] # LS / usr / lib64 / MySQL show the path is actually displayed is the file libmysqlclient.so.18 libmysqlclient.so.18.0.0 plugin [root @ ld.so.conf.d centos71] # LL / usr / the lib64 / MySQL Total 3064. lrwxrwxrwx the root. 1 Jan 10 11:48 libmysqlclient.so.18 the root 24 -.> libmysqlclient.so.18.0.0 -rwxr-X-XR .. 1. 5-Aug 2017 the root libmysqlclient.so.18.0.0 the root 3135672 drwxr-XR-X. 2 Jan 10 11:48 the root 54 is the root plugin
Open the main configuration file, which is included below his profile.
[root@centos71 ld.so.conf.d]# cat /etc/ld.so.conf include ld.so.conf.d/*.conf [root@centos71 ld.so.conf.d]# cat /etc/ld.so.conf.d/* /usr/lib64/dyninst # Placeholder file, no vDSO hwcap entries used in this kernel. /usr/lib64/iscsi /usr/lib64/mysql
Four Package Manager
1 Package Type Manager
Function: constituent documents compiled application package or several packages a file, thus quickly and easily implement the installation package, uninstall, query, update and verify management operations
debian: deb file, dpkg package manager. redhat: rpm file, rpm package manager
rpm: This is an early name for Redhat Package Manager.
Which contains a lot of files, as long as we remember the command rpm to install software.
In addition to Red Hat, many other distributions support rpm suffix software.
Because many distributions are used, became the standard says that became RPM Package Manager.
Naming package 2
Source: name-VERSION.tar.gz | bz2 | xz
VERSION: major.minor.release
Use of the software package management rpm
rpm package named:
name-VERSION-release.arch.rpm
Example: the bash-4.2.46-19.el7.x86_64.rpm
VERSION: major.minor.release
Release: release.OS
Common Arch:
the x86: the i386, the i486 , i586, i686
x86_64: x64, x86_64, AMD64
PowerPC: ppc
with platform-independent: noarch
3 package sorting and unpacking
In many cases packets may be unpacked, which is split on the package. After so long as the use of packages installed on it, do not take up so much space.
There may be dependencies between packages, even circular dependencies. For example, to install the package A to B will be prompted to install the package.
Application-VERSION-ARCH.rpm: 主包
Application-devel-VERSION-ARCH.rpm child development package
Application-utils-VERSION-ARHC.rpm Other subpacket
Application-libs-VERSION-ARHC.rpm Other subpacket
4 resolve dependencies management tool
yum: rpm package manager of the tool. Once a packet dependency will be installed on the automatic dependent packages. This will solve the problem of circular dependencies.
apt-get: deb Package Manager tool bit
zypper: rpm front-end management tools on suse
dnf: Fedora 18+ rpm Package Manager front end management tool. The future may be used.