yum replace source and download rpm package and Linux software source package for installation

Keywords: yum EPEL CentOS Linux

Replace yum warehouse source

Actual operation

[root@centos01 yum.repos.d]# curl -O http://mirrors.163.com/.help/CentOS7-Base-163.repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1572  100  1572    0     0    291      0  0:00:05  0:00:05 --:--:--   351
[root@centos01 yum.repos.d]# ls
CentOS7-Base-163.repo
[root@centos01 yum.repos.d]# yum repolist all  # Display all yum warehouses in the system
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
repo id                                  repo name                                          status
base/7/x86_64                            CentOS-7 - Base - 163.com                          enabled: 9,911
centosplus/7/x86_64                      CentOS-7 - Plus - 163.com                          disabled
dvd                                      install dvd                                        enabled: 3,538
extras/7/x86_64                          CentOS-7 - Extras - 163.com                        enabled:   432
updates/7/x86_64                         CentOS-7 - Updates - 163.com                       enabled: 1,543
repolist: 15,424
[root@centos01 yum.repos.d]# yum list |tail -n20
yum-plugin-upgrade-helper.noarch           1.1.31-46.el7_5             updates
yum-plugin-verify.noarch                   1.1.31-46.el7_5             updates
yum-plugin-versionlock.noarch              1.1.31-46.el7_5             updates
yum-rhn-plugin.noarch                      2.0.1-10.el7                base
yum-updateonboot.noarch                    1.1.31-46.el7_5             updates
yum-utils.noarch                           1.1.31-46.el7_5             updates
zenity.x86_64                              3.22.0-1.el7                base
zlib.i686                                  1.2.7-17.el7                base
zlib.x86_64                                1.2.7-17.el7                base
zlib-devel.i686                            1.2.7-17.el7                base
zlib-devel.x86_64                          1.2.7-17.el7                base
zlib-static.i686                           1.2.7-17.el7                base
zlib-static.x86_64                         1.2.7-17.el7                base
zsh.x86_64                                 5.0.2-28.el7                base
zsh-html.x86_64                            5.0.2-28.el7                base
zziplib.i686                               0.13.62-5.el7               base
zziplib.x86_64                             0.13.62-5.el7               base
zziplib-devel.i686                         0.13.62-5.el7               base
zziplib-devel.x86_64                       0.13.62-5.el7               base
zziplib-utils.x86_64                       0.13.62-5.el7               base

Install extension source epel

[root@centos01 yum.repos.d]# ls
CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-Sources.repo  CentOS-Vault.repo
[root@centos01 yum.repos.d]# yum install -y epel-release
Loaded plugins: fastestmirror
base                                                                                               | 3.6 k
(1/2): base/7/x86_64/group_gz                                                                      | 166 k
(2/2): base/7/x86_64/primary_db                                                                    | 5.9 M
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: centos.ustc.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================================
 Package                          Arch                       Version                     Repository
==========================================================================================================
Installing:
 epel-release                     noarch                     7-11                        extras

Transaction Summary
==========================================================================================================
Install  1 Package

Total download size: 15 k
Installed size: 24 k
Downloading packages:
epel-release-7-11.noarch.rpm                                                                       |  15 k
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-11.noarch
  Verifying  : epel-release-7-11.noarch

Installed:
  epel-release.noarch 0:7-11

Complete!
[root@centos01 yum.repos.d]# ls
CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-Sources.repo  CentOS-Vault.repo  epel.repo  epel-testing.r
[root@centos01 yum.repos.d]# yum list | grep epel | head # You can see the rpm package in the new epel extension source
 * epel: mirrors.huaweicloud.com
epel-release.noarch                      7-11                          @extras
0ad.x86_64                               0.0.22-1.el7                  epel
0ad-data.noarch                          0.0.22-1.el7                  epel
0install.x86_64                          2.11-1.el7                    epel
2048-cli.x86_64                          0.9.1-1.el7                   epel
2048-cli-nocurses.x86_64                 0.9.1-1.el7                   epel
2ping.noarch                             3.2.1-2.el7                   epel
389-admin.x86_64                         1.1.46-1.el7                  epel
389-admin-console.noarch                 1.1.12-1.el7                  epel

Download rpm package from yum

  • yum install -y package name -- downloadingly
  • yum install -y package name -- downloadingly -- downloaddir = / TMP / ා specify the download path as / tmp/
  • yum reinstall -y installed package name -- downloaded -- downloaddir = / TMP / ා specified download path is / tmp/
[root@centos01 yum.repos.d]# yum install zsh --downloadonly
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * epel: mirrors.huaweicloud.com
 * extras: mirrors.aliyun.com
 * updates: centos.ustc.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package zsh.x86_64 0:5.0.2-28.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================================
 Package              Arch                    Version                         Repository             Size
==========================================================================================================
Installing:
 zsh                  x86_64                  5.0.2-28.el7                    base                  2.4 M

Transaction Summary
==========================================================================================================
Install  1 Package

Total download size: 2.4 M
Installed size: 5.6 M
Background downloading packages, then exiting:
zsh-5.0.2-28.el7.x86_64.rpm                                                        | 2.4 MB  00:00:05
exiting because "Download Only" specified

# View the downloaded rpm package
[root@centos01 yum.repos.d]# ls /var/cache/yum/x86_64/7/base/packages/ 
zsh-5.0.2-28.el7.x86_64.rpm

Source package installation

  • cd /usr/local/src / ා general source package download directory
  • wget http://archive.apache.org/dist/httpd/httpd-2.2.9.tar.gz #Download the software source package to be installed
  • tar zxvf httpd-2.2.9.tar.gz
  • cd httpd-2.2.9
  • . / configure --prefix=/usr/local/apache2 ා configure and specify the installation directory
  • make
  • make install
  • Uninstalling: removing installation files

Actual operation

[root@centos01 httpd-2.2.9]# ./configure --prefix=/usr/local/apache2
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu

Configuring Apache Portable Runtime library ...

checking for APR... reconfig
configuring package in srclib/apr now
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
Configuring APR library
Platform: x86_64-unknown-linux-gnu
checking for working mkdir -p... yes
APR Version: 1.3.0
checking for chosen layout... apr
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
configure failed for srclib/apr
[root@centos01 httpd-2.2.9]# echo $?  # Viewing the operation result of the previous command 1 indicates failure 0 indicates success
1
[root@centos01 httpd-2.2.9]# yum install gcc
[root@centos01 httpd-2.2.9]# ./configure --prefix=/usr/local/apache2
[root@centos01 httpd-2.2.9]# echo $?
0

[root@centos01 httpd-2.2.9]# make
Making all in srclib
make[1]: Entering directory `/usr/local/src/httpd-2.2.9/srclib'
Making all in apr
...
[root@centos01 httpd-2.2.9]# echo $?
0

[root@centos01 httpd-2.2.9]# make install
Making install in srclib
make[1]: Entering directory `/usr/local/src/httpd-2.2.9/srclib'
...
[root@centos01 httpd-2.2.9]# echo $?
0
[root@centos01 httpd-2.2.9]# ls /usr/local/apache2/ # View installation directory
bin  build  cgi-bin  conf  error  htdocs  icons  include  lib  logs  man  manual  modules

Posted by JayVee on Tue, 17 Dec 2019 08:43:35 -0800