0
┌─╼ [~]
└╼ df -h
Filesystem                   Size  Used Avail Use% Mounted on
udev                         7.5G     0  7.5G   0% /dev
tmpfs                        1.6G  2.2M  1.6G   1% /run
/dev/mapper/ubuntu--vg-root  453G  177G  253G  42% /
tmpfs                        7.6G  139M  7.4G   2% /dev/shm
tmpfs                        5.0M  4.0K  5.0M   1% /run/lock
tmpfs                        7.6G     0  7.6G   0% /sys/fs/cgroup
/dev/loop2                    56M   56M     0 100% /snap/core18/1988
/dev/loop3                   163M  163M     0 100% /snap/gnome-3-28-1804/145
/dev/loop4                    65M   65M     0 100% /snap/gtk-common-themes/1514
/dev/nvme0n1p1               704M  302M  351M  47% /boot
tmpfs                        1.6G   76K  1.6G   1% /run/user/1000
/dev/loop0                    33M   33M     0 100% /snap/snapd/11402
/dev/loop6                    56M   56M     0 100% /snap/core18/1997
/dev/loop5                   139M  139M     0 100% /snap/chromium/1536
/dev/loop1                    33M   33M     0 100% /snap/snapd/11588
/home/infinity/.Private      453G  177G  253G  42% /home/infinity
/dev/loop7                   139M  139M     0 100% /snap/chromium/1557

I have a lot of dev/loop* and other useless things here. How can I remove them?

0

2 Answers 2

3

The /dev/loop devices are mounted by snaps - applications. In your case just the base packages, and chromium.

Ubuntu can run without snaps, but it is becoming more difficult.

10
  • 1
    I used to remove the snaps from my system, but have found that with the current versions of Ubuntu some functionality is lost when I do that. So do save them. Apr 16, 2021 at 14:52
  • 1
    Ubuntu 21.04 here without ANY snap and working flawlessly ;-)
    – Rinzwind
    Apr 16, 2021 at 15:04
  • 1
    @Rinzwind It works great, unless you want to use the software store! My concern (mine alone) is that Ubuntu will become reliant upon snaps to the point that the system is no longer usable without them. Apr 16, 2021 at 15:07
  • 1
    @Terrance I have no hard numbers to go on, but I live at the bottom of a 10 Mbps DSL line, and snaps take forever to download. Apr 16, 2021 at 17:33
  • 1
    @Terrance Every day I chant "starlink, starlink, starlink". Then I spin around and toss a pinch of salt over my shoulder. It hasn't worked yet. Apr 16, 2021 at 17:38
2
df -h -x squashfs -x tmpfs -x devtmpfs

The -x (eXclude) option is used to ignore filesystems that you don't care to know about.

You can also create an alias for df using one of the following echo commands below. The first one will append your aliases in ~/.bash_aliases (Ubuntu's default ~/.bashrc sources this file) or — if you are using another distro, e.g. Fedora — you can just add the alias to the end of your Home's .bashrc

For Ubuntu users:

echo "alias df='df -h -x squashfs -x tmpfs -x devtmpfs'" >> ~/.bash_aliases

For other *nix users:

echo "alias df='df -h -x squashfs -x tmpfs -x devtmpfs'" >> ~/.bashrc

Don't forget to source it:

source ~/.bash_aliases
source ~/.bashrc

Enjoy :-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .