yum-plugin-versionlock插件的使用

1.查看系统中已安装的mysql数据库的版本

[root@localhost ~]# yum list | grep mysql
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
mysql.x86_64                           5.1.71-1.el6                      installed
mysql-libs.x86_64                             5.1.71-1.el6                      @anaconda-RedHatEnterpriseLinux-201311111358.x86_64/6.5
mysql-server.x86_64                  5.1.71-1.el6                      installed
apr-util-mysql.x86_64                        1.3.9-3.el6_0.1                   base  
bacula-director-mysql.x86_64            5.0.0-12.el6                      base  
bacula-storage-mysql.x86_64            5.0.0-12.el6                      base  
dovecot-mysql.x86_64                      1:2.0.9-7.el6                     base  
freeradius-mysql.x86_64                    2.1.12-4.el6_3                    base  
libdbi-dbd-mysql.x86_64                    0.8.3-5.1.el6                     base  
mod_auth_mysql.x86_64                    1:3.0.0-11.el6_0.1                base  
mysql.x86_64                                    5.1.73-3.el6_5                    updates
mysql-bench.x86_64                          5.1.73-3.el6_5                    updates
mysql-connector-java.noarch            1:5.1.17-6.el6                    base  
mysql-connector-odbc.x86_64            5.1.5r1144-7.el6                  base  
mysql-devel.i686                                 5.1.73-3.el6_5                    updates
mysql-devel.x86_64                            5.1.73-3.el6_5                    updates
mysql-embedded.i686                         5.1.73-3.el6_5                    updates
mysql-embedded.x86_64                     5.1.73-3.el6_5                    updates
mysql-embedded-devel.i686                 5.1.73-3.el6_5                    updates
mysql-embedded-devel.x86_64            5.1.73-3.el6_5                    updates
mysql-libs.i686                                    5.1.73-3.el6_5                    updates
mysql-libs.x86_64                                5.1.73-3.el6_5                    updatesmysql-server.x86_64                                     5.1.73-3.el6_5                    updates
mysql-test.x86_64                              5.1.73-3.el6_5                    updates
php-mysql.x86_64                              5.3.3-27.el6_5                    updates
qt-mysql.i686                                     1:4.6.2-28.el6_5                  updates
qt-mysql.x86_64                                 1:4.6.2-28.el6_5                  updates
rsyslog-mysql.x86_64                         5.8.10-8.el6                        base  

2.安装yum-plugin-versionlock插件

[root@localhost ~]# yum -y install yum-plugin-versionlock
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Resolving Dependencies
--&gt Running transaction check
---&gt Package yum-plugin-versionlock.noarch 0:1.1.30-17.el6_5 will be installed
--&gt Finished Dependency Resolution

Dependencies Resolved

==================================================================================================================
 Package                             Arch                Version                       Repository            Size
==================================================================================================================
Installing:
 yum-plugin-versionlock              noarch              1.1.30-17.el6_5               updates               28 k

Transaction Summary
==================================================================================================================
Install       1 Package(s)

Total download size: 28 k
Installed size: 43 k
Downloading Packages:
yum-plugin-versionlock-1.1.30-17.el6_5.noarch.rpm                                          |  28 kB     00:00    
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
 Userid: "CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>"
 From  : http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : yum-plugin-versionlock-1.1.30-17.el6_5.noarch                                                  1/1
  Verifying  : yum-plugin-versionlock-1.1.30-17.el6_5.noarch                                                  1/1

Installed:
  yum-plugin-versionlock.noarch 0:1.1.30-17.el6_5                                                                

Complete!

3.锁定mysql-server的当前版本

[root@localhost ~]# yum versionlock mysql-server
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager, versionlock
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Adding versionlock on: 0:mysql-server-5.1.71-1.el6
versionlock added: 1

4.查看系统中锁定的软件包的版本号

[root@localhost ~]# yum versionlock list
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager, versionlock
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
0:mysql-server-5.1.71-1.el6.*
versionlock list done

5.检查mysql-server是否有可用更新

[root@localhost ~]# yum update mysql-server
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager, versionlock
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Update Process
No Packages marked for Update

6.将mysql-server的当前版本从系统中解锁

[root@localhost ~]# yum versionlock delete '0:mysql-server-5.1.71-1.el6.*'
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager, versionlock
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Deleting versionlock for: 0:mysql-server-5.1.71-1.el6.*
versionlock deleted: 1

如果解锁所有软件包的版本,执行下面命令

[root@localhost ~]# yum versionlock clean
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager, versionlock
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
versionlock added: 0


7.更新系统中的mysql-server版本

[root@localhost ~]# yum update mysql-server
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager, versionlock
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Update Process
Resolving Dependencies
--&gt Running transaction check
---&gt Package mysql-server.x86_64 0:5.1.71-1.el6 will be updated
---&gt Package mysql-server.x86_64 0:5.1.73-3.el6_5 will be an update
--&gt Processing Dependency: mysql = 5.1.73-3.el6_5 for package: mysql-server-5.1.73-3.el6_5.x86_64
--&gt Running transaction check
---&gt Package mysql.x86_64 0:5.1.71-1.el6 will be updated
---&gt Package mysql.x86_64 0:5.1.73-3.el6_5 will be an update
--&gt Processing Dependency: mysql-libs = 5.1.73-3.el6_5 for package: mysql-5.1.73-3.el6_5.x86_64
--&gt Running transaction check
---&gt Package mysql-libs.x86_64 0:5.1.71-1.el6 will be updated
---&gt Package mysql-libs.x86_64 0:5.1.73-3.el6_5 will be an update
--&gt Finished Dependency Resolution

Dependencies Resolved

===========================================================================================
 Package                      Arch                   Version                        Repository               Size
===========================================================================================
Updating:
 mysql-server                 x86_64                 5.1.73-3.el6_5                 updates                 8.6 M
Updating for dependencies:
 mysql                        x86_64                 5.1.73-3.el6_5                 updates                 894 k
 mysql-libs                   x86_64                 5.1.73-3.el6_5                 updates                 1.2 M

Transaction Summary
===========================================================================================
Upgrade       3 Package(s)

Total download size: 11 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): mysql-5.1.73-3.el6_5.x86_64.rpm                                                     | 894 kB     00:01    
(2/3): mysql-libs-5.1.73-3.el6_5.x86_64.rpm                                                | 1.2 MB     00:02    
(3/3): mysql-server-5.1.73-3.el6_5.x86_64.rpm                                              | 8.6 MB     00:08    
-------------------------------------------------------------------------------------------
Total                                                                             915 kB/s |  11 MB     00:11    
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : mysql-libs-5.1.73-3.el6_5.x86_64                                                               1/6
  Updating   : mysql-5.1.73-3.el6_5.x86_64                                                                    2/6
  Updating   : mysql-server-5.1.73-3.el6_5.x86_64                                                             3/6
  Cleanup    : mysql-server-5.1.71-1.el6.x86_64                                                               4/6
  Cleanup    : mysql-5.1.71-1.el6.x86_64                                                                      5/6
  Cleanup    : mysql-libs-5.1.71-1.el6.x86_64                                                                 6/6
  Verifying  : mysql-libs-5.1.73-3.el6_5.x86_64                                                               1/6
  Verifying  : mysql-server-5.1.73-3.el6_5.x86_64                                                             2/6
  Verifying  : mysql-5.1.73-3.el6_5.x86_64                                                                    3/6
  Verifying  : mysql-libs-5.1.71-1.el6.x86_64                                                                 4/6
  Verifying  : mysql-server-5.1.71-1.el6.x86_64                                                               5/6
  Verifying  : mysql-5.1.71-1.el6.x86_64                                                                      6/6

Updated:
  mysql-server.x86_64 0:5.1.73-3.el6_5                                                                           

Dependency Updated:
  mysql.x86_64 0:5.1.73-3.el6_5                         mysql-libs.x86_64 0:5.1.73-3.el6_5                       

Complete!

8.查看是否更新成功

[root@localhost ~]# rpm -qa | grep mysql
mysql-5.1.73-3.el6_5.x86_64
mysql-server-5.1.73-3.el6_5.x86_64
mysql-libs-5.1.73-3.el6_5.x86_64

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12082464/viewspace-1191208/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/12082464/viewspace-1191208/

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值