当前位置:网站首页>Yum command

Yum command

2022-06-25 19:14:00 kankan231

yum The order is in Fedora and RedHat as well as SUSE Based on rpm Package manager for , It enables system managers to interact and automate with management in more detail RPM software package , Can be automatically downloaded from the specified server RPM Package and install , Dependency relationships can be handled automatically , And install all the dependent packages at once , No need to download it over and over again 、 install . yum Provides search 、 install 、 Delete a 、 A set or even a whole package of commands , And the command is simple and easy to remember .


yum Operation principle

yum Our work needs two parts to cooperate , Part of it is yum The server , And that is client Of yum Tools . The working principles of the two parts are introduced below .

  • yum The server

    All that's going to be released rpm Bags are all placed in yum Server to provide others to download ,rpm Package basis kernel Version number of ,cpu The version numbers of are compiled and released respectively .yum The server only needs to provide a simple download ,ftp perhaps httpd It can be in any form .yum The most important part of the server is to sort out every rpm Basic information about the package , Include rpm The version number of the package ,conf file ,binary Information , And the critical dependency information . stay yum The server provides createrepo Tools , Used for holding rpm The basic profile of the package is made into a " detailed list ", This piece of " detailed list "" It's about describing each rpm Bag spec Information in the file .

  • yum client End

    client Every time you call yum install perhaps search When , Will go to analyze /etc/yum.repos.d All of the following are with .repo Profile at the end , These profiles specify yum The address of the server .yum Will go to " to update "yum On the server rpm package " detailed list ", And then put " detailed list " Download and save to yum Their own cache Inside , according to /etc/yum.conf Internal configuration ( The default is in /var/cache/yum below ), Every time you call yum I always go to this when I pack cache Look down the list " detailed list ", according to " detailed list " Inside rpm Package description to determine the name of the installation package , Version number , Required dependency packages, etc , Then go again. yum Server download rpm Package installation .( The premise is that there is no rpm Bag cache)



yum check-update  Check all software packages that can be updated
yum update  Download all the packages installed in the update system
yum upgrade  Massive version upgrades , And yum update The difference is , Even old obsolete packages are upgraded
yum install <packages>  Install new packages
yum update <packages>  Update the specified package
yum remove <packages>  Uninstall the specified package
yum groupinstall <groupnames>  Install packages in the specified software group
yum groupupdate <groupnames>  Update packages in the specified software group
yum groupremove <groupnames>  Uninstall packages from the specified software group
yum grouplist  View the installed and available software groups in the system
yum list  List all the resources that can be installed or updated and those that have been installed rpm package
yum list <regex>  List the resources that can be installed or updated and those that have been installed that match regular expressions in the repository rpm package
yum list available  List all the resources that can be installed in the repository rpm package
yum list available <regex>  Lists all of the resources that match regular expressions that can be installed in the repository rpm package
yum list updates  List all updates in the repository rpm package
yum list updates <regex>  Lists all the resources in the repository that match regular expressions that can be updated rpm package
yum list installed  List all installed resources in the repository rpm package
yum list installed <regex>  Lists all installed... That match regular expressions in the repository rpm package
yum list extras  List installed but not included in the repository rpm package
yum list extras <regex>  List the installed but not included resources that match regular expressions rpm package
yum list recent   List the packages that have recently been added to the repository
yum search <regex>  Check the names of all available software 、 describe 、 Overview and listed maintainers , Finds a value that matches a regular expression
yum provides <regex>  Check the files included in the software package and the functions provided by the software , Finds a value that matches a regular expression
yum clean headers  Clear the cache of rpm The header file
yum clean packages  Clear cache rpm Package file
yum clean all  Clear the cache of rpm Header files and package files
yum deplist <packages>  Display dependency information for the package
When first used yum or yum When the repository is updated ,yum Will automatically download all needed he ade rs Placed in /var/cache /yum Under the table of contents , It may take a long time .
You can also use yum info Command to list package information ,yum info The available parameters are the same as yum list In the same .
yum Commands can also be used -y Parameters are used for ye s Answer the questions raised when the command runs , such as yum -y install vsftpd, So you don't have to type in when you install the software yes/y 了

yum Example of command tool use

1、 Upgrade system
[[email protected] ~]#yum update

2、 Install the specified package , I like to use the following command most
[[email protected] ~]# yum -y install vsftpd

3、 Upgrade the specified package
[[email protected] ~]# yum -y update mysql

4、 Uninstall the specified package
[[email protected] ~]# yum -y remore vsftpd mysql

5、 View the installed and available software groups in the system , For available software groups , You can choose to install
[[email protected] ~]# yum grouplist

6、 Install one of the available software groups shown in the previous command , God's editor -Emacs, About... Installed 12 Software package
[[email protected] ~]# yum -y groupinstall Emacs

7、 Update packages in the specified software group
[[email protected] ~]# yum -y groupupdate Emacs

8、 Uninstall packages from the specified software group , about Emacs, It was installed at the time of installation 12 Software package , But when I unload it, I only unload it 4 Software package !
[[email protected] ~]# yum -y groupremove Emacs

9、 Clear the cache of rpm Header files and package files
[[email protected] ~]# yum clean all

10、 Search for related packages
[[email protected] ~]# yum -y search Emacs

11、 Displays information about the specified package
[[email protected] ~]# yum info Emacs
and rpm -qi emacs The information displayed is similar , But it's not exactly the same

12、 Query the dependency information of the specified package ,emacs It depends on a lot of modules
[[email protected] ~]# yum deplist emacs

13、 List all to yum The first package
[[email protected] ~]# yum list yum\*

14、 List installed but not included in the repository rpm package
# yum list extras

原网站

版权声明
本文为[kankan231]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202190519261662.html