The basic use of points yum Linux operation and maintenance of technologies and rpm

https://pkgs.org/ with HTTPS: // rpmfind .org /    RPM package download

About RPM package

    1. installation and upgrade, using the full name of the package

    When the package is to be noted dependency package installation 2.RPM

  Operating RPM package (installation package system comes)

    Installation command: rpm -ivh full name of the package ( -i installation, -v show details, -H show the progress, --nodeps does not detect dependencies)

    Upgrade command: rpm -Uvh package full name ( -U upgrade, capitalized!)

    Uninstall command: rpm -e package name ( -e unloading, -nodeps  does not check dependencies sure to uninstall. Packages Standard Package directory)

    Forced Uninstall: rpm -e --nodeps package name

    Query is installed: rpm -qa package name ( -q query, -a all)

    RPM database reconstruction: RPM --rebuilddb / RPM --initdb

 Source code package installation package installed :( source)

     First extracting package: tar xvfj + file to extract the -C path unpacking

     This solution into the finished package folder: ./ configure --prefix = put this program where installed

     Then: make an executable file

     make install to complete the installation!

Run yum makecache generate cache

     yum clean all

     yum makecache

YUM package

   Network yum source configuration:

       File Location: /etc/yum.repos.d/CentOS-Base.repo

     [Base]: name of the container, must be placed in parentheses.

     name: container description, just write.

     mirrorlist: mirror site

     baseurl: Our yum address of the source server, you can set up their own.

     enabled: This container is in effect, = 1 is to take effect, = 0 does not take effect.

     gpgcheck: If 1 refers rpm digital certificates to take effect. If 0 is not effective.

     gpgkey: Save in digital public key file, without modification.

   yum command:

     Query command: yum list --- Search the list of available packages

               yum search keyword   ----- on the search server and all the keywords related packages

     Installation command: yum -y install the package name ( -y automatically answers yes , install installation)

     Upgrade command: yum -y update package name ( Update upgrade, -y automatically answers)

     Uninstall command: yum -y remove the package name ( the Remove to uninstall)

     yum grouplist --- lists all available software list

     yum groupinstall software group name  --- install the specified software group, the group name may consist of grouplist check out

     yum groupremove software group name --- uninstall the software group specified

  Yum source optical disk step structures

     In the optical disk 1. Hanging: Mount / dev / CDROM / mnt / CDROM

     2. Allow network yum source files into force

       /etc/yum.repos.d/ in this folder below about yum of 4 files

       (centOS-base.repo 、centOS-Debuginfo.repocentOS-media.ropecentOS-vault.rope

        默认生效的是网络yum源生效,搭建yum光盘要让3个网络yum源文件不生效。

         centOS-media.rope是本地yum源文件。YUM源文件检测的是后缀名 .rope只要把后缀名改了,文件就不会生效

       操作:改除centOS-media.rope之外的三个文件后缀名,使那三个文件夹不生效(mv--改名)

    3.修改光盘yum源文件

        需要改的地方:

          baseurl=地址为你自己的光盘挂载地址,有其余的地址不要,注释掉!

          enable=1 改为1为让这个yum源配置文件生效

源码包安装

     安装位置:安装在指定位置当中,一般是/usr/local/软件名/

     启动方法:必须使用就绝对路径进行服务的管理

     安装前准备:

           1.安装C语言编译器

           2.下载源码包:http://mirror.bit.edu.cn/apache/httpd/

      安装注意事项:

           源代码保存位置:/usr/local/src/

           软件安装位置:/usr/local/

         如何确定安装过程报错?

          安装过程停止、并出现error、warningno的提示!

       源码包安装过程:

           下载源码包---->解压缩下载的源码包----->进入解压缩目录,进入压缩目录后进行以下配置!

            ./configure 软件配置与检查(检测系统是否符合要求、定义需要的功能并写入makefile文件)

            make  翻译

            若前两步报错只需写入这个命令----make  clean (清空产生的临时文件)

            这条命令可以使未安装成功的软件包完全清除!

            make   install  编译安装

        源码包卸载:直接删除源码包的文件目录即可!

 

 

使用yum来下载rpm

1、在CentOS/RHEL 6或更早期的版本中,需要安装一个单独yum插件(名称为 yum-plugin-downloadonly)才能使用--downloadonly命令选项:

2、yum  -y   install yum-plugin-downloadonly

3、将一个包下载到指定路径

yum install  --downloadonly  --downloaddir=/tmp   包名

 

编译rpm包过程!

cd drbd-8.4.3       

 

mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}

 

./configure

 

make rpm

 

make km-rpm

 

找到我们刚才生成的包,并安装:

 

cd ~/rpmbuild/RPMS/x86_64/

 

rpm -ivh drbd-*.rpm

Guess you like

Origin www.cnblogs.com/linux-s/p/11289517.html
Recommended