Linux & Android > Articles, Tutorials and Tips

Get back hard drive space with 'apt autoremove'

(1/2) > >>

Jason:
I've noticed that graphical update tools seem to leave old packages on the system that aren't necessary. Linux Lite does, for example. You can get back some space by removing them. I just got back 2 GB worth! For me, that's pretty helpful on a 128 GB drive. To find how much space you've saved, enter this command before and after removing these extraneous files:


--- Code: ---df -h
--- End code ---

Note the drive space used on the filesystem mounted on /.

Then, to find out if there are packages you no longer need and to remove them, enter this command in the terminal:


--- Code: ---sudo apt autoremove
--- End code ---

Old kernel packages tend to be the main packages sucking up hard drive space.

And btw, you're notified of these redundant packages when you run 'sudo apt full-upgrade' along with the command to remove them.

Let us know how much, if any, drive space you get back using 'apt autoremove'.

fox:
Zero for me. That's because I run "sudo apt autoremove" after every kernel update.  :)

ssfc72:
15 G savings for me.  Thanks Jason, for this valuable tip!

The PLUG Forums are sure a great resource for people like me, who are not as skilled at using Linux, and can get tips like this from other expert Linux users, on these Forums.

Jason:

--- Quote from: fox on December 19, 2020, 10:40:33 pm ---Zero for me. That's because I run "sudo apt autoremove" after every kernel update.  :)

--- End quote ---

So those kernel packages take up zero space before you run the command? I think not. :) Kernel updates don't happen as often as updates for other packages so if you run it after every kernel update, you'll sweep up all the other packages that are left, too, resulting in not much space saved but it has to be more than zero or there'd be no point in running it at all.

Jason:

--- Quote from: ssfc72 on December 20, 2020, 12:40:12 am ---15 G savings for me.  Thanks Jason, for this valuable tip!

The PLUG Forums are sure a great resource for people like me, who are not as skilled at using Linux, and can get tips like this from other expert Linux users, on these Forums.

--- End quote ---

I think you're pretty skilled at Linux but there are always new things you, or I, can learn.

Navigation

[0] Message Index

[#] Next page

Go to full version