yum: Yellowdog Updater Modified
- yum [options] [command] [package ...]
yum search lrzsz
,搜索 rz/sz 命令包 lrzsz,lrz 和 lsz,是 rz 和 sz 的替代版; - 以安装 man 命令为例
yum install man -y
which man
man man
man yum
yum search tree /* you should see it in the search list */
yum install tree /* tree 命令安装上方便些,也可以使用 find 命令自定义一个 tree */
-y, --assumeyes:Assume yes; assume that the answer to any question which would be asked is yes.
-
yum info <package>
如:yum info cmake
。查看 cmake 的可用安装包和本地安装包。 -
yum list snappy
:查看 snappy 库的安装情况。 -
yum list installed | grep snappy
:查看 snappy 是否安装。 - 如何查看 snappy 安装在哪个目录下?
rpm -qa |grep snappy
:--query --all
找到 snappy 的包名(package full name)
rpm -q --filesbypkg <package full name>
通过包名找到具体安装路径。
- 安装后,通过
rpm -ql <包名>
(--query --list
) 或者repoquery --list <包名>
查询包的安装情况。其中:repoquery
命令非常详细、很好,就用她吧。如果记不清包名,可以使用 * 星号等模糊查询。 yum search <package>
yum install <package>
-
sudo yum check-update
查看有无可更新包。 -
yum repolist
:查看库列表(repo id, repo name, status(包个数))
yum install epel-release
-
man
man: format and display the on-line manual pages。常见的 manual sections 编号:1 表示 User Commands,5 表示 File Formats and Conventions,8 表示 System Administration tools and Deamons。
比如:less(1), man.config(5),表示让你查看 less 命令帮助,man.config 文件帮助。
man [section] name 查看指定 section 编号的 name 帮助。 - install build tools
有源码很好,可是需要编译安装,前提是首先安装有编译和安装工具(compile and install)。
yum install gcc-c++ make
或者 -
sudo yum group install 'Development Tools'
、sudo yum group remove 'Development Tools'
- 安装 zlib.h 文件:
sudo yum install zlib-devel
sudo yum groupinstall "Development Tools" --setopt=group_package_types=mandatory,default,optional
-
CentOS / RHEL 7: Install GCC (C and C++ Compiler) and Development Tools:可参考?
- Just use
sudo yum install gcc*
It will install all gcc software and upgrade all the files to satisfy dependices. 安装后后果未知。
- Just use
-
sudo yum install man-pages man-db man
: 安装 manual。 -
yum search sysstat
Theiostat
command is used to check disk input/output statistics in real time. The iostat utility is installed with yum via thesysstat
package.
rpm & yum
yum is not a stand-alone tool, but basically a higher-level user interface for rpm.
- RPM and YUM package management;
- Package Manager;
-
Difference Between YUM and RPM;
RPM is a package manager while YUM is a frontend that can be used with RPM.
The RPM package manager is unable to track dependencies while YUM can. -
rpm -qa
-q, --query 查询;
-a, --all;
学习
How to add a Yum repository 入门级佳作。
yum repolist 查看已配置的 repo 库情况。
yum-config-manager <repo-name> 查看指定 repo 的安装情况。
在一个 .repo 配置文件中可以配置多个 repo 库,一个 [<section>] 就是一个库,包括:name、baseurl、enabled、gpgcheck、gpgkey。yum provides cmake3
查看 cmake3 在哪个库里,CentOS 7 一般在 epel 库。yum whatprovides lsb_release
就可以看哪个包需要安装,这个包提供了 lsb_release 命令。使用 yum install redhat-lsb-core 即可安装。
yum info cmake3$ man yum.conf To see a complete list of repository options, see the man page.
/etc/yum.conf
/etc/yum.repos.d 这是 .repo 配置文件的目录
/etc/yum/pluginconf.d/fastestmirror.conf 里面的 enabled 参数。How to use yum command on CentOS/RHEL: 提供了大量的 yum 命令示例。
yum clean all
yum reinstall *
yum list installed
yum list updates : List all packages with updates available in the yum repositories.sudo rpm -qi basesystem
查看系统安装时间 Install Date:--query --install
stat / 可以看到 Birth,虚拟机为空。uptime -s --since system up since, in yyyy-mm-dd HH:MM:SS format
yum grouplist 安装《开发工具》组
-
yum grouplist | grep -i "Development Tools"
查看 Development Tools 是否已安装 -
sudo yum groupinstall Development tools
bybacc 和 flex 在 Development tools 里面都已包含,无需单独安装。 yum groupinfo Development tools
Loaded plugins: fastestmirror
Setting up Group Process
Loading mirror speeds from cached hostfile
Group: Development tools
Description: A basic development environment.
Mandatory Packages:
autoconf
automake
binutils
bison
flex
gcc
gcc-c++
gettext
libtool
make
patch
pkgconfig
redhat-rpm-config
rpm-build
Default Packages:
byacc
cscope
ctags
cvs
diffstat
doxygen
elfutils
gcc-gfortran
git
indent
intltool
patchutils
rcs
subversion
swig
systemtap
Optional Packages:
ElectricFence
PyYAML
ant
babel
bzr
chrpath
cmake
compat-gcc-34
compat-gcc-34-c++
compat-gcc-34-g77
cvs-inetd
dejagnu
expect
gcc-gnat
gcc-java
gcc-objc
gcc-objc++
imake
jpackage-utils
kdewebdev
ksc
libstdc++-docs
mercurial
mod_dav_svn
nasm
perltidy
python-docs
python-requests
python-six
rpmdevtools
rpmlint
systemtap-sdt-devel
systemtap-server