您当前的位置: 首页 > 学无止境 > 心得笔记 网站首页心得笔记
马哥linux运维学习笔记-Linux软件管理之三 yum
发布时间:2018-08-25 15:07:13编辑:雪饮阅读()
查看所有已经安装和可以安装的程序包
yum list
list:列表
available:可用的,仓库中有但尚未安装的
installed:已经安装的
updates:可用的升级
查看repo仓库列表
repolist有参数:all,enabled(默认),disabled
yum repolist
查看disabled属性的仓库列表
yum repolist disabled
yum卸载
该命令慎用,详情百度一下
yum remove php
查看某个包的详细信息:
[root@localhost yum.repos.d]# yum info php
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.nju.edu.cn
* extras: mirrors.nju.edu.cn
* updates: ftp.sjtu.edu.cn
Installed Packages
Name : php
Arch : x86_64
Version : 5.4.16
Release : 45.el7
Size : 4.4 M
Repo : installed
From repo : base
Summary : PHP scripting language for creating dynamic web sites
URL : http://www.php.net/
License : PHP and Zend and BSD
Description : PHP is an HTML-embedded scripting language. PHP attempts to make it
: easy for developers to write dynamically generated web pages. PHP also
: offers built-in database integration for several commercial and
: non-commercial database management systems, so writing a
: database-enabled webpage with PHP is fairly simple. The most common
: use of PHP coding is probably as a replacement for CGI scripts.
:
: The php package contains the module (often referred to as mod_php)
: which adds support for the PHP language to Apache HTTP Server.
查看系统中以组安装的包
yum grouplist
查看系统中以组安装的包-查看某个组员(包)详情
yum groupinfo "Development Tools"
安装组包,可以多个组包一起安装
yum groupinstall "KDE Plasma Workspaces" "Development Tools"
yum安装本地rpm包
yum localinstall /tmp/tmp/Packages/php-mysql-5.4.16-42.el7.x86_64.rpm
自己创建repo仓库
yum install createrepo
mkdir /tmp/snowDrink
vi snowDrink.repo
[Base]
name=snowDrinkServer
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
enabled=1
gpgcheck=0
[snowDrinkLocal]
name=snowDrink
baseurl=file:///tmp/snowDrink
enabled=1
gpgcheck=0
createrepo /tmp/snowDrink/
重新查看repo仓库列表
[root@localhost yum.repos.d]# yum repolist
Loaded plugins: fastestmirror
Base | 3.6 kB 00:00:00
snowDrinkLocal | 2.9 kB 00:00:00
(1/3): snowDrinkLocal/primary_db | 1.1 kB 00:00:00
(2/3): Base/7/x86_64/group_gz | 166 kB 00:00:07
(3/3): Base/7/x86_64/primary_db | 5.9 MB 00:01:09
Loading mirror speeds from cached hostfile
* base: ftp.sjtu.edu.cn
* extras: ftp.sjtu.edu.cn
* updates: ftp.sjtu.edu.cn
repo id repo name status
Base/7/x86_64 snowDrinkServer 9,911
base/7/x86_64 CentOS-7 - Base 9,911
extras/7/x86_64 CentOS-7 - Extras 370
snowDrinkLocal snowDrink 0
updates/7/x86_64 CentOS-7 - Updates 1,054
repolist: 21,246
关键字词:linux,yum