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

Linux installation and management program

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Blog catalogue

1. RPM package management tools

II. Install, upgrade and uninstall RPM software

Third, the foundation of Linux application

IV. Source code compilation and installation

1. RPM package management tools

RPM Pachage Manager was proposed by Red Hat and adopted by many Linux distributions. The establishment of a unified database file, detailed recording of software package installation, uninstallation and other changes, can automatically analyze the package dependency. The general naming format of RPM software package is as follows:

1. Query the information of installed RPM software

The syntax format for querying the installed RPM package is as follows:

Application examples:

[root@centos01] # rpm-qa python2-pyasn1-modules-0.1.9-7.el7.noarchmesa-libEGL-17.0.1-6.20170307.el7.x86_64xcb-util-0.4.0-2.el7.x86_64python-pyblock-0.53-6.el7.x86_64sysstat-10.1.5-12.el7.x86_64sos-3.4-6.el7.centos.noarchxorg-x11-server-Xorg-1.19.3-11.el7.x86_ 64libiscsi-1.9.0-7.el7.x86_64sssd-ldap-1.15.2-50.el7.x86_64postfix-2.10.1-6.el7.x86_64. [root@centos01 ~] # rpm-Q bash bash-4.2.46-28.el7.x86_64 [root@centos01 ~] # rpm-qi bash Name: bashVersion: 4.2.46Release: 28.el7Architecture: x86_64Install Date: Wednesday, 23 October 2019, 22:29:35 Group: System Environment/ShellsSize: 3663637License: GPLv3+Signature: RSA/SHA256, Thursday, August 10, 2017, 23:03:40 Key ID 24c6a8a7f4a80eb5Source RPM: bash-4.2.46-28.el7.src.rpmBuild Date: Thursday, August 3, 2017 05:13:21 Build Host: c1bm.rdu2.centos.orgRelocations: (not relocatable) Packager: CentOS BuildSystem Vendor: CentOSURL: The GNU Bourne Again shellDescription: The GNU Bourne Again shell (Bash) is a shell or command languageinterpreter that is compatible with the Bourne shell (sh). Bashincorporates useful features from the Korn shell (ksh) and the C shell (csh). Most sh scripts can be run by bash without modification. [root@centos01 ~] # rpm-qa | grep bashbash-4.2.46-28.el7.x86_64bash-completion-2.1-6.el7.noarch [root@centos01 ~] # rpm-ql openssh/ etc/ssh/etc/ssh/moduli/usr/bin/ssh-keygen/usr/libexec/openssh/usr/libexec/openssh/ctr-cavstest/usr/libexec/openssh/ssh-keysign/usr/share/doc/openssh-7.4p1/usr/ Share/doc/openssh-7.4p1/CREDITS. 2. Query which RPM software the file or directory belongs to

The syntax format is as follows:

Application examples:

[root@centos01 ~] # rpm-qf / usr/bin/vim vim-enhanced-7.4.160-2.el7.x86_64 [root@centos01 ~] # rpm-qf / usr/libexec/openssh/ openssh-7.4p1-11.el7.x86_643, query uninstalled RPM package files

The syntax format for querying uninstalled RPM packages is as follows:

Application examples:

[root@centos01] # rpm-qpi / mnt/Packages/httpd-2.4.6-67.el7.centos.x86_64.rpm Name: httpdVersion: 2.4.6Release: 67.el7.centosArchitecture: x86_64Install Date: (not installed) Group: System Environment/DaemonsSize: 9823661License: ASL 2.0Signature: RSA/SHA256, Friday, August 11, 2017, 00:40:32 Key ID 24c6a8a7f4a80eb5Source RPM: httpd-2.4.6-67.el7.centos.src.rpmBuild Date: Friday, August 04, 2017, 11:21:07 Build Host: c1bm.rdu2.centos.orgRelocations: (not relocatable) Packager: CentOS BuildSystem Vendor: CentOSURL: http://httpd.apache.org/Summary: Apache HTTP ServerDescription: The Apache HTTP Server is a powerful, efficient And extensibleweb server. [root@centos01 ~] # rpm-qpl / mnt/Packages/httpd-2.4.6-67.el7.centos.x86_64.rpm / etc/httpd/etc/httpd/conf/etc/httpd/conf.d/etc/httpd/conf.d/README/etc/httpd/conf.d/autoindex.conf/etc/httpd/conf.d/userdir.conf/etc/httpd/conf.d/welcome.conf/etc/httpd/conf.modules.d/ Etc/httpd/conf.modules.d/00-base.conf/etc/httpd/conf.modules.d/00-dav.conf/etc/httpd/conf.modules.d/00-lua.conf/etc/httpd/conf.modules.d/00-mpm.conf/etc/httpd/conf.modules.d/00-proxy.conf/etc/httpd/conf.modules.d/00-systemd.conf/etc/httpd/conf.modules.d/01-cgi.conf/etc/httpd/conf/httpd. Conf/etc/httpd/conf/magic/etc/httpd/logs/etc/httpd/modules/etc/httpd/run. [root@centos01] # rpm-qpc / mnt/Packages/httpd-2.4.6-67.el7.centos.x86_64.rpm / etc/httpd/conf.d/autoindex.conf/etc/httpd/conf.d/userdir.conf/etc/httpd/conf.d/welcome.conf/etc/httpd/conf.modules.d/00-base.conf/etc/httpd/conf.modules.d/00-dav.conf/etc/httpd/conf.modules .d / 00-lua.conf/etc/httpd/conf.modules.d/00-mpm.conf/etc/httpd/conf.modules.d/00-proxy.conf/etc/httpd/conf.modules.d/00-systemd.conf/etc/httpd/conf.modules.d/01-cgi.conf/etc/httpd/conf/httpd.conf/etc/httpd/conf/magic/etc/logrotate.d/httpd/etc/sysconfig/htcacheclean/etc/sysconfig/httpd II. Install, upgrade, and uninstall RPM software

The syntax format and common options for installing, upgrading, and uninstalling RPM software are as follows:

1. Install RPM software [root@centos01 ~] # rpm-ivh / mnt/Packages/ntsysv-1.7.4-1.el7.x86_64.rpm warning: / mnt/Packages/ntsysv-1.7.4-1.el7.x86_64.rpm: header V3 RSA/SHA256 Signature Key ID f4a80eb5: NOKEY preparing... # # [100%] package ntsysv-1.7.4-1.el7.x86_64 has been installed

The "--force" option is added at the end to force the installation of the specified rpm package.

2. Upgrade RPM software [root@centos01 ~] # rpm-U / mnt/Packages/ntsysv-1.7.4-1.el7.x86_64.rpm warning: / mnt/Packages/ntsysv-1.7.4-1.el7.x86_64.rpm: header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY package ntsysv-1.7.4-1.el7.x86_64 has been installed 3, uninstall RPM software

The syntax format and auxiliary options for uninstalling the rpm package are as follows:

Application examples:

[root@centos01 ~] # rpm-e ntsysv [root@centos01 ~] # rpm-ivh / mnt/Packages/system-config-kickstart-2.9.6-1.el7.noarch.rpm-- nodeps warning: / mnt/Packages/system-config-kickstart-2.9.6-1.el7.noarch.rpm: header V3 RSA/SHA256 Signature Key ID f4a80eb5: NOKEY preparation. # # [100%] upgrading / installing... 1:system-config-kickstart-2.9.6-1.e## [100%] 4, Maintain RPM database [root@centos01 ~] # rpm-- initdb [root@centos01 ~] # rpm-rebuilddb5, Import and verify the public key [root@centos01 ~] # cd / mnt/ [root@centos01 mnt] # lsCentOS_BuildTag EULA images LiveOS repodata RPM-GPG-KEY-CentOS-Testing-7EFI GPL isolinux Packages RPM-GPG-KEY-CentOS-7 TRANS.TBL [root@centos01 mnt] # rpm-import. / RPM-GPG-KEY-CentOS-7 [root@centos01 ~] # rpm-ivh / mnt/Packages/dhcp-4.2. 5-58.el7.centos.x86_64.rpm preparation. # # [100%] upgrading / installing... 1:dhcp-12:4.2.5-58.el7.centos # # [100%] 6. Resolve package dependencies

III. Linux Application Foundation 1, the relationship between application and system commands 1) File location

System commands: generally in / bin and / sbin directories, or Shell internal instructions.

Applications: usually in the / usr/bin and / usr/sbin directories. 2) main uses

System commands: complete the basic management of the system, such as IP configuration tools.

Applications: perform other relatively independent auxiliary tasks, such as web browsers. 3) applicable environment

System commands: generally only run in the character operation interface.

Applications: according to the actual needs, some programs can be run in the graphical interface. 4) running format

System commands: generally include command words, command options and command parameters.

Applications: there is usually no fixed execution format. 2. Directory structure of typical applications

3. Common package encapsulation types

IV. Source code compilation and installation 1, source code compilation overview 1) advantages of using source code to install software

Get the latest software version, repair bug; in time, customize the software function flexibly according to the needs of users.

2) examples of application source code compilation and installation

Use when installing a newer version of the application; when the currently installed program cannot meet the needs; when you need to add new features to the application, and so on.

2. Compile and install source code package 1) Tarball package

.tar.gz and .tar.bz2 formats are in the majority. Software material reference: http://sourceforge.net

2) Integrity check

Calculate the MD5 checksum and compare it with the official value to determine whether it is consistent. As follows:

[root@centos01 ~] # md5sum / mnt/Packages/tomcat-7.0.76-2.el7.noarch.rpm3c901508f0651c5c3207f999fbf395ed / mnt/Packages/tomcat-7.0.76-2.el7.noarch.rpm3) confirm the source code compilation environment

You need to install a compiler that supports the Cmax Candle + programming language, as follows:

[root@centos01 ~] # rpm-qa | grep gcc libgcc-4.8.5-16.el7.x86_64gcc-c++-4.8.5-16.el7.x86_64gcc-4.8.5-16.el7.x86_64gcc-gfortran-4.8.5-16.el7.x86_64 [root@centos01 ~] # rpm-qa | grep make make-3.82-23.el7.x86_64automake-1.13.4-3.el7.noarch4, compilation and installation process

5. Compile and install step 1) unpack tar

It is customary to release the package to the / usr/src/ directory and unpack the source code file location / usr/src/ software name-version number /. Application examples:

[root@centos01 ~] # tar zxvf / mnt/httpd-2.2.17.tar.gz-C / usr/src/2). / configure configuration

Use the configure script in the source directory; execute ". / configure-- help" to see help; typical configuration option:-- prefix= software installation directory. Application examples:

[root@centos01 ~] # cd / usr/src/httpd-2.2.17/ [root@centos01 httpd-2.2.17] #. / configure-- prefix=/usr/local/httpd

If you do not specify any configuration options, the default value is used.

3) compile [root@centos01 httpd-2.2.17] # make 4) install [root@centos01 httpd-2.2.17] # make install

Note: compilation and installation can be executed together, and two commands can be executed at once by combining & &.

5) optimize the program directory [root@centos01 ~] # ln-s / usr/local/httpd/bin/* / usr/local/bin/6) to create system services Add execution permission [root@centos01 ~] # cp / usr/local/httpd/bin/apachectl / etc/init.d/httpd [root@centos01 ~] # chmod + x / etc/init.d/httpd7) modify system service [root@centos01 ~] # vim / etc/init.d/httpd #! / bin/sh#chkconfig:35 80 20.8) add as system service Set [root@centos01 ~] # chkconfig-- add httpd [root@centos01 ~] # chkconfig-- level 35 httpd on9) start apache service [root@centos01 ~] # systemctl start httpd10) listen on the port number of apache service [root@centos01 ~] # netstat-anptu | grep 80tcp6 0: 80: * LISTEN 53115/httpd

-this is the end of this article. Thank you for reading-

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