linux system administration - Chapter Linux Software Installation

                                       linux system administration

                             Chapter Linux Software Installation

Outline

In the Linux platform, the type of package can be divided into two categories: source packages, binary packages.

Source package: the software's source code (generally called Tarball, the upcoming software source code packages to tar and then compressed Resource Kit).

Binary packages: If the Red Hat distribution of .rpm packages, Debian release .deb package.

The main steps of the installation source package

4.1 RPM Software Management

RPM packages, also known as the system default package, binary package. RPM is the Redhat Package Manager, is developed by Red Hat package management program.

 

4.1.1 RPM Package Naming

RPM system CD

libmicrohttpd-0.9.33-2.el7.i686.rpm

libmicrohttpd-0.9.33-2.el7.x86_64.rpm

1, i386, i586, i686 and noarch
i386-almost all of the X86 platform, whether it is old or new pentum pentum-IV system and K7 CPU, can work normally, i refers to the Intel-compatible CPU, as for 386 is the level of the CPU.
i586- level is 586 computer, including pentum first generation MMX CPU, AMD's K5, K6 system CPU (socket7 pins), etc., are the CPU level.
i686-pentum 2 after Intel CPU and system level after K7 CPU 686 belong to this level.
Noarch- representatives nothing to do with the hardware architecture. Whether x86, PowerPC, Sparc or Alpha systems.


x86: 32-bit Intel processors in general
x86_64: 64-bit Intel processors in general

 

4.1.2 RPM dependency

Dependency tree a-> b-> c

Since the annular a-> b-> c-> a

Module dependencies (libraries dependent), check website: www.rpmfind.net

 

Library dependent (dependent files)

[root@Redhat7 Packages]# rpm -ivh mysql-connector-odbc-5.2.5-6.el7.x86_64.rpm

Warning: mysql-connector-odbc-5.2.5-6.el7.x86_64.rpm: header V3 RSA / SHA256 Signature, Key ID fd431d51: NOKEY

Error: Failed dependent detection:

        libodbc.so.2 () (64bit) needed mysql-connector-odbc-5.2.5-6.el7.x86_64

        libodbcinst.so.2 () (64bit) needed mysql-connector-odbc-5.2.5-6.el7.x86_64

 

[Root @ Redhat7 Packages] # rpm -ivh libodbc.so.2 (without this package)

By www.rpmfind.net inquiry

 

4.1.3 RPM software installation

 

   Package Full name: install, upgrade, the package name: Query, Uninstall.

   rpm –ivh

   i install installation

   v verbose Show Details

   h hash show progress

   --nodeps dependency is not detected (with caution)

 

[root@Redhat7 Packages]# rpm -ivh http

httpcomponents-client-4.2.5-5.el7_0.noarch.rpm

httpcomponents-core-4.2.4-6.el7.noarch.rpm

httpd-2.4.6-40.el7.x86_64.rpm (main bag)

httpd-devel-2.4.6-40.el7.x86_64.rpm

httpd-manual-2.4.6-40.el7.noarch.rpm

httpd-tools-2.4.6-40.el7.x86_64.rpm

 

Wrong dependence

[root@Redhat7 Packages]# rpm -ivh httpd-2.4.6-40.el7.x86_64.rpm

Warning: httpd-2.4.6-40.el7.x86_64.rpm: header V3 RSA / SHA256 Signature, Key ID fd431d51: NOKEY

Error: Failed dependent detection:

        /etc/mime.types needed httpd-2.4.6-40.el7.x86_64

        httpd-tools = 2.4.6-40.el7 needed httpd-2.4.6-40.el7.x86_64

        libapr-1.so.0 () (64bit) needed httpd-2.4.6-40.el7.x86_64

        libaprutil-1.so.0 () (64bit) is required httpd-2.4.6-40.el7.x86_64

 

[root@Redhat7 Packages]# rpm -ivh httpd-tools-2.4.6-40.el7.x86_64.rpm

Warning: httpd-tools-2.4.6-40.el7.x86_64.rpm: header V3 RSA / SHA256 Signature, Key ID fd431d51: NOKEY

Error: Failed dependent detection:

        libapr-1.so.0 () (64bit) is httpd-tools-2.4.6-40.el7.x86_64 required (dependent libraries)

        libaprutil-1.so.0 () (64bit) is httpd-tools-2.4.6-40.el7.x86_64 required (dependent libraries) through the website to find

 

[root@Redhat7 Packages]# rpm -ivh apr-1.4.8-3.el7.x86_64.rpm

Warning: apr-1.4.8-3.el7.x86_64.rpm: header V3 RSA / SHA256 Signature, Key ID fd431d51: NOKEY

Preparation ... ################################# [100%]

We are upgrading / installing ...

   1: apr-1.4.8-3.el7 ################################# [100%]

[root@Redhat7 Packages]# rpm -ivh apr-util-1.5.2-6.el7.x86_64.rpm

Warning: apr-util-1.5.2-6.el7.x86_64.rpm: header V3 RSA / SHA256 Signature, Key ID fd431d51: NOKEY

Preparation ... ################################# [100%]

We are upgrading / installing ...

   1: Apr-out-1.5.2-6.el7 ################################# [100%]

 

[root@Redhat7 Packages]# rpm -ivh httpd-tools-2.4.6-40.el7.x86_64.rpm     

Warning: httpd-tools-2.4.6-40.el7.x86_64.rpm: header V3 RSA / SHA256 Signature, Key ID fd431d51: NOKEY

Preparation ... ################################# [100%]

We are upgrading / installing ...

   1:httpd-tools-2.4.6-40.el7         ################################# [100%]

 

[root@Redhat7 Packages]# rpm -ivh httpd-2.4.6-40.el7.x86_64.rpm               

Warning: httpd-2.4.6-40.el7.x86_64.rpm: header V3 RSA / SHA256 Signature, Key ID fd431d51: NOKEY

Error: Failed dependent detection:

        /etc/mime.types needed httpd-2.4.6-40.el7.x86_64

 

[root@Redhat7 Packages]# rpm -ivh mailcap-2.1.41-2.el7.noarch.rpm

Warning: mailcap-2.1.41-2.el7.noarch.rpm: header V3 RSA / SHA256 Signature, Key ID fd431d51: NOKEY

Preparation ... ################################# [100%]

We are upgrading / installing ...

   1:mailcap-2.1.41-2.el7             ################################# [100%]

 

[root@Redhat7 Packages]# rpm -ivh httpd-2.4.6-40.el7.x86_64.rpm  

Warning: httpd-2.4.6-40.el7.x86_64.rpm: header V3 RSA / SHA256 Signature, Key ID fd431d51: NOKEY

Preparation ... ################################# [100%]

We are upgrading / installing ...

   1:httpd-2.4.6-40.el7               ################################# [100%]

Summary Using rpm too humane.

 

[root@Redhat7 Packages]# rpm -ivh httpd-

httpd-2.4.6-40.el7.x86_64.rpm (installation)     

httpd-manual-2.4.6-40.el7.noarch.rpm (installation) 

httpd-devel-2.4.6-40.el7.x86_64.rpm  

httpd-tools-2.4.6-40.el7.x86_64.rpm (installation) 

rpm installation is to resolve dependencies, unlimited installation

4.1.4 RPM software upgrade and uninstall

Rpm -Uvh package full name

-U upgrade upgrade

rpm -evh Registration

-e (erase) Oroshi载

v verbose Show Details

    h hash show progress

 

--nodeps not check dependencies

 

[root@Redhat7 Packages]# rpm -evh  httpd-tools

Error: Failed dependent detection:

        httpd-tools = 2.4.6-40.el7 is (installed) httpd-2.4.6-40.el7.x86_64 need

 

[root@Redhat7 Packages]# rpm -evh  httpd-manual                        

Preparation ... ################################# [100%]

We are cleaning / delete ...

   1:httpd-manual-2.4.6-40.el7        ################################# [100%]

Forced Uninstall (with caution)

[root@Redhat7 Packages]# rpm -evh --nodeps  httpd-tools

Preparation ... ################################# [100%]

We are cleaning / delete ...

   1:httpd-tools-2.4.6-40.el7         ################################# [100%]

4.1.5 RPM package query

rpm -q package name query package is installed

rpm -qa Query all installed packages

rpm -i query software information

-l: List all the packages in the directory list of files and installed software (list)

-f: Query files belonging to the package

-R: Query package dependencies package

 

Common Queries

[root@Redhat7 ~]# rpm -q nautilus

nautilus-3.14.3-7.el7.x86_64

The more common way

[root@Redhat7 ~]#  rpm -qia | grep httpd

Name        : httpd

Source RPM  : httpd-2.4.6-40.el7.src.rpm

URL         : http://httpd.apache.org/

 

[root@Redhat7 ~]#  rpm -qa | grep httpd

httpd-2.4.6-40.el7.x86_64

 

Queries httpd package installation location, and software information

[root@Redhat7 ~]#  rpm -qilla | grep httpd

/usr/share/setroubleshoot/plugins/httpd_can_sendmail.py

/usr/share/setroubleshoot/plugins/httpd_can_sendmail.pyc

/usr/share/setroubleshoot/plugins/httpd_can_sendmail.pyo

/usr/share/setroubleshoot/plugins/httpd_write_content.py

/usr/share/setroubleshoot/plugins/httpd_write_content.pyc

/usr/share/setroubleshoot/plugins/httpd_write_content.pyo

Name        : httpd

Source RPM  : httpd-2.4.6-40.el7.src.rpm

URL         : http://httpd.apache.org/

/etc/httpd

/etc/httpd/conf

/etc/httpd/conf.d

/etc/httpd/conf.d/README

 

Query files belonging to the package, and display software information

[root@Redhat7 ~]#  rpm -qif /usr/share/httpd/icons/small/burst.gif

Name        : httpd

Version     : 2.4.6

Release     : 40.el7

Architecture: x86_64

Install Date: 2019 Nian 07 Tuesday, 30 October 00 08 minutes 10 seconds

Group       : System Environment/Daemons

Size        : 3876648

License     : ASL 2.0

Signature: RSA / SHA256, 2015 Nian 09 Wednesday, May 30 21:29:50, Key ID 199e2f91fd431d51

Source RPM  : httpd-2.4.6-40.el7.src.rpm

Build Date: 2015 Nian 09 Thursday, May 17 21:08:35

Build Host  : x86-024.build.eng.bos.redhat.com

Relocations : (not relocatable)

Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>

Vendor      : Red Hat, Inc.

URL         : http://httpd.apache.org/

Summary     : Apache HTTP Server

Description :

The Apache HTTP Server is a powerful, efficient, and extensibl

Query httpd dependent packages

[root@Redhat7 ~]#  rpm -qR httpd

/etc/mime.types

system-logos >= 7.92.1-1

httpd-tools = 2.4.6-40.el7

4.2 yum rpm dependency perfect solution

yum (called the Yellow dog Updater, Modified) is a front end package manager Shell Fedora and RedHat and SUSE in. Based on RPM packages can be automatically downloaded from the server specified RPM package and install, can be handled automatically dependencies and install all of the software packages depend, again without cumbersome download, install. yum provides search, install, remove one, or all of a set of packages command, and command concise and easy to remember.

What is yum yum = Yellow dog Updater, Modified.
The main function is more convenient to add / delete / update the RPM package ..
It can automatically resolve problems dependent package ..
It easy to manage a large number of issues to update the system.

yum command form is generally as follows: yum [options] [command] [package ...]
where [options] are optional, options -h (help), - y (the installation process when prompted to select all " yes "), - q (not show the installation process) and the like.

[Command] to the operation to be performed, [package ...] is the operation of the object.

 

4.2.1 Set the local yum source

[Yum source is provided as a local mirror]

1、mkdir /mnt/cdrom

2 mount / dev / cdrom / mnt / cdrom # hanging mirror, an optical disk

3  mkdir  /redhatiso

4 cp -Rf / mnt / cdrom / * / redhatiso # copy the contents of the CD to the next within a path

5 vi /etc/yum.repos.d/rhel-debuginfo.repo # edit repo file

Add about content:

[iso7.2]

name=iso7.2

baseurl = file: /// redhatiso

enable=1

gpgcheck=0

4.2.2 yum commonly used commands

1. List all the updated software inventory command: yum check-update

2. Update all software command: yum update

3. Install only the specified software command: yum install <package_name>

4. Only the specified software update command: yum update <package_name>

5. List all the installed software inventory command: yum list

6. Remove the package commands: yum remove <package_name>

7. Find the package command: yum search <keyword>

8. Clear the cache commands:

yum clean packages: Clear package under the cache directory

yum clean headers: Clear headers in the cache directory

yum clean oldheaders: Clear the cache directory under the old headers

yum clean, yum clean all (= yum clean packages; yum clean oldheaders): purge packages and old headers in the cache directory

 

4.2.3 yum query and display

Info Display information

[root@Redhat7 ~]# yum info httpd.x86_64

Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast

Installed packages

Name: httpd

Architecture: x86_64

Version: 2.4.6

Published: 40.el7

Size: 3.7 M

Source: installed

Description: Apache HTTP Server

URL: http: //httpd.apache.org/

Protocol: ASL 2.0

描述    : The Apache HTTP Server is a powerful, efficient, and extensible

         : web server.

List all installed and can install the package

yum list shows all installed and the package can be installed
yum list package1 specified display package installation package1

Find the beginning of the http package

[root@Redhat7 ~]# yum list | grep http

search search for matching specific character of the rpm package

On search keyword search server and all related packages

# Yum search perl // package name, package description, etc. Search

 

4.2.4 yum install rpm

Yum -y install the package name

- install installation

-y auto-reply yes

Automatic installation package that contains the name of pam

[root@Redhat7 ~]# yum install *pam* -y

4.2.5 yum update update rpm package

yum update all the updates
yum update package1 update the specified packages package1

 

[root@Redhat7 ~]# yum update gcc –y

4.2.6 yum remove deleted package

Try not to unload in the server, the first stable

yum remove pam-devel

yum remove pam-devel -y automatically deleted

 

 

4.3 linux source code management software

 

The difference between 4.3.1 source package with RPM packages

 

 

 

4.3.2 Source Package Installation

 

 

How to determine the error

Installation process stops, and the emergence of error, waring, or no tips

Example 1 Source Package Installation - determining the mounting position

[Root @ Redhat7 and software] # mkdir / or software

[Root @ Redhat7 en-software] # Level -zvxf rlwrap-0k37ktrkgsh

2 enter decompression directory

Unzip into the directory

[root@Redhat7 en-software]# cd rlwrap-0.37/

3 ./config software configuration and inspection

It source is provided to accommodate a variety of different operating system platforms, and generates the makefile Depending on the system, the Makefile specifies what to compiler information for parameters. So you can make your source code can be compiled on different operating system platforms. For example, it will detect that you are not a CC or GCC.

[root@Redhat7 rlwrap-0.37]# ./configure –prefix=/en-software/ rlwrap

 

 

configure: error:

You need the GNU readline library(ftp://ftp.gnu.org/gnu/readline/ ) to build

this program!

 

Install readline

[root@Redhat7 rlwrap-0.37]# yum install *readline* -y

 

success

configure: creating ./config.status

config.status: creating Makefile

config.status: creating filters/Makefile

config.status: creating doc/Makefile

config.status: creating src/Makefile

config.status: creating doc/rlwrap.man

config.status: creating config.h

config.status: executing depfiles commands

 

Now do:

    make (or gmake)  to build rlwrap

    make check       for instructions how to test it

    make install     to install it

 

You can also specify the installation location ( be sure to specify the installation location )

 

./configure –prefix=/en-software/ rlwrap

4 make

Execution make is to compile the source code into a file that can execute, but not installed.

 

5 make install

The final step in the installation file

Successful installation

[root@Redhat7 en-software]# rlwrap

 

Installation of the documentation in the unzipped directory capitalized INSTALL

 

[root@Redhat7 rlwrap-0.37]# cat  INSTALL

PREREQUISITES

 

To build rlwrap, you'll need an ANSI C compiler (gcc will certainly

do) and GNU readline 4.2 or later. rlwrap should compile on most

unices and unix-like environments like linux, the BSDs, OS/X, solaris,

HP/UX, QNX, AIX and cygwin (special thanks to PolarHome for their

"dinosaur zoo" of ageing Unix systems!)

 

INSTALLATION

 

./configure

make

make install

4.3.3 Source Pack Uninstall

make unistall: uninstall program has been installed.
make clean: delete the files generated by the make command

The final step of deleting the source package folders

4.4 SH script installation

 

Published 37 original articles · won praise 0 · Views 2410

Guess you like

Origin blog.csdn.net/syjhct/article/details/100164476