Linux notes: linux software package management, linux software package
Introduction to linux software package
Software Package category:
1. source code package (source code written in C language is not compiled ):
Script installation package (source package with optimized installation)
Advantages:
Open-source, changeable
You can select the required functions as needed.
Compilation and installation, more suitable for your system, stable and efficient
Easier to uninstall (directly Delete the installation directory without any junk files)
Disadvantages:
Installation is complex and slow.
2. Binary Package (Compiled binary machine language pack ):
RPM package (the Binary Package in centos is an RPM package, which is the default package)
Advantages:
The package management system is simple. Only a few commands can be used to install, upgrade, query, and uninstall packages;
Fast installation.
Disadvantages:
Source code is no longer visible;
The software package has serious dependence.
----------
RPM package management-RPM command Management
General naming rules for the full name of an RPM package:
Software Package name-software version-number of software releases. Suitable linux platform. Suitable hardware platform. rpm
RPM package dependency:
Installing an rpm package depends on another rpm package
Library File dependency:
Installing an rpm package depends on the files in another package.
Library File dependent query Website:
Www.rpmfind.net
RPM installation:
Full rpm-ivh package name
Option:
-I Installation
-V: Show Details
-H: display progress
-- Nodeps does not detect Dependencies
RPM package upgrade:
Full name of rpm-Uvh package
Option:
-U upgrade
RPM package uninstall:
Rpm-e package name
Option:
-E uninstall
-- Nodeps does not check Dependencies
Query the RPM package:
1. Check whether the installation is successful:
Rpm-q package name
Rpm-qa query all installed rpm packages
2. query the software package details:
Rpm-qi package name
Option:
-I: Query Information about the installed packages.
Rpm-qip package full name
Option:
-P: Query uninstalled package information
3. query the file installation location in the package:
Rpm-ql package name
Option:
-L file installation location list
-P: Query uninstalled package information
4. query which rpm package the file belongs
Rpm-qf System File Name
5. query the dependency of the software package:
Rpm-qR package name
Option:
-P: query the dependency information of the uninstalled package (full package name is required)
Rpm package Verification
Rpm-V package name
Purpose: Check whether the files in the package are modified.
File extraction in rpm package
Full name of rpm2cpio package | absolute path of cpio-idv File
Main Purpose: Restore objects accidentally deleted by mistake
----------
RPM package management-yum online management
Yum online management automatically solves the rpm package dependency problem.
IP Address Configuration:
Intranet access only requires ip addresses and subnet masks. If you want to access the Internet, you also need a gateway and dns.
Configuration steps:
1. Use the setup tool: setup
2. modify the configuration file:/etc/sysconfig/network-scripts/ifcfg-eth0, change ONBOOT to "yes", start the NIC
3. restart the network service: service network restart
Network yum Source:
Default yum source profile:/etc/yum. repos. d/CentOS-Base.repo
Other yum sources are also in the current directory.
Yum command:
Query:
Yum list # query the list of all available software packages
Yum search keywords # search for packages related to keywords
Installation:
Yum-y install package name
Option:
-Y automatically answers yes
Upgrade:
Yum-y update package name
Uninstall:
Yum-y remove package name # The packages on which the unmounted package depends will also be uninstalled, so uninstalling with yum may cause serious problems.
Use a CD as the yum Source:
1. Attach a cd
2. invalidate all network yum sources, and add the file names of all yum sources with the suffix. bak, making the system unable to recognize the repo file names.
3. Modify the yum source to make the address correct and take effect.
----------
Source code package management
Differences between the source package and rpm package:
Differences before installation: Conceptual differences
Differences after installation: the installation location is different.
1. Install the rpm package in the default location:
/Etc/Configuration File Installation Directory
/Usr/bin/executable command installation directory
/Usr/lib/library function used by the program storage location
/Usr/share/doc/manual
/Usr/share/man/Help File
2. Install the source code package in a manually specified location, which is generally:
/Usr/local/software name/
Impact of different installation locations:
You can use the system service management command to manage the services installed in the rpm package:
/Etc/rc. d/init. d/xxx start is also used
Service xxx start
Services Installed in source code packages cannot be managed by service management commands because they are not installed in the default path. Therefore, you can only use absolute paths for service management.
Source code package installation process:
1. Installation preparation:
Install C language compiler gcc
Download source code package
2. Installation notes:
Source code storage location:/usr/local/src/
Software installation path:/usr/local/
3. Install the source code package
Download source code package
Decompress the downloaded source code package
Enter the extract directory
4../configure preparation before Compilation:
./Configure -- prefix = installation directory
5. make compilation (from source code to binary code)
6. make install compilation and Installation