CentOSyum Replace the domestic source, yum download rpm package and source code package installation

Source: Internet
Author: User

CentOSyum Replace the domestic source, yum download rpm package and source code package installation

I. yum replacement of domestic sources

1. First enter the Directory: cd/etc/yum. repos. d/

2. Delete the corresponding repo file or rename it: rm-f dvd. repo or mv dvd. repo dvd. repo. bak
(Check whether the wget command is installed before deletion. If the command is not installed first, delete the command: yum install-y wget)

3. Run the following command to download the corresponding repo Source: wgethttp: // mirrors.163.com/.help/CentOS7-Base-163.repo.

Or curl-Ohttp: // mirrors.163.com/.help/CentOS7-Base-163.repo

4. Run the yum list command to view the installation list and install the corresponding package.

How to confirm the installation source, you can go to the configuration file to confirm the vim CentOS7-Base-163.repo:

Ii. Download the rpm package from yum
Extension:
If a 163 or base source is insufficient, you can install an extended source epel: yum install-y epel-release.

Yum list | grep epel

1. yum install package name-y-downloadonly

2. Run the ls/var/cache/yum/x86_64/7/command to view the downloaded package/

(During installation, check whether the source of the installation package is base, 163, or epel, and check the corresponding file)

3. Download only packages without installation:
Yum install-y package name-downloadonly-downloaddir = path

4. You need to reinstall the installed package:
Yum reinstall-y package name-downloadonly-downloaddir = path

3. Install the source code package
To download the source code package, you must go to the official site to download it. It is not safe to download it on the Internet. Because the source code package you downloaded may have been modified.

If gcc is not installed on your machine, there is no way to compile the source code. Run the yum install-y gcc command to complete the installation.

1. Uniform download path of the source code package, so use the command to enter this path: cd/usr/local/src/

2. Installation link: wgethttp: // mirrors.cnnic.cn/apache/httpd/httpd-2.2.34.tar.gz

3. Run the following command to decompress the package and view it:
Tar zxvf httpd-2.2.34.tar.gz
Cd httpd-2.2.34

4. Installation Guide:
Usually, the source code package is installed in the/usr/local/directory. For example, we install apache under/usr/local/apache2.

(1) Specify the installation path:
./Configure-prefix =/usr/local/apache2
(Check whether the command is correct. Use the command to confirm: echo $? , 0 is also normal)

(2) Compile: make

(3) install: make install

Uninstalling is to delete the installation file.

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.