[Switch] Linux uses yum to install software and uninstall software

 

Transferred from Baidu Library: http://wenku.baidu.com/view/ccbf86074a7302768e993957.html

 

Using yum to install and uninstall software, there is a premise that the packages installed by yum are in rpm format.

The installation command is, yum install ~ , yum will query the database to see if there is this package, and if so, check

Its dependency conflict relationship, if there is no dependency conflict, then it is best to download and install ; if there is, a prompt will be given to ask

Whether you want to install dependencies at the same time, or delete conflicting packages, you can make your own judgment;

The command to delete is yum remove ~ . Like installation, yum will also query the database and give solutions to dependencies

Relationship tips.

Where ~ represents the software name

1. Install the package command with YUM : yum install ~

2. Use YUM to remove the package command: yum remove ~

2. Use yum to query the software you want to install

We often encounter such a situation, want to install a software, only know that it is related to a certain aspect, but can not be sure

know its name. At this time , the query function of yum comes into play. We can use yum search keyword like this

command to search, for example, if we want to install an Instant Messenger , but we don't know which ones are, then

You may wish to use a command such as yum search messenger to search, yum will search all available rpm descriptions, list

Out all the rpm packages related to messeger in the description , so we may get gaim , kopete , etc., and from

choose.

Sometimes we also encounter a package installed, but we do not know its purpose, we can use yum info packagename this

command to obtain information.

1. Use YUM to find packages

Command: yum search ~

2. List all installable packages

Command: yum list

3. List all updatable packages

Command: yum list updates

4. List all installed packages

Command: yum list installed

5. List all installed packages but not in Yum Repository

Command: yum list extras

6. List the specified packages

Command: yum list ~

7. Use YUM to get package information

Command: yum info ~

8. List information about all packages

Command: yum info

9. List all updatable package information

Command: yum info updates

10. List all installed package information

Command: yum info installed

11. List all installed packages but not in Yum Repository

Command: yum info extras

12. List which files are provided by the package

Command: yum provides~

3. Clear YUM cache

yum will store downloaded packages and headers in the cache and will not delete them automatically. if we feel it

They take up disk space and can be removed using the yum clean command, or more precisely yum clean headers

Clear header , yum clean packages to clear downloaded rpm packages, yum clean all to clear all.

1. Clear the packages in the cache directory (/var/cache/yum)

Command: yum clean packages

2. Clear the headers under the cache directory (/var/cache/yum)

Command: yum clean headers

3. Clear the old headers in the cache directory (/var/cache/yum)

命令:yum clean oldheaders

4. Clear the packages and old headers in the cache directory (/var/cache/yum)

命令:yum clean, yum clean all (= yum clean packages; yum clean oldheaders)

4. Example of using the yum command tool

yum update upgrade system

yum install ~ install the specified package

yum update ~ upgrade the specified package

yum remove - uninstall the specified software

yum grouplist View installed and available software groups in the system, available ones can be installed

yum groupupinstall ~ install one of the available software groups shown in the previous command

yum groupupdate — update packages of the specified software group

yum grooupremove ~ uninstall packages in the specified software group

yum deplist - Query the dependencies of the specified package

yum list yum\* list all packages starting with yum

yum localinstall ~ install rpm packages from hard disk and use yum to resolve dependencies

5.Yum advanced management application skills

Tip 1: Speed ​​up your yum . Use yum 's extension plug-in yum - fastestmirror , I personally think this plug-in

The software is very effective, the speed is really improved significantly,

#yum y install yumfastestmirror

Note that on Centos 4 , the name is yumplugin fastestmirror

Tip 2: Extend your rpm package. Many packages are not officially available . How can I get it ? Do you want me to compile it myself ? Well, you install this

A package , this is the oh redhat5 . You can go to php#B">http://dag.wieers.com/rpm/FAQ.php#B this

come to find

# Red Hat Enterprise Linux 5 / i386:

rpmUhvhttp://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforgerelease0.3.61.el5.rf.i3

86.rpm

# Red Hat Enterprise Linux 5 / x86_64:

rpmUhvhttp://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforgerelease0.3.61.el5.r

f.x86_64.rpm

#ATrpms

[atrpms]

name= CentOS$releasever ATrpms

baseurl=http://dl.atrpms.net/el$releasever$basearch/atrpms/stable

gpgcheck=1

gpgkey=http://ATrpms.net/RPMGPGKEY.atrpms

Tip 3: Find rpm . What if you still can't find the rpm package? Go to the following website. Basically all collected, you

You can use advanced search to see . http://rpm.pbone.net/

Tip 4: Download the RPM source package through the yum tool . The premise is that the package yum - utils is installed . If there is an installation

Dress up.

#yum downloader ‐‐ source ; RPM source package

#yum downloader ‐‐source vsftpd

Of course , if there is no source package, a source package must be added .

[linuxsrc]

name=Centos$releasever$basearchSource

baseurl=http://mirrors.163.com/centos/$releasever/os/SRPMS/

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpmgpg/RPMGPGKEYredhatrelease

Tip 5: Software group installation

Development package , we can use the package to install.

#yum grouplist This will list all packages

For example, we want to install development-related packages

#yum groupinstall "Development Libraries"

#yum groupinstall "Development Tools"

For example, we want to install Chinese support

#yum groupinstall "Chinese Support"

#yum deplist package1 #View program package1 dependencies

The use of all the above command parameters can be viewed with man :

[root@F7 common documents ]$ man yum

yum y install package name (support * ): automatically select y , fully automatic

yum install package name (support * ): manually select y or n

yum remove package name ( * is not supported )

rpm ivh package name (support * ): install rpm package

rpm - e package name (not supported * ): uninstall rpm package

 

Upgrade the kernel: #yum install kernelheaders kernel devel __

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326462573&siteId=291194637