YUM configuration file

Create a container position in /etc/yum.repos.d, extension must be .repo

#cd  /etc/yum.repos.d

#vim yum.repo create a repository file name can easily define, write the following contents in the file

[Base] # represents the container name, must exist in parentheses, the name of which can be taken lightly

name = base # illustrate the significance of the container, can easily write

baseurl = ftp:. //192.168.0.6/pub/Server # 192 168. 0. 6 YUM is your source address, this is very important.

enabled = 1 # if start = 0 is not started, do not start you can not use that source

gpgcheck = 0 # Verify Can Do

gpgkey = file: /// etc / pki / rpm-gpg / RPM-GPG-KEY-redhat-release # key can not verify.

Command: #yum repolist all             display containers currently in use which

         If the query is out of the container, status to disabled, the To profile, as enabled = 1

/etc/yum.conf

         yum.conf This profile is mainly yum client to use, go inside the main provisions rpm with yum package of information on the server.

         [Main] #main beginning of the block is used to configure the client may also specify a source yum after main (not recommended), yum specify the same source /etc/yum.repo.d

cacheDir = / var / cache / yum

#cachedir: yum cache directory, yum rpm packages and databases in this storage download, usually / var / cache / yum.

keepcache = 0 # 0 means no saving the downloaded file, 1 save the downloaded file, the default is not saved

debuglevel=2

#debuglevel: debug level, 0──10, the default installation is two seemingly only records and delete records

logfile = / var / log / yum.log # log file specified yum

pkgpolicy = policy newest # packet, if the configuration of the multi-source yum, there are different versions of the same software on different sources of yum, Newest install the latest version, the value of the lastest, yum on the server ID will be listed in alphabetical order, Finally, select the software installed on the server

distroverpkg=centos-release

# Specify a package, yum will judge you according to release this package, the default is redhat-release, it can be any rpm package installed for their own release.

tolerant=1

#tolerent, there are two options 1 and 0, indicating whether yum tolerate errors associated with the command-line package occur, for example, you want to install three packages 1, 2, and 3 of which had been installed, if you set 1, the error message does not appear yum. The default is 0.

exactarch = 1

#exactarch, there are two options 1 and 0, does it mean you just upgrade and install the same package package cpu system, if set to 1, if you a rpm i386 installed, the yum package does not come with the i686 upgrade.

retries=20

#retries, network connection retry after an error occurs, if set to 0, it will infinitely try again.

obsoletes=1

gpgcheck=1

# Gpgchkeck = 0 and 1 have two options, whether to represent the gpg check whether, if not this one, the default is to check.

plugins = 1 # whether to enable plug-ins, default 1 is allowed, 0 if not allowed

reposdir = / etc / yy.rm # default file extension /etc/yum.repos.d/ low xx.repo

# Include the default will be coming in regardless of the configuration file that is /etc/yum.repos.d/xx.repo how many how many of each there are [name] Finally, in fact, have been integrated into one which wants to see repeated [ name] should be behind the front cover - front or back cover it? Test behind the front cover is enabled

exclude=xxx

#exclude exclude certain software upgrades in addition to the list, you can use wildcards, list the items to use separated by a space, such as landscaping for this package is installed, the Chinese patch friend particularly useful.

keepcache=[1 or 0]

# Set keepcache = 1, yum retains cache after successful installation package headers (headers) and software package. The default value is not saved keepcache = 0

reposdir = [directory containing the files .repo absolute path]

# This option specifies the absolute path to the user .repo file. ([Repository] effect the same fragment /etc/yum.conf file) file containing information .repo depots. in

 

YUM command

Remove the software installed with YUM yum install xxx, yum will query the database, with or without this package, if there is, then check its dependent relationship conflict, if not rely on conflict, so best to download and install; if so, it will be given prompt asking whether you want to install dependence, or delete the conflicting package, you can judge for yourself.

Delete command is, yum remove xxx, as with the installation, yum will query the database, gives tips to resolve dependencies.

YUM to install packages

Command: yum install

YUM remove packages

Command: yum remove

YUM query software with information, we often encounter such a situation, you want to install a software, only that it and certain aspects relating to, but not exactly know its name. Then yum query feature is working. You can use this command yum search keyword to search, for example, we want to install a Instant Messenger, but do not know in the end what, this time may wish to search for such a command yum search messenger, yum will search all the available rpm description of , lists all the relevant descriptions and messeger rpm package, so we may get gaim, kopete, etc. and choose from there. Sometimes we also encounter the installation of a package, but do not know its purpose, we can use yum info packagename this command to obtain information.

1. Use YUM to find package

Command: yum search

2. List all packages that can be installed

Command: yum list

3. List all packages that can be updated

Command: yum list updates

4. List all installed packages

Command: yum list installed

5. List all installed packages but not within the Yum Repository

Command: yum list extras

6. List the specified package

Command: yum list

7. Getting information about packages YUM

Command: yum info

8. List all the information package

Command: yum info

9. List all the updated information package

Command: yum info updates

10. List all the installed package information

Command: yum info installed

11. List all installed but not in the package Yum Repository Information

Command: yum info extras

12. Listing packages which provide file

Command: yum provides

Clear YUM cache

yum will download the package and the header is stored in the cache are not automatically deleted. If we feel that they take up disk space, you can use yum clean commands to clear, more precise usage is yum clean headers clear the header, yum clean packages remove the downloaded rpm package, yum clean all peremptorily child ends

1. Package Clear the cache directory (/ var / cache / yum) under

命令:yum clean packages

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

Command: yum clean headers

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

Command: yum clean

Oldheaders

4. packages and old headers clear the cache directory (/ var / cache / yum) under

命令:yum clean, yum clean

all (= yum clean packages; yum clean oldheaders)

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11108736.html