yum-plugin-versionlock外掛的使用

clvn發表於2014-06-22

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
Importing GPG key 0xC105B9DE:
 Userid: "CentOS-6 Key (CentOS 6 Official Signing Key) <>"
 From  :
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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章