I was following these steps to install ros indigo on a chroot environment on my Ubuntu 15.10 http://wiki.ros.org/ROS/Tutorials/InstallingIndigoInChroot

But I screwed some things up and I want to remove the chroot environment and restart the steps all over again on a clean slate. I googled it and found many posts saying I should just remove the /srv/chroot/indigo_trusty folder but when I tried some of the subdirectories couldn't be removed because they were 'busy'.

I tried to ignore it and use debootstrap to create another folder with the name 'indigo' as another chroot environment. But after it was done when I use schroot -l it only shows the old one 'indigo_trusty'.

What should I do to get rid of all chroot and start all over again?


Remove its conf file that you've created earlier. schroot -l shows the information from them.

There may be some things mounted by it. See cat /etc/mtab. If you're not sure which ones, a reboot will probably unmount them.

Removing sessions:

# list all sessions:
schroot --list --all-sessions
# if the above command does not work, just type `mount`. The bind mount
# points with something like this in the mount path is the session name you want to get:
precise-a4aac8e0-663c-4fec-8fb2-16e4b06557e3 (<chroot_name>-<id>)

# now run this to properly end the session:
schroot -e -c precise-ca6c72e4-0e9f-4721-8a0e-cca359e2c2fd
  • Thank you so much it worked. But I still cannot remove the folder of the old chroot even after the reboot. sudo rm -r indigo_trusty [sudo] password for ahmedn1: rm: cannot remove ‘indigo_trusty/tmp’: Device or resource busy rm: cannot remove ‘indigo_trusty/home’: Device or resource busy rm: cannot remove ‘indigo_trusty/proc’: Device or resource busy rm: cannot remove ‘indigo_trusty/sys’: Device or resource busy rm: cannot remove ‘indigo_trusty/dev’: Device or resource busy
    – Ahmedn1
    Mar 18 '17 at 14:24
  • So schroot is still mounting them at boot, so it has still some configuration bits remaining. Maybe there are sessions left. Try this: unix.stackexchange.com/a/295644/146335 (basically, list and end sessions). Also, you can apt-get --purge all schroot packages - that should remove all the configs and chroots, I think.
    – Velkan
    Mar 18 '17 at 15:31
  • Thanks a lot. It worked and I could delete the chroot folder after I ended the session.
    – Ahmedn1
    Mar 20 '17 at 22:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.