Linux centosvmware Yum Replace domestic warehouse source, yum download rpm package, source package installation

Source: Internet
Author: User
Tags aliyun

First, yum replace the domestic warehouse source

cd/etc/yum.repos.d/

Rm-f Dvd.repo

wget Http://mirrors.163.com/.help/CentOS7-Base-163.repo

Or

Curl-o Http://mirrors.163.com/.help/CentOS7-Base-163.repo

Yum List

[Email protected] ~]# cd/etc/yum.repos.d
[Email protected] yum.repos.d]#

[Email protected] yum.repos.d]# CP. /yum.repos.d.bak/*. A copy of the previous section

[[email protected] yum.repos.d]# ls
Centos-base.repo Centos-debuginfo.repo Centos-media.repo Centos-vault.repo
Centos-cr.repo Centos-fasttrack.repo Centos-sources.repo
[Email protected] yum.repos.d]#rm-f Centos-base.repo
[Email protected] yum.repos.d]# wget Http://mirrors.163.com/.help/CentOS7-Base-163.repoYum is removed and cannot be installed
-bash:wget: Command not found
[Email protected] yum.repos.d]# Curl-o Http://mirrors.163.com/.help/CentOS7-Base-163.repochoose it to save
% total% Received% xferd Average speed Time Time current
Dload Upload Total spent
1572 1572 0 0 12969 0--:--:----:--:----:--:--12991
[[email protected] yum.repos.d]# ls
Centos7-base-163.repo Centos-debuginfo.repo Centos-media.repo Centos-vault.repo
Centos-cr.repo Centos-fasttrack.repo Centos-sources.repo
[Email protected] yum.repos.d]#

[[email protected] yum.repos.d]# vim Centos7-base-163.repo View

[[email protected] Yum.repos.d]# yum install zlib arbitrarily installs a package
Loaded plug-ins: Fastestmirror
Base | 3.6 kb 00:00:00
Extras | 3.4 kb 00:00:00
Updates | 3.4 KB 00:00:00
Lo Ading mirror speeds from cached Hostfile
Package zlib-1.2.7-17.el7.x86_64 installed and up-to-date
without any processing
[[email  Protected] yum.repos.d]#

[[email protected] yum.repos.d]# yum makecache Refresh
Loaded plugins: Fastestmirror
Base | 3.6 KB 00:00:00
Extras | 3.4 KB 00:00:00
Updates | 3.4 KB 00:00:00
(1/6): Extras/7/x86_64/prestodelta | 129 KB 00:00:00
(2/6): extras/7/x86_64/other_db | 121 KB 00:00:00
(3/6): extras/7/x86_64/filelists_db | 709 KB 00:00:03
(4/6): updates/7/x86_64/other_db | 734 KB 00:00:04
(5/6): Updates/7/x86_64/prestodelta | 960 KB 00:00:05
(6/6): base/7/x86_64/other_db | 2.5 MB 00:00:07
Loading mirror speeds from cached hostfile
Metadata cache has been established
[Email protected] yum.repos.d]#

Installing the extension source

[[email protected] yum.repos.d]# ls
Centos7-base-163.repo Centos-debuginfo.repo Centos-media.repo Centos-vault.repo
Centos-cr.repo Centos-fasttrack.repo Centos-sources.repo
[Email protected] yum.repos.d]#

[[email protected] yum.repos.d]# yum install-y epel-release install extension source
Loaded plugins: Fastestmirror
Loading mirror speeds from cached hostfile
Resolving dependencies
--Checking transactions
---> Package epel-release.noarch.0.7-9 will be installed
--Resolve dependency completion

Dependency resolution

=============================================================================================================== ==========================
Package schema version Source size
=============================================================================================================== ==========================
Installing:
Epel-release noarch 7-9 Extras k

Transaction summary
=============================================================================================================== ==========================
Installing the 1 package

Total Downloads: K
Installation Size: K
Downloading packages:
epel-release-7-9.noarch.rpm | KB 00:00:00
Running transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: Epel-release-7-9.noarch 1/1
Verified in: Epel-release-7-9.noarch 1/1

has been installed:
Epel-release.noarch 0:7-9

Complete!
[[email protected] yum.repos.d]# ls
Centos7-base-163.repo Centos-debuginfo.repo centos-media.repo centos-vault.repo Epel-testing.repo
Centos-cr.repo Centos-fasttrack.repo Centos-sources.repo Epel.repo
[Email protected] yum.repos.d]#

Second, yum download rpm package

Yum Install package-y--downloadonly--downloaddir=/usr/local/src

Avoid problems and need to restore the previous Yum source

[Email protected] yum.repos.d]# RM-RF/ETC/YUM.REPOS.D

[Email protected] yum.repos.d]# MV/ETC/YUM.REPOS.D.BAK/ETC/YUM.REPOS.D

[email protected] yum.repos.d]# Yum list

Download the RPM package to the/usr/local/src/directory:

[email protected] yum.repos.d]# Yum install-y ypbind--downloadonly--downloaddir=/usr/local/src
Loaded plugins: Fastestmirror
Loading mirror speeds from cached hostfile
* base:centos.ustc.edu.cn
* extras:mirrors.aliyun.com
* updates:mirrors.aliyun.com
Resolving dependencies
--Checking transactions
---> Package ypbind.x86_64.3.1.37.1-9.el7 will be installed
--The dependency yp-tools is being processed and it is required by the package 3:ypbind-1.37.1-9.el7.x86_64
--The dependency rpcbind is being processed and it is required by the package 3:ypbind-1.37.1-9.el7.x86_64
--Checking transactions
---> Package rpcbind.x86_64.0.0.2.0-42.el7 will be installed
--and is handling dependencies Libtirpc >= 0.2.4-0.7, which is required by the package rpcbind-0.2.0-42.el7.x86_64
--Is processing dependency libtirpc.so.1 () (64bit), which is required by the package rpcbind-0.2.0-42.el7.x86_64
---> Package yp-tools.x86_64.0.2.14-5.el7 will be installed
--Checking transactions
---> Package libtirpc.x86_64.0.0.2.4-0.10.el7 will be installed
--Resolve dependency completion

Dependency resolution

=============================================================================================================== ==========================
Package schema version Source size
=============================================================================================================== ==========================
Installing:
Ypbind x86_64 3:1.37.1-9.EL7 base + k
To install for dependency:
Libtirpc x86_64 0.2.4-0.10.EL7 Base-K
Rpcbind x86_64 0.2.0-42.el7 Base K
Yp-tools x86_64 2.14-5.EL7 Base-K

Transaction summary
=============================================================================================================== ==========================
Install 1 packages (+3 dependent packages)

Total Downloads: 289 K
Installation size: 583 K
Background downloading packages, then exiting:
(quarter): rpcbind-0.2.0-42.el7.x86_64.rpm | KB 00:00:00
(2/4): ypbind-1.37.1-9.el7.x86_64.rpm | KB 00:00:00
(3/4): yp-tools-2.14-5.el7.x86_64.rpm | KB 00:00:00
(4/4): libtirpc-0.2.4-0.10.el7.x86_64.rpm | KB 00:00:00
--------------------------------------------------------------------------------------------------------------- --------------------------
Total 534 kb/s | 289 KB 00:00:00
Exiting because "Download only" specified
[Email protected] yum.repos.d]#

If the package has been downloaded and installed, you will need to use:

Yum reinstall-y Bash--downloadonly

[email protected] yum.repos.d]# Yum reinstall-y bash--downloadonly
Loaded plugins: Fastestmirror
Loading mirror speeds from cached hostfile
* base:centos.ustc.edu.cn
* extras:mirrors.aliyun.com
* updates:mirrors.aliyun.com
Resolving dependencies
--Checking transactions
---> Package bash.x86_64.0.4.2.46-29.el7_4 will be reinstalled
--Resolve dependency completion

Dependency resolution

=============================================================================================================== ==========================
Package schema version Source size
=============================================================================================================== ==========================
Reinstall:
Bash x86_64 4.2.46-29.el7_4 Updates 1.0 M

Transaction summary
=============================================================================================================== ==========================
Reinstall the 1 package

Total Downloads: 1.0 M
Installation Size: 3.5 M
Background downloading packages, then exiting:
bash-4.2.46-29.el7_4.x86_64.rpm | 1.0 MB 00:00:01
Exiting because "Download only" specified

Third, the source installation

Enter the source directory first

[Email protected] src]# cd/usr/local/src/
[Email protected] src]# wget http://mirrors/cnnic.cn/apache/httpd/httpd-2.2.32.tar.gz
-bash:wget: Command not found
[Email protected] src]#
[email protected] src]# Yum install-y wget
Loaded plugins: Fastestmirror
Loading mirror speeds from cached hostfile
* base:centos.ustc.edu.cn
* extras:mirrors.aliyun.com
* updates:mirrors.aliyun.com
Resolving dependencies
--Checking transactions
---> Package wget.x86_64.0.1.14-15.el7_4.1 will be installed
--Resolve dependency completion

Dependency resolution

=============================================================================================================== ==========================
Package schema version Source size
=============================================================================================================== ==========================
Installing:
wget x86_64 1.14-15.el7_4.1 updates 547 k

Transaction summary
=============================================================================================================== ==========================
Installing the 1 package

Total Downloads: 547 K
Installation Size: 2.0 M
Downloading packages:
wget-1.14-15.el7_4.1.x86_64.rpm | 547 KB 00:00:00
Running transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: wget-1.14-15.el7_4.1.x86_64 1/1
Verified in: wget-1.14-15.el7_4.1.x86_64 1/1

has been installed:
Wget.x86_64 0:1.14-15.el7_4.1

Complete!
[Email protected] src]#

[[email protected] src]# wget http://mirrors / cnnic.cn/apache/httpd/httpd-2.2.32.tar.gz   /error, is point.
--2018-04-05 03:11:44--http://mirrors/cnnic.cn/apache/httpd/httpd-2.2.32.tar.gz
Parsing host mirrors (mirrors) ... Failed: unknown name or service.
Wget: Unable to resolve host address ' mirrors '
[[email protected] src]# wget http://mirrors.cnnic.cn/apache/httpd/ httpd-2.2.32.tar.gz
--2018-04-05 03:12:24--http://mirrors.cnnic.cn/apache/httpd/httpd-2.2.32.tar.gz
Parsing host mirrors.cnnic.cn (mirrors.cnnic.cn) ... 101.6.8.193, 2402:f000:1:408:8100::1
connecting mirrors.cnnic.cn (mirrors.cnnic.cn) |101.6.8.193|:80 ... connected. The
has issued an HTTP request and is waiting for a response ... 404 Not Found                               &NB Sp       download unsuccessful
2018-04-05 03:12:24 error 404:not Found.

[Email protected] src]#

Enter URL r.aminglinux.com download Source package address

Unpack the Tarball

[[email protected] src]# TAR-ZXVF http. tar.gz

[[email protected] src] #cd http

./configure--help |less

./configure--PREFIX=/USR/LOCAL/APACHE2 Configuration Error

Installing the GCC compiler

Yum install-y gcc

./configure--prefix=/usr/local/apache2

echo $?

0

Ls-l Makefile

Make

echo $?

0

Installation

Make install

ls/usr/local/apach2/

Linux centosvmware Yum Replace domestic warehouse source, yum download rpm package, source package installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.