Linux yum commands and yum commands
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 & #124; 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" // set bind and bind-chroot
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.
Solution:
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
[Main]
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 the software that can be installed
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.
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 software packages installed but not in Yum Repository
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 information about all installed software packages
Command: yum info installed
11. list information about all software packages installed but not in Yum Repository
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
[Updates]
Name = Fedora updates
Baseurl = ftp://ftp.sjtu.edu.cn/fedora/linux/updates/?releasever/?basearch/
Enabled = 1
Gpgcheck = 0
[Fedora]
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
XIM = "SCIM"
Elif [-e/usr/X11R6/bin/xcin]; then
Export LC_CTYPE = zh_CN.GB2312
XIM = "xcin-zh_CN.GB2312"
Fi
;;
..............................
SCIM)
XIM_PROGRAM = scim
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"
Changed:
"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.