Linux package Management (2)
Centos:yum, DNF
url:ftp://172.16.0.1/pub/
Yum:yellow Dog, Yellowdog Update Modifier
Yum Repository:yum Repo
Stores a number of RPM packages, as well as the relevant metadata files for packages (placed in a specific directory: Repodata);
File server:
ftp://
/HTTP
nfs://
file:///
Yum Client:
Configuration file:
/ETC/YUM.CONF: Providing public configuration for all warehouses
/etc/yum.repos.d/*.repo: Provides configuration for the point of the warehouse
Warehouse-Directed Definition: (cannot have spaces around the equals sign)
[Repositoryid]
Name=some name for this repository
baseurl=url://path/to/repository/
Enabled={1|0}
Gpgcheck={1|0}
Gpgkey=url
Enablegroups={1|0}
Failovermethod={roundrobin|priority}
The default is: Roundrobin, meaning random selection;
cost=
Default is 1000
The Yum source in the classroom: http://172.16.0.1/cobbler/ks_mirror/CentOS-6.6-x86_64/
CentOS 6.6 x84_64 epel:http://172.16.0.1/fedora-epel/6/x86_64/
Usage of the Yum command:
Yum [options] [command] [package ...]
command is one of:
* Install Package1 [Package2] [...]
* Update [PACKAGE1] [Package2] [...]
* Update-to [Package1] [Package2] [...]
* Check-update
* upgrade [Package1] [Package2] [...]
* Upgrade-to [Package1] [Package2] [...]
* Distribution-synchronization [Package1] [Package2] [...]
* Remove | Erase Package1 [Package2] [...]
* List [...]
* Info [...]
* provides | Whatprovides Feature1 [Feature2] [...]
* Clean [Packages | metadata | expire-cache | rpmdb | plugins | all]
* Makecache
* Groupinstall group1 [group2] [...]
* Groupupdate group1 [group2] [...]
* grouplist [hidden] [Groupwildcard] [...]
* Groupremove group1 [group2] [...]
* GroupInfo group1 [...]
* Search string1 [string2] [...]
* Shell [filename]
* RESOLVEDEP DEP1 [DEP2] [...]
* Localinstall Rpmfile1 [rpmfile2] [...]
(Maintained for legacy reasons Only-use install)
* Localupdate Rpmfile1 [rpmfile2] [...]
(Maintained for legacy reasons Only-use Update)
* Reinstall Package1 [Package2] [...]
* Downgrade Package1 [Package2] [...]
* Deplist Package1 [Package2] [...]
* Repolist [all|enabled|disabled]
* Version [all | installed | available | group-* | nogroups* | grouplist | groupinfo]
* History [Info|list|packages-list|packages-info|summary|addon-info|redo|undo|rollback|new|sync|stats]
* Check
* Help [command]
Show Warehouse list:
Repolist [all|enabled|disabled]
Show Packages:
List
# yum list [all | glob_exp1] [GLOB_EXP2] [...]
# Yum list {available|installed|updates} [GLOB_EXP1] [...]
To install the package:
Install Package1 [Package2] [...]
Reinstall Package1 [Package2] [...] (reinstall)
Upgrade Package:
Update [PACKAGE1] [Package2] [...]
Downgrade Package1 [Package2] [...] Downgrade
Check for available upgrades:
Check-update
To uninstall a package:
Remove | Erase Package1 [Package2] [...]
To view the package information:
info [...]
View which package is provided by the specified attribute (which can be a file):
provides | Whatprovides Feature1 [Feature2] [...]
To clean up the local cache:
Clean [Packages | metadata | expire-cache | rpmdb | plugins | all]
Build cache:
Makecache
Search:
Search string1 [string2] [...]
Search for the package name and summary information with the specified keywords;
View the capabilities that the specified package depends on:
Deplist Package1 [Package2] [...]
View Yum Transaction history:
History [Info|list|packages-list|packages-info|summary|addon-info|redo|undo|rollback|new|sync|stats]
To install and upgrade the local package:
* Localinstall Rpmfile1 [rpmfile2] [...]
(Maintained for legacy reasons Only-use install)
* Localupdate Rpmfile1 [rpmfile2] [...]
(Maintained for legacy reasons Only-use Update)
Related commands for package group management:
* Groupinstall group1 [group2] [...]
* Groupupdate group1 [group2] [...]
* grouplist [hidden] [Groupwildcard] [...]
* Groupremove group1 [group2] [...]
* GroupInfo group1 [...]
How to use a disc as a local yum repository:
(1) Mount the disc to a directory such as/media/cdrom
# mount-r-T Iso9660/dev/cdrom/media/cdrom
(2) Creating a configuration file
[CentOS7]
Name=
Baseurl=
gpgcheck=
Enabled=
Yum command-Line options:
--nogpgcheck: No GPG check is allowed;
-Y: Auto Answer "yes";
-Q: Silent mode;
--disablerepo=repoidglob: Temporarily disables the repo specified here;
--enablerepo=repoidglob: Temporarily enable the repo specified here;
--noplugins: Disable all plugins;
The variables available in the Yum repo configuration file:
$releasever: The major version number of the current OS release version;
$arch: platform;
$basearch: Basic platform;
$YUM 0-$YUM 9
http://mirrors.magedu.com/centos/$releasever/$basearch/os
To create a yum repository:
Createrepo [Options] <directory>
Package Compilation Installation:
TESTAPP-VERSION-RELEASE.SRC.RPM---after installation, use the Rpmbuild command to make the RPM package in binary format, and then install it;
Source code----preprocessing----compile (GCC)------Execute
Source Code organization format:
Multiple files: Between the code in the file, there is likely to be a cross-file dependency;
C, C + +: Make (Configure--makefile.in--Makefile)
Java:maven
C Code compilation installation three steps:
./configure:
(1) Pass the parameter through the option, specify enable feature, install path, etc., refer to User's designation and makefile.in file generation makefile when executing;
(2) Check the external environment of dependence;
Make
Build the application according to the makefile file;
Make install
Development tools:
AUTOCONF: Generate Configure Script
Automake: Generate makefile.in
Recommendation: View Install,readme before installation
Source code acquisition of open source program:
Official self-built site:
Apache.org (ASF)
mariadb.org
...
Code hosting:
SourceForge
Github.com
Code.google.com
C + +: gcc (GNU c complier)
Compile C source code:
Premise: Provide development tools and development environment
Development tools: Make, GCC, etc.
Development environment: Development Library, header file
GLIBC: Standard Library
To provide development components through "package groups"
CentOS 6: "Development Tools", "Server Platform development",
First Step: Configure script
Options: Specify the installation location, specify the enabled features
--help: Get the options it supports
Option Categories:
Installation path settings:
--prefix=/path/to/somewhere: Specifies the default installation location; default is/usr/local/
--sysconfdir=/path/to/somewhere: Configuration file installation location;
System types:
Optional Features: Optional Features
--disable-feature
--enable-feature[=arg]
Optional Packages: Optional Package
--with-package[=arg]
--without-package
Step Two: Make
Step Three: Make install
Post-installation configuration:
(1) Export the binary program directory to the PATH environment variable;
Edit File/etc/profile.d/name.sh
Export Path=/path/to/bin: $PATH
(2) Export Library file path
Edit/etc/ld.so.conf.d/name.conf
Add a new library file in the same directory as this file;
To have the system regenerate the cache:
Ldconfig [-v]
(3) Export header file
Implemented in a link-based manner:
Ln-sv
(4) Export Help manual
Edit/etc/man.config File
Add a Manpath
Practice:
1, the configuration and use of Yum, including the creation of Yum repository;
2, compile and install Apache 2.2; Start the service;
Blog jobs: Package Management: rpm/yum/compilation
Linux-based package management (II)