yum软件包管理
[root@iZtoz99sjuwqcnZ etc]# yum repolist
[root@iZtoz99sjuwqcnZ etc]# yum list yum*
[root@iZtoz99sjuwqcnZ etc]# yum list installed
[root@iZtoz99sjuwqcnZ etc]# yum grouplist
yum管理软件更新
[student@localhost 桌面]$ yum list 'http*'
软件信息
[student@localhost 桌面]$ yum info httpd
已加载插件:langpacks, product-id, subscription-manager
已安装的软件包
名称 :httpd
架构 :x86_64
版本 :2.4.6
发布 :17.el7
大小 :3.7 M
源 :installed
来自源:anaconda
简介 : Apache HTTP Server
网址 :http://httpd.apache.org/
协议 : ASL 2.0
描述 : The Apache HTTP Server is a powerful, efficient, and extensible
: web server.
[student@localhost ~]$ yum provides /var/www/html/
已加载插件:langpacks, product-id, subscription-manager
httpd-2.4.6-17.el7.x86_64 : Apache HTTP Server
源 :@anaconda/7.0
匹配来源:
文件名 :/var/www/html/
软件的安装更新与删除
[student@localhost ~]$ yum install vi
[student@localhost ~]$ yum remove vi
[student@localhost ~]$ yum update
查询软件组的信息
[root@iZtoz99sjuwqcnZ ~]# yum groupinfo "开发工具"
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
组:开发工具
组编号:development
描述:基本开发环境。
必要的软件包:
autoconf
automake
binutils
...
查看事务历史记录
[root@iZtoz99sjuwqcnZ ~]# yum history
[root@iZtoz99sjuwqcnZ ~]# tail -f /var/log/yum.log
启用yum软件存储库
[root@iZtoz99sjuwqcnZ ~]# yum repolist all
//添加软件库地址
[root@iZtoz99sjuwqcnZ ~]# yum-config-manager --add-repo="源地址"
已加载插件:fastestmirror, langpacks
adding repo from: 源地址
[源地址]
name=added from: 源地址
baseurl=源地址
enabled=1
//自动生成.repo文件
[root@iZtoz99sjuwqcnZ ~]# ll /etc/yum.repos.d/
-rw-r--r-- 1 root root 69 8月 2 14:02 源地址.repo
手动添加存储库
将文件放在/etc/yum.repos.d文件下,且手动添加必须用 .repo 结尾
且格式需要如下
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://mirrors.aliyuncs.com/epel/7/$basearch
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
检验RPM数据包
任务 | 命令 |
---|---|
显示软件包的相关信息 | rpm -q -i NAME |
列出软件包中包含的所有文件 | rpm -q -L NAME |
列出软件包中包含的所有配置文件 | rpm -q -c NAME |
列出软件包中包含的文档文件 | rpm -q -d NAME |
显示软件包中发行版的简短原因摘要 | rpm -q –changelog NAME |
显示软件包中含有的shell脚本 | rpm -q –scripts |
使用yum安装rpm软件
yum localinstall wonderwidgets-10-4.x86_64.rpm
手动编译安装软件
一般厂商都会配有开发文档
类似于 readme 或者 info 等软件
下面仅仅写几个例子,供参考
#tar -xf httpd-2.4.12.tar.gz
#cd httpd-2.4.12
#yum -y install apr-devel apr-util-devel pcre-devel openssl-devel
#./configure --prefix=/usr/local/apache2 --enable-ssl --sysconfdir=/etc/httpd
#make
#make install
#/usr/local/apache2/bin/apachectl start
#netstat -ntlp
#/usr/local/apache2/bin/apachectl stop
#tar -xf nginx-1.7.11.tar.gz
#cd nginx-1.7.11
#useradd -r -s /sbin/nologin nginx
#./configure --prefix=/usr/local/nginx --with-http_ssl_module --conf-path=/etc/nginx/nginx.conf --user=nginx --group=nginx
#make
#make install
#/usr/local/nginx/sbin/nginx
#netstat -ntlp
#/usr/local/nginx/sbin/nginx -t
#/usr/local/nginx/sbin/nginx -s stop
#tar -xf rdesktop-1.8.3.tar.gz
#cd rdesktop-1.8.3
#yum -y install libX11-devel
#./configure --prefix=/usr/local/rdesktop --disable-credssp --disable-smartcard
#make
#make install
#PATH=$PATH:/usr/local/rdesktop/bin
#rdesktop -a 32 -g 800*600 -u administrator 172.25.0.100