yum replace domestic source & yum download rpm package & source package installation

yum replace domestic source  

 

cd  /etc/yum.repo.d/

 

delete source

rm -f   dvd.repo

 

rm -f  CentOS-Base.repo

 

Edit a source yourself or download a source file:

curl -O http://mirrors.163.com/.help/CentOS7-Base-163.repo 

 

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

 

 

 

  

yum download rpm package

 

Install the extension source epel

 

yum install  -y   epel-release

 

 

 

After installing the extension source, many packages will come out

 

yum list

 

 

 

Only download the rpm package without installing it:

 

yum     install  zsh  --downloadonly

 

 

Check if it is installed: rpm -q zsh

Not Installed

 

 

View the storage path of the downloaded rpm package

 

[root@localhost yum.repos.d]# ls /var/cache/yum/x86_64/7/base/packages/zsh-5.0.2-28.el7.x86_64.rpm 

/var/cache/yum/x86_64/7/base/packages/zsh-5.0.2-28.el7.x86_64.rpm

 

 

Specify the download path

 

yum  install   -y  vim  --downloadonly  --downloaddir=/tmp/

 

 

 Source package installation

First download a source package;

 

 

The source code package is placed in this path, which is easy to find and manage.

cd /usr/local/src/

 

 

yum install wget

 

Install an apache source package

 

wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.2.34.tar.gz

 

 

Unzip:

[root@localhost ~]# tar  zxvf httpd-2.2.34.tar.gz 

 

 

compile, configure

 

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

 

 

reported an error: 

Check if there is an error: echo $? Non-0 is an error, 1 is an error;

echo $? is to see if there is an error in the previous command.

 

 

gcc does not exist

 

Install gcc: yum install -y gcc

 

reconfigure

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

 

Check again for errors

[root@localhost httpd-2.2.34]# echo $?

0

 

0 means no error.

 

After compiling, generate a makefile

 

execute make

 

make complete execute make install

 

echo $? is 0 success

 

[root@localhost httpd-2.2.34]# ls  /usr/local/apache2/

bin  build  cgi-bin  conf  error  htdocs  icons  include  lib  logs  man  manual  modules

 

To uninstall this package, just delete this directory.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324652432&siteId=291194637