Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I completely clean IPFS repo?

After running following command, related: How do I unpin and remove all IPFS content from my machine?:

# unpin and remove all IPFS content from my machine
ipfs pin ls --type recursive | cut -d' ' -f1 | ifne xargs -n1 ipfs pin rm
ipfs repo gc

Size of the .ipfs repo still remains as it is:

$ du -sh ~/.ipfs
1.4G    .ipfs

I can do rm -rf ~/.ipfs && ipfs init but my IPFS id is re-initialized where I want to keep my original peer identity without removing it.

I want to completely clean content of the IPFS repo. How can I achieve it? I observe that after removing pinned objects still size of the ~/.ipfs is not changed.

like image 500
alper Avatar asked Dec 07 '25 02:12

alper


1 Answers

The ipfs garbage collector isn’t enabled by default and caches can grow unrestrained unless garbage collection is run manually or enabled to run on a schedule.

Try running Garbage Collection via the command

ipfs repo gc

Note: pinned resources are never deleted by the garbage collector.

Read more over here: https://docs.ipfs.io/concepts/persistence/#garbage-collection.

like image 169
Jordan Avatar answered Dec 09 '25 19:12

Jordan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!