AWS AMIから/bin/hostnameを復元する

AWS AMIから/bin/hostnameを復元する

誤って/bin/hostnameを削除しました。既知の名前を返すシェルスクリプトを一時的に入れました。しかし、失われたバイナリを回復する方法は?

AWS AMIです。

Linux ip-10-2-0-162 3.4.62-53.42.amzn1.x86_64 #1 SMP Fri Sep 20 07:23:24 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

ベストアンサー1

別のインスタンスからファイルをコピーする代わりに、yum reinstall $package次のようにパッケージを再インストールできます(経由)。

[root@localhost ~]# rpm -qf /bin/hostname
net-tools-1.60-110.el6_2.x86_64
[root@localhost ~]# ls -l /bin/hostname
ls: cannot access /bin/hostname: No such file or directory
[root@localhost ~]# yum reinstall net-tools
(...)
Running Transaction
  Installing : net-tools-1.60-110.el6_2.x86_64                                                                                                                           1/1 
  Verifying  : net-tools-1.60-110.el6_2.x86_64                                                                                                                       1/1 

Installed:
  net-tools.x86_64 0:1.60-110.el6_2                                                                                                                                      

Complete!
[root@localhost ~]# ls -l /bin/hostname 
-rwxr-xr-x 1 root root 13712 May 10  2012 /bin/hostname

おすすめ記事