前面介绍了软件的管理的方式rpm。但有个缺点,rpm不能解决依赖。

下面介绍的yum软件管理。可以完美的解决这个问题。


使用yum的方式管理rpm软件
   
    优势:自动解决软件的依赖关系
    
前提条件:配置yum仓库/yum源

yum源类型:

     1.本地yum源
     2.ftp源
     3.http源
     


    配置yum的地方:


        阿里云镜像:     https://mirrors.aliyun.com
        
        网易云镜像:     http://mirrors.163.com/
        
        epel源          Centos官网 :http://vault.centos.org         # yum install epel-release   安装epel源
        

yum源/yum仓库的配置文件
 
     /etc/yum.repos.d/*.repo
     
     
示例:配置本地yum源

[[email protected] yum.repos.d]# mount /dev/sr0 /mnt/
mount: /dev/sr0 写保护,将以只读方式挂载
[[email protected] yum.repos.d]# ls /mnt/
CentOS_BuildTag  EULA  images    LiveOS    repodata              RPM-GPG-KEY-CentOS-Testing-7
EFI              GPL   isolinux  Packages  RPM-GPG-KEY-CentOS-7  TRANS.TBL
[[email protected] yum.repos.d]# mkdir /etc/yum.repos.d/beifeng
[[email protected] yum.repos.d]# mv /etc/yum.repos.d/CentOS-* /etc/yum.repos.d/beifeng/
[[email protected] yum.repos.d]# ls
beifeng  mysql-community.repo  mysql-community-source.repo
[[email protected] yum.repos.d]# vim centos.repo
[[email protected] yum.repos.d]# ls
beifeng  centos.repo  mysql-community.repo  mysql-community-source.repo

配置内容:
[centos7.2]
name=centos7.2
baseurl=file:///mnt
enable=1
gpgcheck=0


清除yum缓存:

[[email protected] yum.repos.d]# yum clean all


生成yum缓存:

[[email protected] yum.repos.d]# yum makecache

查看yum的列表

[[email protected] yum.repos.d]# yum repolist


yum常规操作

(1)yum安装软件

 

# yum install 软件名

 

# yum install -y 软件名

 

(2)显示yum中所有软件

[[email protected] ~]# yum list all

 

(3)显示所有的软件组

[[email protected] ~]# yum grouplist

(4)安装软件组

# yum groupinstall -y 软件组的名称

(英文组,要用“”括起来)

(5)查询文件所属的软件名称

# yum provides “*bin/passwd”

 

源码软件管理安装

    1.配置安装参数
    2.编译
    3.安装

 

前提:gcc编译环境(自己安装yum install gcc)

示例:编译安装htop软件

htop软件源码:https://www.lanzous.com/i2zs97g


解压
[[email protected] ~]# tar zxf htop-1.0.2.tar.gz 

切入htop-1.0.2目录

[[email protected] ~]#cd htop-1.0.2

查看配置

[[email protected] htop-1.0.2]# ./configure --help |less

配置参数

[[email protected] htop-1.0.2]# ./configure --prefix=/usr/local/htop

编译

[[email protected] htop-1.0.2]# make

安装

[[email protected] htop-1.0.2]# make install

启动(已经安装成功接界面)

[[email protected] share]# /usr/local/htop/bin/htop 

Linux的yum管理


出现错误:

configure: error: You may want to use --disable-unicode or install libncursesw.

解决办法:
[[email protected] htop-1.0.2]# yum install -y ncurses-devel 

相关文章:

  • 2021-12-01
  • 2021-12-26
  • 2021-08-26
  • 2021-08-27
  • 2022-12-23
  • 2021-11-20
  • 2021-07-28
  • 2021-06-14
猜你喜欢
  • 2022-01-08
  • 2021-07-20
  • 2021-04-26
  • 2021-06-16
  • 2021-05-31
  • 2022-12-23
相关资源
相似解决方案