Linux的yum管理
前面介绍了软件的管理的方式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源
[root@wei yum.repos.d]# mount /dev/sr0 /mnt/
mount: /dev/sr0 写保护,将以只读方式挂载
[root@wei 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
[root@wei yum.repos.d]# mkdir /etc/yum.repos.d/beifeng
[root@wei yum.repos.d]# mv /etc/yum.repos.d/CentOS-* /etc/yum.repos.d/beifeng/
[root@wei yum.repos.d]# ls
beifeng mysql-community.repo mysql-community-source.repo
[root@wei yum.repos.d]# vim centos.repo
[root@wei 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缓存:
[root@wei yum.repos.d]# yum clean all
生成yum缓存:
[root@wei yum.repos.d]# yum makecache
查看yum的列表
[root@wei yum.repos.d]# yum repolist
yum常规操作
(1)yum安装软件
# yum install 软件名
# yum install -y 软件名
(2)显示yum中所有软件
[root@wei ~]# yum list all
(3)显示所有的软件组
[root@wei ~]# 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
解压
[root@wei ~]# tar zxf htop-1.0.2.tar.gz
切入htop-1.0.2目录
[root@wei ~]#cd htop-1.0.2
查看配置
[root@wei htop-1.0.2]# ./configure --help |less
配置参数
[root@wei htop-1.0.2]# ./configure --prefix=/usr/local/htop
编译
[root@wei htop-1.0.2]# make
安装
[root@wei htop-1.0.2]# make install
启动(已经安装成功接界面)
[root@wei share]# /usr/local/htop/bin/htop
出现错误:
configure: error: You may want to use --disable-unicode or install libncursesw.
解决办法:
[root@wei htop-1.0.2]# yum install -y ncurses-devel
最新文章
- 使用python发送和接收邮件
- mockjs模拟前后端交互
- 《图形学》实验三:DDA算法画直线
- 创建Android项目时出错——No resource found that matches the given name 'Theme.AppCompat.Light'
- [Tool] 常用开发工具注册码(持续更新)
- (leetcode)Summary Ranges
- ArrayList实现原理
- linux添加环境变量
- Wince修改系统时间问题
- ZRender源码分析2:Storage(Model层)
- linux c ping 实现
- vim编译安装+lua模块
- 基于webuploader.js的单图片上传封装
- vue脚手架工具
- kubernetes的安装
- CF1099F Cookies
- php格式化数字:位数不足前面加0补足
- solusvm安装过程
- JSP基本_JSTL
- Selenium WebDriver VS Selenium RC
热门文章
- Python Warning
- 戴尔灵越14燃5488安装LTSC2019
- [LeetCode] 893. Groups of Special-Equivalent Strings 特殊字符串的群组
- [LeetCode] 8. String to Integer (atoi) 字符串转为整数
- LeetCode 561:数组拆分 I Array Partition I
- html5手机端播放音效不卡的方法
- unity工具开发
- pod install速度慢,pod repo update 速度慢解决方法
- MD5加密方法HashPasswordForStoringInConfigFile(string,string)过时问题处理方法
- vs2017 + mysql+ef 创建实体模型闪退问题