Linux
AWS Amazon Linux MySQL Yum 更新失敗
我使用 Amazon Linux AMI SSH 連接到我的 AWS EC2 實例,它告訴我執行
sudo yum update
命令以進行安全更新。當我這樣做時,它最終無法更新 MySQL。*我不知道這是否是原因,但請注意,我的 MySQL 設置為通過以下方式安裝綁定到附加的 EBS 文件系統:http ://aws.amazon.com/articles/1663?_encoding=UTF8&jiveRedirect=1
這是輸出:
[ec2-user@ip /]$ sudo yum update Loaded plugins: priorities, security, update-motd, upgrade-helper amzn-main | 2.1 kB 00:00 amzn-updates | 2.3 kB 00:00 Setting up Update Process Resolving Dependencies --> Running transaction check ---> Package mysql55-common.x86_64 0:5.5.32-1.35.amzn1 will be updated ---> Package mysql55-common.x86_64 0:5.5.32-1.36.amzn1 will be an update --> Finished Dependency Resolution Dependencies Resolved ====================================================================================================================================================== Package Arch Version Repository Size ====================================================================================================================================================== Updating: mysql55-common x86_64 5.5.32-1.36.amzn1 amzn-updates 47 k Transaction Summary ====================================================================================================================================================== Upgrade 1 Package(s) Total download size: 47 k Is this ok [y/N]: y Downloading Packages: mysql55-common-5.5.32-1.36.amzn1.x86_64.rpm | 47 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Updating : mysql55-common-5.5.32-1.36.amzn1.x86_64 1/2 Error unpacking rpm package mysql55-common-5.5.32-1.36.amzn1.x86_64 error: unpacking of archive failed on file /etc/my.cnf: cpio: rename Verifying : mysql55-common-5.5.32-1.36.amzn1.x86_64 1/2 mysql55-common-5.5.32-1.35.amzn1.x86_64 was supposed to be removed but is not! Verifying : mysql55-common-5.5.32-1.35.amzn1.x86_64 2/2 Failed: mysql55-common.x86_64 0:5.5.32-1.35.amzn1 mysql55-common.x86_64 0:5.5.32-1.36.amzn1 Complete!
通常,當文件出於安全原因設置了不可變 (i) 標誌時,就會發生這種情況。
lsattr /etc/my.cnf
chattr -i /etc/my.cnf
在 Amazon EBS 的情況下,看起來文件綁定到 EBS 卷上的一個:只是
umount /etc/my.cnf
,執行更新並bind
再次執行。