标签:des style http io ar color os 使用 sp
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#cat /etc/yum.conf[main]cachedir=/var/cache/yum/$basearch/$releasever #yum下载的RPM包的缓存目录keepcache=0 #缓存是否保存,1保存,0不保存。debuglevel=2 #调试级别(0-10),默认为2(具体调试级别的应用,我也不了解)。logfile=/var/log/yum.log #yum的日志文件所在的位置exactarch=1 #在更新的时候,是否允许更新不同版本的RPM包,比如是否在i386上更新i686的RPM包。obsoletes=1 #这是一个update的参数,具体请参阅yum(8),简单的说就是相当于upgrade,允许更新陈旧的RPM包。gpgcheck=1 #是否检查GPG(GNU Private Guard),一种密钥方式签名。plugins=1 #是否允许使用插件,默认是0不允许,但是我们一般会用yum-fastestmirror这个插件。installonly_limit=5 #允许保留多少个内核包。bugtracker_url=http://bugs.centos.org/set_project.php?project_id=19&ref=http://bugs.centos.org/bug_report_page.php?category=yumdistroverpkg=centos-release# This is the default, if you make this bigger yum won‘t see if the metadata# is newer on the remote and so you‘ll "gain" the bandwidth of not having to# download the new metadata and "pay" for it by yum not having correct# information.# It is esp. important, to have correct metadata, for distributions like# Fedora which don‘t keep old packages around. If you don‘t like this checking# interupting your command line usage, it‘s much better to have something# manually check the metadata once an hour (yum-updatesd will do this).# metadata_expire=90m# PUT YOUR REPOS HERE OR IN separate files named file.repo# in /etc/yum.repos.d |
|
1
2
3
4
5
|
[base]name=CentOS-$releasever - Base#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
[base] #方括号里面的是软件源的名称,将被yum取得并识别name=CentOS-$releasever - Base #这里也定义了软件 仓库的名称,通常是为了方便阅读配置文件,一般没什么作用,$releasever变量定义了发行版本,通常是5,6,7等数字,这个变量根据当前系统的版本架构不同而有不同的取值,这可以方便yum升级的时候选择 适合当前系统的软件包,以下同……#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ #上面的一行baseurl第一个字符是‘#‘表示该行已经被注释,将不会被读取,$basearch变量定义了系统的架构,可以是i386、x86_64、ppc等值这一行的意思是指定一个baseurl(源的镜像服务器地址)enabled=1 #这个选项表示这个repo中定义的源是启用的,0为禁用gpgcheck=1 #这个选项表示这个repo中下载的rpm将进行gpg的校验,已确定rpm包的来源是有效和安全的gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #定义用于校验的gpg密钥 |
|
1
|
#yum -y install createrepo |
|
1
|
#createrepo 软件包文件目录 |
|
1
|
#mkdir /mnt/cdrom |
|
1
|
#mount -t iso9660 /dev/cdrom /mnt/cdrom |
|
1
|
#ls /mnt/cdrom |
|
1
2
3
4
5
6
7
8
9
|
[root@LinuxHost yum.repos.d]# mkdir /mnt/cdrom[root@LinuxHost yum.repos.d]# mount -t iso9660 /dev/cdrom /mnt/cdrom mount: block device /dev/sr0 is write-protected, mounting read-only[root@LinuxHost yum.repos.d]# ls /mnt/cdromCentOS_BuildTag isolinux RPM-GPG-KEY-CentOS-Debug-6EFI Packages RPM-GPG-KEY-CentOS-Security-6EULA RELEASE-NOTES-en-US.html RPM-GPG-KEY-CentOS-Testing-6GPL repodata TRANS.TBLimages RPM-GPG-KEY-CentOS-6 |
|
1
|
#cd /etc/yum.repos.d/ |
|
1
|
#ls |
|
1
2
|
#mv CentOS-Base.repo CentOS-Base.repo.bak#mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo.bak |
|
1
|
#vi CentOS-Media.repo |
|
1
2
3
4
5
6
7
|
[root@LinuxHost yum.repos.d]# cat CentOS-Media.repo[C6-Media]name=CentOS-$releaserver-Mediabaseurl=file:///mnt/cdromgpcheck=1enabled=1gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-CentOS-6 |
|
1
2
3
4
5
6
|
[root@LinuxHost yum.repos.d]# yum repolistLoaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfilerepo id repo name statusC6-Media CentOS-$releaserver-Media 6,518repolist: 6,518 |
|
1
2
|
直接安装包(可指定版本号)yum install packages -y |
|
1
|
yum list |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
[root@LinuxHost yum.repos.d]# yum list |moreLoaded plugins: fastestmirror, refresh-packagekit, securityDetermining fastest mirrorsInstalled PackagesConsoleKit.x86_64 0.4.1-3.el6 @anaconda-CentOS-201410241409.x86_64/6.6ConsoleKit-libs.x86_64 0.4.1-3.el6 @anaconda-CentOS-201410241409.x86_64/6.6ConsoleKit-x11.x86_64 0.4.1-3.el6 @anaconda-CentOS-201410241409.x86_64/6.6DeviceKit-power.x86_64 014-3.el6 @anaconda-CentOS-201410241409.x86_64/6.6GConf2.x86_64 2.28.0-6.el6 @anaconda-CentOS-201410241409.x86_64/6.6 |
|
1
|
yum repolist |
|
1
2
3
4
5
6
|
[root@LinuxHost yum.repos.d]# yum repolistLoaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfilerepo id repo name statusC6-Media CentOS-$releaserver-Media 6,518repolist: 6,518 |
|
1
2
3
|
--disablerepo=name repolist禁用某个仓库,优先级高于配置文件定义的--enablerepo=name repolist启用某个仓库,优先级高于配置文件定义的yum list {all|installed|available}显示选项后可以使用globbing通配符 |
|
1
|
yum clean all |
|
1
2
3
4
5
|
[root@LinuxHost yum.repos.d]# yum clean allLoaded plugins: fastestmirror, refresh-packagekit, securityCleaning repos: C6-MediaCleaning up EverythingCleaning up list of fastest mirrors |
|
1
|
yum makecache |
|
1
|
yum update packages |
|
1
|
yum downgrade packages |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
[root@LinuxHost dvd]# rpm -Uvh zsh-4.3.10-8.el6_5.x86_64.rpm Preparing... ########################################### [100%] 1:zsh ########################################### [100%][root@LinuxHost dvd]# yum downgrade zshLoaded plugins: fastestmirror, refresh-packagekit, securitySetting up Downgrade ProcessLoading mirror speeds from cached hostfileResolving Dependencies--> Running transaction check---> Package zsh.x86_64 0:4.3.10-7.el6 will be a downgrade---> Package zsh.x86_64 0:4.3.10-8.el6_5 will be erased--> Finished Dependency ResolutionDependencies Resolved======================================================================================== Package Arch Version Repository Size========================================================================================Downgrading: zsh x86_64 4.3.10-7.el6 C6-Media 2.1 MTransaction Summary========================================================================================Downgrade 1 Package(s)Total download size: 2.1 MIs this ok [y/N]: yDownloading Packages:Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning TransactionWarning: RPMDB altered outside of yum. Installing : zsh-4.3.10-7.el6.x86_64 1/2 Cleanup : zsh-4.3.10-8.el6_5.x86_64 2/2 Verifying : zsh-4.3.10-7.el6.x86_64 1/2 Verifying : zsh-4.3.10-8.el6_5.x86_64 2/2 Removed: zsh.x86_64 0:4.3.10-8.el6_5 Installed: zsh.x86_64 0:4.3.10-7.el6 Complete![root@LinuxHost dvd]# rpm -qa zshzsh-4.3.10-7.el6.x86_64 |
|
1
|
yum remove|erease packages |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
[root@LinuxHost dvd]# yum remove zshLoaded plugins: fastestmirror, refresh-packagekit, securitySetting up Remove ProcessResolving Dependencies--> Running transaction check---> Package zsh.x86_64 0:4.3.10-7.el6 will be erased--> Finished Dependency ResolutionDependencies Resolved======================================================================================== Package Arch Version Repository Size========================================================================================Removing: zsh x86_64 4.3.10-7.el6 @C6-Media 4.8 MTransaction Summary========================================================================================Remove 1 Package(s)Installed size: 4.8 MIs this ok [y/N]: yDownloading Packages:Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction Erasing : zsh-4.3.10-7.el6.x86_64 1/1 Verifying : zsh-4.3.10-7.el6.x86_64 1/1 Removed: zsh.x86_64 0:4.3.10-7.el6 Complete![root@LinuxHost dvd]# rpm -qa zsh |
|
1
|
yum info packages |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
[root@LinuxHost dvd]# yum info zshLoaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfileAvailable PackagesName : zshArch : x86_64Version : 4.3.10Release : 7.el6Size : 2.1 MRepo : C6-MediaSummary : A powerful interactive shellURL : http://zsh.sunsite.dk/License : BSDDescription : The zsh shell is a command interpreter usable as an interactive login : shell and as a shell script command processor. Zsh resembles the ksh : shell (the Korn shell), but includes many enhancements. Zsh supports : command line editing, built-in spelling correction, programmable : command completion, shell functions (with autoloading), a history : mechanism, and more. |
|
1
|
yum search KEYWORD |
|
1
2
3
4
5
6
7
8
|
[root@LinuxHost dvd]# yum search zshLoaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfile=================================== N/S Matched: zsh ===================================python-twisted-core-zsh.x86_64 : Tab completion for Zsh and Twisted Corezsh-html.x86_64 : Zsh shell manual in html formatzsh.x86_64 : A powerful interactive shell Name and summary matches only, use "search all" for everything. |
|
1
|
yum provides|whatprovides /path/file |
|
1
2
3
4
5
6
7
8
9
10
11
|
[root@LinuxHost dvd]# yum provides /usr/bin/yumLoaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfileyum-3.2.29-60.el6.centos.noarch : RPM package installer/updater/managerRepo : C6-MediaMatched from:Filename : /usr/bin/yumyum-3.2.29-60.el6.centos.noarch : RPM package installer/updater/managerRepo : installedMatched from:Other : Provides-match: /usr/bin/yum |
|
1
|
yum grouplist |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
[root@LinuxHost dvd]# yum grouplist |moreLoaded plugins: fastestmirror, refresh-packagekit, securitySetting up Group ProcessLoading mirror speeds from cached hostfileInstalled Groups: Additional Development Base Console internet tools Desktop Development tools Dial-up Networking Support Directory Client E-mail server Fonts General Purpose Desktop Graphical Administration Tools Hardware monitoring utilities Input Methods Legacy UNIX compatibility Legacy X Window System compatibility NFS file server Network Infrastructure Server Network file system client Networking Tools Performance Tools Perl Support Security Tools System administration tools Web Server X Window SystemInstalled Language Groups:--More-- |
|
1
|
yum groupinfo “group_name" |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
[root@LinuxHost dvd]# yum groupinfo "Development tools" |moreLoaded plugins: fastestmirror, refresh-packagekit, securitySetting up Group ProcessLoading mirror speeds from cached hostfileGroup: Development tools Description: A basic development environment. Mandatory Packages: autoconf automake binutils bison flex gcc gcc-c++ gettext libtool make patch pkgconfig redhat-rpm-config rpm-build Default Packages: byacc cscope ctags cvs diffstat doxygen elfutils gcc-gfortran--More--信息太多省略 |
|
1
2
|
yum groupinstall "group_name"yum install @group_name |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
[root@LinuxHost dvd]# yum groupinstall "Server Platform Development"Loaded plugins: fastestmirror, refresh-packagekit, securitySetting up Group ProcessLoading mirror speeds from cached hostfilePackage zlib-devel-1.2.3-29.el6.x86_64 already installed and latest versionPackage glibc-devel-2.12-1.149.el6.x86_64 already installed and latest versionPackage libstdc++-devel-4.4.7-11.el6.x86_64 already installed and latest versionPackage ncurses-devel-5.7-3.20090208.el6.x86_64 already installed and latest versionPackage 1:dbus-devel-1.2.24-7.el6_3.x86_64 already installed and latest versionPackage db4-devel-4.7.25-18.el6_4.x86_64 already installed and latest versionResolving Dependencies--> Running transaction check---> Package krb5-devel.x86_64 0:1.10.3-33.el6 will be installed省略。。。。。。。 |
|
1
2
|
yum groupremove "group_name"yum remove @group_name |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
[root@LinuxHost dvd]# yum groupremove "Server Platform Development"Loaded plugins: fastestmirror, refresh-packagekit, securitySetting up Group ProcessLoading mirror speeds from cached hostfileResolving Dependencies--> Running transaction check---> Package db4-devel.x86_64 0:4.7.25-18.el6_4 will be erased--> Processing Dependency: db4-devel for package: 4:perl-devel-5.10.1-136.el6.x86_64---> Package dbus-devel.x86_64 1:1.2.24-7.el6_3 will be erased---> Package glibc-devel.x86_64 0:2.12-1.149.el6 will be erased--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.4.7-11.el6.x86_64---> Package libstdc++-devel.x86_64 0:4.4.7-11.el6 will be erased--> Processing Dependency: libstdc++-devel = 4.4.7-11.el6 for package: gcc-c++-4.4.7-11.el6.x86_64省略。。。。。。 |
|
1
|
yum groupupdate "group_name" |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
[root@LinuxHost dvd]# yum groupupdate "Server Platform Development"Loaded plugins: fastestmirror, refresh-packagekit, securitySetting up Group ProcessLoading mirror speeds from cached hostfilePackage zlib-devel-1.2.3-29.el6.x86_64 already installed and latest versionPackage glibc-devel-2.12-1.149.el6.x86_64 already installed and latest versionPackage libstdc++-devel-4.4.7-11.el6.x86_64 already installed and latest versionPackage ncurses-devel-5.7-3.20090208.el6.x86_64 already installed and latest versionPackage 1:dbus-devel-1.2.24-7.el6_3.x86_64 already installed and latest versionPackage db4-devel-4.7.25-18.el6_4.x86_64 already installed and latest versionResolving Dependencies--> Running transaction check---> Package krb5-devel.x86_64 0:1.10.3-33.el6 will be installed--> Processing Dependency: libselinux-devel for package: krb5-devel-1.10.3-33.el6.x86_64省略 |
|
1
|
yum localinstall packages |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
[root@LinuxHost dvd]# yum localinstall zsh-4.3.10-8.el6_5.x86_64.rpm Loaded plugins: fastestmirror, refresh-packagekit, securitySetting up Local Package ProcessExamining zsh-4.3.10-8.el6_5.x86_64.rpm: zsh-4.3.10-8.el6_5.x86_64Marking zsh-4.3.10-8.el6_5.x86_64.rpm to be installedLoading mirror speeds from cached hostfileResolving Dependencies--> Running transaction check---> Package zsh.x86_64 0:4.3.10-8.el6_5 will be installed--> Finished Dependency ResolutionDependencies Resolved======================================================================================== Package Arch Version Repository Size========================================================================================Installing: zsh x86_64 4.3.10-8.el6_5 /zsh-4.3.10-8.el6_5.x86_64 4.8 MTransaction Summary========================================================================================Install 1 Package(s)Total size: 4.8 MInstalled size: 4.8 MIs this ok [y/N]: 省略信息。。。。。。 |
|
1
|
yum localinstall packages --nogpgcheck |
|
1
|
yum check-update |
|
1
2
3
|
[root@LinuxHost dvd]# yum check-updateLoaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfile |
|
1
|
yum reinstall packages |
|
1
|
yum deplist packages |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
[root@LinuxHost dvd]# yum deplist pythonLoaded plugins: fastestmirror, refresh-packagekit, securityFinding dependencies: Loading mirror speeds from cached hostfilepackage: python.x86_64 2.6.6-52.el6 dependency: python-libs(x86-64) = 2.6.6-52.el6 provider: python-libs.x86_64 2.6.6-52.el6 dependency: libutil.so.1()(64bit) provider: glibc.x86_64 2.12-1.149.el6 dependency: libdl.so.2()(64bit) provider: glibc.x86_64 2.12-1.149.el6 dependency: rtld(GNU_HASH) provider: glibc.x86_64 2.12-1.149.el6 provider: glibc.i686 2.12-1.149.el6 dependency: libm.so.6()(64bit) provider: glibc.x86_64 2.12-1.149.el6 dependency: libpython2.6.so.1.0()(64bit) provider: python-libs.x86_64 2.6.6-52.el6 dependency: libpthread.so.0()(64bit) provider: glibc.x86_64 2.12-1.149.el6 dependency: libc.so.6(GLIBC_2.2.5)(64bit) provider: glibc.x86_64 2.12-1.149.el6 |
|
1
|
yum history |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
[root@LinuxHost dvd]# yum historyLoaded plugins: fastestmirror, refresh-packagekit, securityID | Login user | Date and time | Action(s) | Altered------------------------------------------------------------------------------- 19 | root <root> | 2014-11-26 02:51 | Erase | 1 18 | root <root> | 2014-11-26 02:49 | Downgrade | 1 < 17 | root <root> | 2014-11-25 07:08 | Install | 1 > 16 | root <root> | 2014-11-25 06:46 | Install | 3 15 | root <root> | 2014-11-25 04:02 | Install | 1 14 | root <root> | 2014-11-24 13:35 | Install | 3 13 | root <root> | 2014-11-24 13:14 | Install | 1 12 | root <root> | 2014-11-24 12:13 | Install | 1 11 | root <root> | 2014-11-24 12:12 | Install | 10 10 | root <root> | 2014-11-24 12:10 | Install | 34 9 | root <root> | 2014-11-24 11:43 | Install | 1 8 | root <root> | 2014-11-24 11:12 | Install | 15 7 | root <root> | 2014-11-24 11:11 | Install | 1 6 | root <root> | 2014-11-24 08:58 | Install | 33 < 5 | root <root> | 2014-11-21 13:14 | Install | 1 > 4 | root <root> | 2014-11-12 20:21 | Install | 1 3 | root <root> | 2014-11-12 19:25 | Install | 1 2 | root <root> | 2014-11-12 11:14 | Install | 5 1 | System <unset> | 2014-11-12 09:42 | Install | 988 history list |
|
1
|
yum check |
|
1
2
3
|
[root@LinuxHost dvd]# yum checkLoaded plugins: fastestmirror, refresh-packagekit, securitycheck all |
标签:des style http io ar color os 使用 sp
原文地址:http://blog.csdn.net/androidmylove/article/details/41518937