This post is also available in: English
This post, I had copied from this article – it’s very useful, not only for the problem with whereami package installation, but for some other mess situation.
I installed whereami on an Amazon EC2 Debian/Ubuntu Linux instance and can no longer connect to the instance.
The Debian version of whereami is designed to provide multiple network connectivity options for laptops or other portable devices capable of running Debian/Ubuntu Linux. The functionality of whereami for Debian-based Linux distributions is completely different from the functionality of whereami provided for Enterprise versions of Linux such as Red Hat Enterprise Linux, Amazon Linux, and enterprise versions of SuSe or Centos Linux. Attempted installation of the whereami package on an Amazon EC2 Debian/Ubuntu Linux instance will terminate any existing connection to the instance and cause all future connection attempts to fail.
Attempts to install whereami on an Amazon EC2 Debian/Ubuntu Linux instance encounter problems running dpkg-reconfigure, causing the installation to hang and eventually fail.
Follow these steps to restore network connectivity to an Amazon EC2 Debian/Ubuntu Linux instance after attempting installation of the whereami package:
Start an Amazon EC2 Linux ‘rescue’ instance with chroot installed.
Stop the Debian/Ubuntu EC2 instance.
Detach the root volume of the Debian/Ubuntu EC2 instance.
Attach the root volume of the Debian/Ubuntu EC2 instance to the Amazon EC2 ‘rescue’ instance.
Start the ‘rescue’ instance if it is not already started, and open a terminal session.
Run the following command to mount the root volume from the Debian/Ubuntu instance to /mnt.
sudo mount /dev/xvdf /mnt
Run the following command to chroot into the root volume of the Debian/Ubuntu instance.
chroot /mnt /bin/bash
Run the following command to remove the whereami package from the Debian/Ubuntu instance.
apt-get remove –purge whereami
Run the following command to unmount the root volume of the Debian/Ubuntu instance and remove from the rescue instance.
exit; umount /mnt;
After the disk is unmounted, detach the root volume of the Debian/Ubuntu EC2 instance from the ‘rescue’ instance.
Reattach the root volume of the Debian/Ubuntu EC2 instance.
Start the Debian/Ubuntu EC2 instance. Network connectivity should be restored and connections to the instance should be successful.
Amazon EC2, Linux, Debian, Ubuntu, whereami, networking, lost connection, restore connectivity, chroot, mnt
“lost connectivity ubuntu whereami” in the Amazon EC2 Discussion Forums