Explanation of yum commands in CentOS

Source: Internet
Author: User
Tags ftp site gtk imagemagick string find
Yum (all called YellowdogUpdater, Modified) is a Shell front-end package manager in Fedora, RedHat, and SUSE. Based on RPM Package management, you can automatically download and install the RPM package from the specified server, automatically handle dependencies, and install all dependent software packages at a time, you do not need to download and install it repeatedly. Yum provides commands for searching, installing, and deleting one or more software packages. the commands are concise and easy to remember.

Yum (all called Yellow dog Updater, Modified) is a Shell front-end package manager in Fedora, RedHat, and SUSE. Based on RPM Package management, you can automatically download and install the RPM package from the specified server, automatically handle dependencies, and install all dependent software packages at a time, you do not need to download and install it repeatedly. Yum provides commands for searching, installing, and deleting one or more software packages. the commands are concise and easy to remember.

The command format of yum is generally as follows: yum [options] [command] [package...]
[Options] are optional, including-h (help) and-y (when the installation prompt is "yes "), -q (the installation process is not displayed. [Command] is the operation object. [package...] is the operation object.

Some common commands are summarized as follows:

The fastest Image Plugin for automatic search: yum install yum-fastestmirror
Install the yum graphic window plug-in: yum install yumex
View the list of possible batch installations: yum grouplist

1 installation
Install yum install all
Yum install package1 install the specified installation package1
Yum groupinsall group1 installer group group1

2. update and upgrade
Yum update all updates
Yum update package1 update specified package1 package1
Yum check-update check updatable programs
Yum upgrade package1 upgrade specified package1 package1
Yum groupupdate group1 upgrade program group group1

3 search and display
Yum info package1: package1
Yum list displays all installed and installable packages
Yum list package1 displays package1 installation of the specified package
Yum groupinfo group1 display group1 information of the program group yum search string find the installation package based on the keyword string

4. delete a program
Yum remove | erase package1 delete package1
Yum groupremove group1 delete group1
Yum deplist package1 check package1 dependencies

5. clear cache
Yum clean packages clear software packages in the cache Directory
Yum clean headers clear headers in the cache Directory
Yum clean oldheaders clear old headers in the cache Directory
Yum clean, yum clean all (= yum clean packages; yum clean oldheaders) clear the packages and old headers in the cache Directory

For example, to install a game program group, first perform the following operations:
#: Yum grouplist
It can be found that the installable game package name is "Games and Entertainment", so that you can install it:
#: Yum groupinstall "Games and Entertainment"
All game packages are automatically installed. Here, the names of Games and Entertainment must be selected in double quotation marks, because the names of Games and Entertainment are ended when spaces are encountered in linux, therefore, you must tell the system to install the package named "Games and Entertainment" instead of "Games ".

You can also modify the configuration file/etc/yum. conf to select the installation source. It can be seen that the configuration program of yum is easy for many parties. For more detailed options and commands, you only need to follow the command prompt line below: man yum

Yum groupinstall "KDE (K Desktop Environment )"

Yum install pirut k3b mikmod

Yum groupinstall "Server Configuration Tools"

Yum groupinstall "Sound and Video"

# Yum groupinstall "GNOME Desktop Environment"

Yum groupinstall "Legacy Software Support"

Yum groupinstall "Development Libraries"

Yum groupinstall "Development Tools"

# Yum groupinstall "Windows File Server"

Yum groupinstall "System Tools"

Yum groupinstall "X Window System"

Yum install php-gd
Yum install gd-devel
Yum groupinstall "Chinese Support"

# Yum install samba-common // This execution will install samba-client together
# Yum install samba

Yum install gcc
Yum install cpp
Yum install gcc-c ++
Yum install ncurses
Yum install ncurses-devel
Yum install gd-devel php-gd
Yum install gd-devel
Yum install gcc
Yum install cpp
Yum install gcc-c ++
Yum install ncurses
Yum install ncurses-devel
Yum install gd-devel php-gd
Yum install gd-devel
Yum install zlib-devel
Yum install freetype-devel freetype-demos freetype-utils
Yum install libpng-devel libpng10 libpng10-devel
Yum install libjpeg-devel
Yum install ImageMagick
Yum install php-gd
Yum install flex
Yum install ImageMagick-devel

# Yum install system-config-bind
# Yum groupinstall "DNS Name Server" // security? Bind and bind-chroot suite
Yum groupinstall "MySQL Database "'

Yum clean all

Bytes -----------------------------------------------------------------------------------------------------------

Installing a fedora linux does not support Chinese input, which is tricky. You can barely try your luck with a few pinyin characters to see if Google can recognize them. And I met such a thing.
Yum install scim *-y

Yum command details:
The Redhat and Fedora software installation commands are rpm, but the biggest trouble with installing the software with rpm is to manually find a series of dependencies required to install the software, if the software does not need to be uninstalled, it is annoying to uninstall a dependency, which makes other software unavailable. Happily, Fedora finally launched the command yum similar to apt in ubuntu, making it easy to install the Fedora software. Yum has the following features:
* Multiple resource libraries (Repository) can be configured simultaneously)
* Simple configuration file (/etc/yum. conf)
* Automatically solves the dependency problem when rpm packages are added or deleted.
* Easy to use
* Maintain consistency with the RPM database
Yum, short for Yellow dog Updater Modified, was initially developed by Terra Soft, a developer of the yellow dog release and written in python. It was also called yup (yellow dog updater ), after being improved by Duke's Linux @ Duke development team, this name is available. Yum is designed to automatically upgrade, install/remove rpm packages, collect rpm package information, check dependencies, and automatically prompt users to solve the problem. The key to yum is to have a reliable repository. as the name suggests, this is the software repository. it can be an http or ftp site, or a local software pool, but it must contain the rpm header, the header contains various rpm package information, including descriptions, functions, provided files, dependencies, and so on. only by collecting and analyzing these headers can we automate the remaining tasks.
1. all configuration information of yum is stored in a file named yum. in the conf configuration file, it is usually located in the/etc directory, which is the top priority of the entire yum system. I checked this file in F9. let's take a look:
[Hanlong @ localhost F9 common documentation] $ sudo more/etc/yum. conf
Cachedir =/var/cache/yum
Keepcache = 0
Debuglevel = 2
Logfile =/var/log/yum. log
Exactarch = 1
Obsoletes = 1
Gpgcheck = 1
Plugins = 1
Metadata_expire = 1800
# Put your repos here or in separate files named file. repo
# In/etc/yum. repos. d

The following is a brief description of this document:
Cachedir: Directory of the yum cache, where yum stores the downloaded rpm Package and database, generally/var/cache/yum.
Debuglevel: debug level, 0-10. the default value is 2.
Logfile: the log file of yum. the default value is/var/log/yum. log.
Exactarch has two options: 1 and 0, indicating whether to upgrade only the same package as the cpu system of your installation package. if it is set to 1, if you have installed an i386 rpm, yum will not be upgraded with a 686 package.
Gpgchkeck = There are two options: 1 and 0, which respectively indicate whether or not to perform gpg verification. if this option is not selected, it is also checked by default.
2. well, the next step is to use yum. First, use yum to upgrade the software. most yum operations must have the permissions of super users. of course, you can use sudo.
Yum update is required. yum downloads the rpm header from the header Directory of the server and stores it in the local cache. This may take some time, but what is the cost of the time compared with the convenience provided by yum? After the header is downloaded, yum determines whether an updatable software package exists. If yes, yum will ask you for your opinion and whether it is updated. let's say y, it is always good to keep the system up to date. at this time, yum starts to download the software package and install it by calling rpm. This may take some time, depending on the number of software to be updated and network conditions, in case the network is disconnected, it doesn't matter. you can do it again. After the upgrade, you only need to use yum check-update every day to check whether there are any new ones. If yes, use yum update to keep the system up-to-date and block all discovered vulnerabilities. Use yum update packagename to upgrade a single package.
Now we can simply list some commands for yum software upgrade:
(Update: I used rpm to install wine one by one. I first installed the link and then installed the wine main package. but I just found a good post on the forum, install yum locally. The parameter is-localinstall.
$ Yum localinstall wine -*
In this way, yum will automatically install all dependencies without the need to install rpm one by one, saving a lot of work.
There is another parameter similar to this one:
$ Yum localupdate wine -*
If a new version of wine is available and you download it locally, you can update wine locally .)

1. list all software updates
Command: yum check-update

2. install all Update software
Command: yum update

3. only install the specified software
Command: yum install

4. update only the specified software
Command: yum update

5. list all security options? Software List
Command: yum list

3. use yum to install and uninstall software. The premise is that the software packages installed by yum are in rpm format.
The installation command is: yum install xxx. yum queries the database to check whether this software package exists. If yes, check its dependency conflict. If no dependency conflict exists, download and install it; if yes, you will receive a prompt asking if you want to install dependencies at the same time or delete conflicting packages. you can make your own judgment.
The delete command is yum remove xxx. like the installation command, yum also queries the database and provides a prompt to solve the dependency.
1. install the software package with YUM
Command: yum install

2. use YUM to delete a software package
Command: yum remove

4. use yum to query the software you want to install
We often encounter such a situation, we want to install a software, only know it is related to a certain aspect, but cannot know its name. In this case, the yum query function takes effect. You can use commands such as yum search keyword to search. for example, if you want to install Instant Messenger, but you don't know what it is, you can use commands such as yum search messenger to search, yum searches for all available rpm descriptions and lists all rpm packages related to messeger. Therefore, we may get gaim, kopete, and so on, and select from them.
Sometimes we install a package without knowing its purpose. we can use the yum info packagename command to  information
1. use YUM to find the software package
Command: yum search
2. list all installable software packages
Command: yum list
3. list all updatable software packages
Command: yum list updates
4. list all installed software packages
Command: yum list installed
5. list all installed but not in Yum Repository? Que na ?? Br/> command: yum list extras
6. list the specified software packages
Command: yum list 7. use YUM to obtain package information
Command: yum info 8. list information about all software packages
Command: yum info
9. list information of all updatable software packages
Command: yum info updates
10. list all installed? Software package information
Command: yum info installed
11. list all installed? But not in Yum Repository? Que na ?? Bank? Br/> command: yum info extras
12. list the files provided by the software package
Command: yum provides

5. clear YUM cache
Yum stores the downloaded software package and header in the cache, but does not automatically delete it. If we think they occupy disk space, we can use the yum clean command to clear them. more accurately, we use yum clean headers to clear the header and yum clean packages to clear the downloaded rpm package, yum clean all clear all
1. clear the software packages under the cache Directory (/var/cache/yum)
Command: yum clean packages

2. clear headers under the cache Directory (/var/cache/yum)

Command: yum clean headers

3. clear the old headers under the cache Directory (/var/cache/yum)

Command: yum clean oldheaders

4. clear the software packages and old headers in the cache Directory (/var/cache/yum ).

Command: yum clean, yum clean all (= yum clean packages; yum clean oldheaders)

You can use man to view all the preceding command parameters:
1. install the graphic version yumex: yum install yumex.
2. install an additional software warehouse:
Package repository for rpm.livna.org:
Rpm-ivh http://livna-dl.reloumirrors.net... Ease-7-2.noarch.rpm

Freshrpms.net package repository:
Rpm-ivh http://ftp.freshrpms.net/pub/fre... 1.1-1. fc. noarch. rpm

3. install the fastest source yum install yum-fastestmirror

The resources are really rich. from Centos to Ubuntu, ISO images, and upgrade packages, there are everything you need. I'm so happy and envious of my friends. But fortunately, we are also in the education network, and we can also get some light and download.
URL: ftp://ftp.sjtu.edu.cn/

The corresponding yum repo is
Name = Fedora updates
Baseurl = ftp://ftp.sjtu.edu.cn/fedora/linux/updates/?releasever/?basearch/
Enabled = 1
Gpgcheck = 0
Name = Fedora $ releasever-$ basearch
Baseurl = signature/
Enabled = 1
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file: // etc/pki/rpm-gpg/RPM-GPG-KEY

If the apt manager is installed on the machine, the corresponding source is
Repomd ftp://ftp.sjtu.edu.cn/fedora/linux/updates/$ (VERSION)/$ (ARCH )/

Repomd ftp://ftp.sjtu.edu.cn/fedora/linux/releases/$ (VERSION)/Everything/$ (ARCH)/OS/

This is different from the source format of yum.
The following describes How to Install scim under fedora.

1. what input method is suitable for me?
Fcitx and scim are currently relatively good input methods, but they have different characteristics. fcitx can only input Chinese characters, while scim can use different code tables to achieve Chinese and Japanese as needed... And other language input problems. If you only know Chinese or only English and Chinese, fcitx is a good choice because it is beautiful, compact, and practical. If you still need to enter Japanese or other languages, you should install scim. With proper configuration, you can enter whatever language you want to input, and what input method you want to use in the same language. Scim is highly scalable and stable. I chose scim.
2. what preparations do I need before installing a new input method?
If you choose fcitx or scim, we recommend that you delete the built-in Chinese input method. The method is as follows:
Rpm-qa | grep iiimf | xargs rpm-e
Rpm-qa | grep Chinput | xargs rpm-e
If any row prompts "rpm: no packages given for erase", it indicates that you do not have the input method in your system. Don't worry. just continue to look down.
Note: rpm-qa lists all installed rpm packages, and grep iiimf selects packages whose names contain iiimf, xargs rpm-e means to delete the packages listed above. The role of Xargs is to take the data passed through | as the parameter of the following command. This is like a filter. first, all the installation packages are put. Then, after grep, only rpm packages containing certain keywords are left, and then used in combination with xargs and rpm-e, delete the remaining packages that contain a specific keyword. In this way, the input method and related packages are deleted. The same is true for the Chinput below. If you have installed other input methods, such as fcitx, and want to Install scim, you 'd better follow the above steps to delete fcitx, the method is to change the position of iiimf to fcitx.
Before installing the new input method, you 'd better do this because multiple input methods have no advantages in one system at the same time. you can only use one, in addition, they may encounter problems at the same time. if you think about them, you will know that they will compete with each other. Therefore, you should ensure that there is no Chinese input method in the system. Verify by using the following methods:
Whereis fcitx
Whereis scim
Whereis miniChinput

3. When is the input method called by the system?
Many people do not know when the input method will be loaded in. I don't know why I cannot call the input method sometimes (because it may not be transferred in at all) of course, I don't know how to configure it to meet my own requirements.
Everyone knows that there are two commonly used desktop systems in linux, gnome and kde, which do not matter. they are all mounted on the X system. Simply put, the X system is the core, the underlying desktop system, gnome, kde, or other fvwm systems, it is just another layer of software between the X system and the user. Therefore, if you want to enable the input method when the X system is started, whether you are using gnome, kde, or any other desktop, you can call the input method. Because when it is their turn to start, the X system has been started and the input method has been transferred to the system. Then how does the X system start? Let's start with startx.
No matter what desktop system you use, it is started through startx. what is startx? An application or a script file? Why can it start various desktop systems and set them according to the corresponding configuration files? If you have any questions, enter whereis startx in the console.
After finding the path for storing startx, open it in the editor and find that it is a script file. The content of this script file may vary depending on the release version. if you know some shell languages, you can try to understand them, however, after reading it, you will find that the last xinit command is followed by some parameters. I tried to enter xinit under the console (note: do not perform this operation on the GUI)
It was found that the graphic interface was opened and pulled, but it was ugly. there were no functions available. the mouse could be moved, and there was a small window where commands could be entered. How can I quit? Ctrl + alt + backspace. in the past, startx was just a script. through analysis and settings of a series of configuration files, the xinit command was used to start the graphic interface. Both kde and gnome are completed in this script. So let's open the startx script again to see what has been done in it. If you take a closer look, you will find that there is a very conspicuous thing, that is,/etc/X11/xinit/xinitrc. this xinitrc seems very familiar and is always seen in other posts for configuring the input method, the script must have been run. Let's look at other things. In fact, shell is used to configure an xinit startup parameter, which is used to configure the desktop system. It is known that startx will execute a script for/etc/X11/xinit/xinitrc. let's open it and see what is in it.
One of the most valuable parts is a for loop. it executes all the scripts under/etc/X11/xinit/xinitrc. d/in turn. You can find out with patience. So what is in this directory? A file named xinput is related to the input. Wait, let's take a look at how startx to xinput.
First, execute the startx script file, which will execute the xinitrc script, and then the xinitrc script is called xinput. OK. Let's continue. open xinput.
4. install the software package
Rpm-Uvh scim-0.8.2-1.i586.rpm
Rpm-Uvh scim-chinese-0.2.6-1.i586.rpm

5. modify the configuration file
The next important step is to modify it.
The/etc/X11/xinit/xinitrc. d/xinput file enables SCIM to be started when X is started. I have seen many articles on the Internet, but I have never tried it. after self-testing, the simplest thing is to replace all Chinput in the xinput file with SCIM, and replace chinput with scim, save and restart X.
Zh_CN *)
If [-e/usr/bin/scim]; then
Elif [-e/usr/X11R6/bin/xcin]; then
Export LC_CTYPE = zh_CN.GB2312
XIM = "xcin-zh_CN.GB2312"


XIM_ARGS = "-d"

Then modify/etc/gtk-2.0/gtk. immodules and find this line:
"Xim" "X Input Method" "gtk20" "/usr/share/locale" "ko: ja: zh"
"Xim" "X Input Method" "gtk20" "/usr/share/locale" "en: ko: ja: zh"
This input method may also be used when you enter English.

After installation, run scim-setup and change the switch key of the input method to ctrl + space.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.