Merge "Add in qemu packages for install."
diff --git a/revert_host_setup.sh b/revert_host_setup.sh
index e37484b..8ec6112 100755
--- a/revert_host_setup.sh
+++ b/revert_host_setup.sh
@@ -1,13 +1,24 @@
 #!/bin/bash
 
-function remove_cuttlefish_pkg() {
-    echo "uninstalling cuttlefish-common"
-    sudo su -c "apt-get purge cuttlefish-common -y && apt-get autoremove -y"
+function remove_cuttlefish_pkgs() {
+    local PACKAGES=("cuttlefish-common"
+                    "ssvnc"
+                    "qemu-kvm"
+                    "qemu-system-common"
+                    "qemu-system-x86"
+                    "qemu-utils"
+                    "libvirt-clients"
+                    "libvirt-daemon-system")
+    for package in ${PACKAGES[@]};
+    do
+        echo " - uninstalling $package"
+        sudo su -c "apt-get purge $package -y && apt-get autoremove -y"
+    done
 }
 
-function remove_cuttlefish_usergroup() {
+function remove_cuttlefish_usergroups() {
     local GROUPS_TO_REMOVE=("kvm" "libvirt" "cvdnetwork")
-    echo "remove user from groups: ${GROUPS_TO_REMOVE[@]}"
+    echo " - remove user from groups: ${GROUPS_TO_REMOVE[@]}"
     for g in ${GROUPS_TO_REMOVE[@]};
     do
         sudo gpasswd -d $USER $g
@@ -15,10 +26,32 @@
     su - $USER
 }
 
-function purge_cuttlefish(){
-   remove_cuttlefish_pkg
-   remove_cuttlefish_usergroup
-   echo 'purge cuttlefish finish!'
+function remove_configs() {
+    local ACLOUD_CONFIG_DIR=~/.config/acloud
+    if [ -d $ACLOUD_CONFIG_DIR ]; then
+        echo " - remove acloud configs"
+        rm -rf $ACLOUD_CONFIG_DIR
+    fi
+
+    local ACLOUD_SSH_KEY=~/.ssh/acloud_rsa
+    if [ -f $ACLOUD_SSH_KEY ]; then
+        echo " - remove acloud ssh keys"
+        rm ${ACLOUD_SSH_KEY}*
+    fi
+
+    local ACLOUD_VNC_PROFILE=~/.vnc/profiles/acloud_vnc_profile.vnc
+    if [ -f $ACLOUD_VNC_PROFILE ]; then
+        echo " - remove acloud vnc profile"
+        rm $ACLOUD_VNC_PROFILE
+    fi
 }
 
-purge_cuttlefish
\ No newline at end of file
+function purge_cuttlefish_host_setup(){
+    echo "Purging host of acloud setup steps..."
+    remove_cuttlefish_pkgs
+    remove_cuttlefish_usergroups
+    remove_configs
+    echo "Done!"
+}
+
+purge_cuttlefish_host_setup
diff --git a/setup/host_setup_runner.py b/setup/host_setup_runner.py
index d5eaeb1..156ce49 100644
--- a/setup/host_setup_runner.py
+++ b/setup/host_setup_runner.py
@@ -36,10 +36,16 @@
 
 # Install cuttlefish-common will probably not work now.
 # TODO: update this to pull from the proper repo.
-_AVD_REQUIRED_PKGS = ["cuttlefish-common", "ssvnc"]
+_AVD_REQUIRED_PKGS = ["cuttlefish-common", "ssvnc",
+                      # TODO(b/117613492): This is all qemu related, take this
+                      # out once they are added back in as deps for
+                      # cuttlefish-common.
+                      "qemu-kvm", "qemu-system-common", "qemu-system-x86",
+                      "qemu-utils", "libvirt-clients", "libvirt-daemon-system"]
 # dict of supported system and their distributions.
 _SUPPORTED_SYSTEMS_AND_DISTS = {"Linux": ["Ubuntu", "Debian"]}
 _LIST_OF_MODULES = ["kvm_intel", "kvm"]
+_UPDATE_APT_GET_CMD = "sudo apt-get update"
 
 
 def _IsSupportedPlatform():
@@ -94,6 +100,7 @@
         logger.info("Start to install required package: %s ",
                     _AVD_REQUIRED_PKGS)
 
+        setup_common.CheckCmdOutput(_UPDATE_APT_GET_CMD, shell=True)
         for pkg in _AVD_REQUIRED_PKGS:
             setup_common.InstallPackage(pkg)