# Safe to delete files in /usr/lib/debug?



## lloyd (Dec 8, 2022)

I've created a few FreeBSD VMs under AWS (EC2 and Lightsail) and they each have ~1.8 GB of files under `/usr/lib/debug` immediately upon VM creation. I'd like to free up precious disk space -- are these files safe to delete?

The files have a creation date months earlier than when the VM was created.  I'm wondering if they were files that got accidentally included when they made the VM master image.

Here's some `ncdu` screens digging down into some of these folders for context:


```
--- /usr/lib -----------------------------------------------------------------------------------------------------------
    1.8 GiB [#################] /debug

--- /usr/lib/debug -----------------------------------------------------------------------------------------------------
                                /..
    1.3 GiB [#################] /usr
  473.5 MiB [######           ] /boot
   38.5 MiB [                 ] /lib
   19.2 MiB [                 ] /sbin
    3.0 MiB [                 ] /bin
  684.0 KiB [                 ] /libexec

--- /usr/lib/debug/usr -------------------------------------------------------------------------------------------------
                                /..
  966.9 MiB [#################] /bin
  197.3 MiB [###              ] /tests
   62.2 MiB [#                ] /lib32
   56.9 MiB [#                ] /lib
   44.5 MiB [                 ] /sbin
    7.1 MiB [                 ] /libexec

--- /usr/lib/debug/usr/bin ---------------------------------------------------------------------------------------------
                                /..
  252.2 MiB [#################]  clang.debug
  219.8 MiB [##############   ]  lldb.debug
  139.0 MiB [#########        ]  ld.lld.debug
  134.2 MiB [#########        ]  lldb-server.debug
   23.9 MiB [#                ]  llvm-objdump.debug
   23.5 MiB [#                ]  llvm-readobj.debug
   21.7 MiB [#                ]  llvm-nm.debug
   21.4 MiB [#                ]  llvm-ar.debug
   18.6 MiB [#                ]  llvm-cov.debug
   18.1 MiB [#                ]  llvm-objcopy.debug
   18.0 MiB [#                ]  llvm-symbolizer.debug
   15.8 MiB [#                ]  llvm-size.debug
   15.6 MiB [#                ]  kyua.debug
    9.7 MiB [                 ]  llvm-profdata.debug
    3.5 MiB [                 ]  dtc.debug
    2.7 MiB [                 ]  llvm-cxxfilt.debug
    2.7 MiB [                 ]  llvm-strings.debug
    1.9 MiB [                 ]  nvi.debug
    1.4 MiB [                 ]  openssl.debug
    1.1 MiB [                 ]  mandoc.debug
  800.0 KiB [                 ]  ntpq.debug
  736.0 KiB [                 ]  bc.debug
  704.0 KiB [                 ]  make.debug
  512.0 KiB [                 ]  ssh.debug
  480.0 KiB [                 ]  less.debug
  448.0 KiB [                 ]  ztest.debug
  380.0 KiB [                 ]  lex.debug
  364.0 KiB [                 ]  systat.debug
  328.0 KiB [                 ]  objcopy.debug
```


----------



## covacat (Dec 8, 2022)

yes


----------

