1. Backup
Mv/etc/yum.repos.d/centos-base.repo/etc/yum.repos.d/centos-base.repo.backup
2, download the new Centos-base.repo to/etc/yum.repos.d/
CentOS 5
Wget-o/etc/yum.repos.d/centos-base.repo Http://mirrors.aliyun.com/repo/Centos-5.repo
Or
Curl-o/etc/yum.repos.d/centos-base.repo Http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
Wget-o/etc/yum.repos.d/centos-base.repo Http://mirrors.aliyun.com/repo/Centos-6.repo
Or
Curl-o/etc/yum.repos.d/centos-base.repo Http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
Wget-o/etc/yum.repos.d/centos-base.repo Http://mirrors.aliyun.com/repo/Centos-7.repo
3. After running Yum Makecache generate cache
The Yum command itself can be used to download a RPM package, and the standard Yum command provides a--downloadonly (download only) option to achieve this purpose.
If you want to download a package to a specified directory (for example,/tmp):
Yum Install--downloadonly--downloaddir=/tmp <package-name>
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
linux-Basics-Day 16th