Author Topic: can someone explain to me more commands to freee up space?  (Read 3523 times)

Offline iamesperambient

  • Veteran
  • ****
  • Posts: 1269
  • Karma: 89
  • a totally awesome dude
    • View Profile
    • i AM esper (drone ambient music)
  • Peppermint version(s): Peppermint 8 64 bit
can someone explain to me more commands to freee up space?
« on: November 14, 2014, 11:37:39 pm »
hi, thanks again for everyones help. Im still looking for safe commands i can run in terminal to free up space safely
that will remove things that are not needed or broken etc i know how to do the apt clean, apt autoclean/apt autoremove
and it helps keep my HD around the same amount of space but i know there is more space being wasted some were from
packages i used to have that are gone or something. i used to have about 60 gigs free (at 51 now) i know 8 or so gigs isn't a lot to some
but with an 80 gig HD im trying to keep it as empty as possible because i assume updates take up more space and i would assume (could totally be wrong)
i may one day not have enough space at one point  to do much of anything. so any help is appreciated thanks!
http://iamesper.bandcamp.com
boring drone music from NJ

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4889
  • Karma: 1058
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 10 (64-bit)
Re: can someone explain to me more commands to freee up space?
« Reply #1 on: November 14, 2014, 11:45:09 pm »
This set of commands from VinDSL works really well.
Quote
Here's how I clean out my closet...  8)

I start by manually removing cruft -- podcasts -- browser cache(s) -- old kernels -- blah, blah, blah.

Then I update the file database.  This will initially take a while.  Subsequent running will be much faster:

Code: [Select]
sudo updatedb
Then I get rid of the usual suspects:

Code: [Select]
sudo apt-get clean
sudo apt-get autoclean
sudo apt-get autoremove
For 'good measure' I update the db again:

Code: [Select]
sudo updatedb
Then I nuke ALL THINGS 'trash', including 'trash' in 'root'.  This takes a while and error messages are normal:

WARNING  Be extremely careful when using the 'rm' command.  Copy n' paste the following code.

Code: [Select]
sudo find / -type d -name '*Trash*' -exec rm -fr {} \;

I do a final update on the db:

Code: [Select]
sudo updatedb
Then restart/reboot
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline iamesperambient

  • Veteran
  • ****
  • Posts: 1269
  • Karma: 89
  • a totally awesome dude
    • View Profile
    • i AM esper (drone ambient music)
  • Peppermint version(s): Peppermint 8 64 bit
Re: can someone explain to me more commands to freee up space?
« Reply #2 on: November 15, 2014, 12:02:19 am »
thanks, one question not sure how to remove old kernels and i heard doing that can be risky?
just want to make sure everything is 100 % safe and i know what im doing before i do it
http://iamesper.bandcamp.com
boring drone music from NJ

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4889
  • Karma: 1058
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 10 (64-bit)
Re: can someone explain to me more commands to freee up space?
« Reply #3 on: November 15, 2014, 12:19:38 am »
I found this with a DDG search.  From the comments, there appears to be a lot of happy people. That's always a good sign. Ubuntu Cleanup: How to Remove All Unused Linux Kernel Headers, Images and Modules
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline iamesperambient

  • Veteran
  • ****
  • Posts: 1269
  • Karma: 89
  • a totally awesome dude
    • View Profile
    • i AM esper (drone ambient music)
  • Peppermint version(s): Peppermint 8 64 bit
Re: can someone explain to me more commands to freee up space?
« Reply #4 on: November 15, 2014, 12:27:51 am »
that actually freed up like a gig of space removign old kernel so it was helpful thanks!!!
http://iamesper.bandcamp.com
boring drone music from NJ

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4889
  • Karma: 1058
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 10 (64-bit)
Re: can someone explain to me more commands to freee up space?
« Reply #5 on: November 15, 2014, 12:36:15 am »
that actually freed up like a gig of space removign old kernel so it was helpful thanks!!!
No problem, I just ran it myself and recovered 424MiB  8).
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline iamesperambient

  • Veteran
  • ****
  • Posts: 1269
  • Karma: 89
  • a totally awesome dude
    • View Profile
    • i AM esper (drone ambient music)
  • Peppermint version(s): Peppermint 8 64 bit
Re: can someone explain to me more commands to freee up space?
« Reply #6 on: November 15, 2014, 12:43:35 am »
nice!!!! 8)
http://iamesper.bandcamp.com
boring drone music from NJ

Offline perknh

  • Trusted User
  • Hero
  • *****
  • Posts: 4024
  • Karma: 377
  • Soy un huevo, nada más.
    • View Profile
  • Peppermint version(s): Peppermint 10
Re: can someone explain to me more commands to freee up space?
« Reply #7 on: November 15, 2014, 03:46:01 am »
I found this with a DDG search.  From the comments, there appears to be a lot of happy people. That's always a good sign. Ubuntu Cleanup: How to Remove All Unused Linux Kernel Headers, Images and Modules

I'm amazing again by what I learned here.  I must have head some old Peppermint headers on my external hard drive, but they're gone now!

I cleaned out 270 MiBs in both my external and internal hard drives.  :)

Now, here are my million dollar questions:  How do you memorize that code?   How would you even say it?  Imagine trying to instruct somebody how to enter that code into their computer's terminal over the phone!   :o

I don't even know what those symbols are called, never mind what they are doing!  All I know is that copying and pasting that command worked like a charm!

Thank you, AndyInMokum.  ;)
« Last Edit: November 15, 2014, 04:10:55 am by perknh »
[T]here are a lot of people happily running Peppermint ICE which hasn't been receiving ANY updates for a while now .. and I personally would STILL consider that MUCH more secure than any version of Windows with up-to-date AV/Anti-malware ;)

--  PCNetSpec, Cornwall, Eng.  Dec 03, 2013 5:18 pm

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26452
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: can someone explain to me more commands to freee up space?
« Reply #8 on: November 15, 2014, 05:09:40 am »
Why would you want to

a) rip out all previous kernels
and
b) do it with a command you don't understand, with no way of knowing if it's going to exceed what you expect

Personally I prefer to learn to manually remove them myself, and always keep the previous kernel in case I need to boot into it to fix the current one.

Removing old kernels (and associated headers/extras) is not that difficult...

run:
Code: [Select]
uname -rwhich will give you your current kernel version.

Now you can use synaptic to look for packages named

linux-image-<version>-generic
linux-image-extra-<version>-generic
linux-headers-<version>
linux-headers-<version>-generic

Where the <version> number is LOWER than the current version you got from "uname-r"

but as said, I also leave the last kernel installed as a safeguard.



Where I do find part of that command handy is in identifying what to MANUALLY remove:
Code: [Select]
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'


Quote
Now, here are my million dollar questions:  How do you memorize that code?

Set an alias for the command that's easy to remember, so you only have t run say:
Code: [Select]
sudo old-kernel-removeand the full command gets run instead.

another option would be to include the command in an executable bash script called 'old-kernel-remove' and bung it in your $PATH somewhere.



Quote
I don't even know what those symbols are called, never mind what they are doing!

That apparent gibberish is called - regular expression (or 'regex' for short)
https://www.gnu.org/software/sed/manual/html_node/Regular-Expressions.html
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline perknh

  • Trusted User
  • Hero
  • *****
  • Posts: 4024
  • Karma: 377
  • Soy un huevo, nada más.
    • View Profile
  • Peppermint version(s): Peppermint 10
Re: can someone explain to me more commands to freee up space?
« Reply #9 on: November 15, 2014, 07:31:11 am »
Good morning, PCNetSpec,

Since we, who have now run this code, only have one kernel now (3.13.0-39-generic), we will, I assume, eventually get another kernel when there is a kernel upgrade.  Therefore, most likely, we've done no real harm to our systems today.

What I'm learning here is that's it's always good to have a backup kernel, and we should always be extra careful when entering an unknown code.

This makes a lot of sense.

Thank you for these insights,

perknh
[T]here are a lot of people happily running Peppermint ICE which hasn't been receiving ANY updates for a while now .. and I personally would STILL consider that MUCH more secure than any version of Windows with up-to-date AV/Anti-malware ;)

--  PCNetSpec, Cornwall, Eng.  Dec 03, 2013 5:18 pm

Offline VinDSL

  • Administrator
  • Hero
  • *****
  • Posts: 5880
  • Karma: 1154
  • Team Peppermint
    • View Profile
  • Peppermint version(s): Developmental Builds
Re: can someone explain to me more commands to freee up space?
« Reply #10 on: November 15, 2014, 10:21:08 am »
thanks, one question not sure how to remove old kernels and i heard doing that can be risky?
just want to make sure everything is 100 % safe and i know what im doing before i do it


I was going to comment on this earlier, this week, but I was attending board meetings in San Diego.


It looks like you got your answer(s), but now that I'm back home on my test box, I thought I would show you what I do:


I install/remove kernels constantly.  And, yes, if you get sloppy it CAN be dangerous, but...


I'm as lazy as the next person.  I use Synaptic to purge old kernels.  That's the safest, simplest way IMO.


I simply do a 'Quick Filter' on the word 'kernel', select Status -> Installed (local or obsolete) and 'Mark for Complete Removal'.


As you can see, I currently have a 'generic' kernel installed, plus a custom kernel that I compiled.


In a few minutes, I'm going to build another custom kernel and purge the old ones via Synaptic.  Simple pimple   8)


They say a picture is worth 1000 words...



Offline VinDSL

  • Administrator
  • Hero
  • *****
  • Posts: 5880
  • Karma: 1154
  • Team Peppermint
    • View Profile
  • Peppermint version(s): Developmental Builds
Re: can someone explain to me more commands to freee up space?
« Reply #11 on: November 15, 2014, 10:50:03 am »
Personally I [...] always keep the previous kernel in case I need to boot into it to fix the current one.

I also leave the last kernel installed as a safeguard.


Golden!  I wanted to be crystal clear about that.


I always keep the last_known_good kernel around, too.


And, I dual-boot my test machine with Ubu 10.10, in case an errant update borks my dev release.  ;)

Offline iamesperambient

  • Veteran
  • ****
  • Posts: 1269
  • Karma: 89
  • a totally awesome dude
    • View Profile
    • i AM esper (drone ambient music)
  • Peppermint version(s): Peppermint 8 64 bit
Re: can someone explain to me more commands to freee up space?
« Reply #12 on: November 15, 2014, 11:07:30 am »
thanks for the info still trying to understand all of it.
« Last Edit: November 15, 2014, 11:00:52 pm by iamesperambient »
http://iamesper.bandcamp.com
boring drone music from NJ