Author Topic: does this update and clean the HD? (SOLVED)  (Read 3060 times)

Offline gychang

  • Member
  • ***
  • Posts: 102
  • Karma: 7
  • New Forum User
    • View Profile
  • Peppermint version(s): 6
does this update and clean the HD? (SOLVED)
« on: August 29, 2015, 04:48:24 pm »
I use this to update and interested in proper way to clean the HD?, I seem to recall to remove the junk completely do I need to add "autoclean", "clean", "purge"?

sudo apt update -y && apt upgrade -y && apt dist-upgrade -y && sudo apt-get autoremove -y && exit
« Last Edit: September 02, 2015, 02:41:53 pm by gychang »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26437
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: does this update and clean the HD?
« Reply #1 on: August 29, 2015, 04:54:28 pm »
For a start it may not be advisable to run all those in sequence like that .. if you dist-upgrade it might be advisable to reboot before running autoremove and clean/autoclean.

Nor would I "-y" them all without checking what they're going to do first.
« Last Edit: August 29, 2015, 04:56:06 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline scifidude79

  • Hero
  • *****
  • Posts: 4029
  • Karma: 870
    • View Profile
  • Peppermint version(s): Peppermint 9
Re: does this update and clean the HD?
« Reply #2 on: August 29, 2015, 06:32:11 pm »
sudo apt-get autoremove removes unnecessary dependencies.  IE:  You install software and it installs a bunch of stuff as dependencies.  If you remove that software, the dependencies stay.  So, you run that and it gets rid of the dependencies that are no longer needed.  So, in that manner of speaking, it does clean your HD by removing stuff that is installed and is no longer needed.

Though, as PCNetSpec said, I wouldn't recommend stringing that together with the upgrade command.  I usually run it by itself.

Offline perknh

  • Trusted User
  • Hero
  • *****
  • Posts: 4030
  • Karma: 379
  • Soy un huevo, nada más.
    • View Profile
  • Peppermint version(s): Peppermint 10
Re: does this update and clean the HD?
« Reply #3 on: August 30, 2015, 06:28:36 am »
For a start it may not be advisable to run all those in sequence like that .. if you dist-upgrade it might be advisable to reboot before running autoremove and clean/autoclean.
e

Hello PCNetSpec,

I never thought about that before --the rebooting after dist-upgrading.  Am I correct that logging out would do the same --essentially resetting the computer?
 
I also take it that regular upgrading is off the hook with this procedure.  It's only the dist-upgrading that requires the reboot (or a logout) after running that command.

Thankfully, I've lucked out so far without rebooting.  Phew!

Thank you,

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 Slim.Fatz

  • Global Moderator
  • Veteran
  • *****
  • Posts: 2393
  • Karma: 633
  • Where's the mouse?
    • View Profile
  • Peppermint version(s): Peppermint 7, 8.5 & 10 - 64bit
Re: does this update and clean the HD?
« Reply #4 on: August 30, 2015, 09:18:08 am »
Hi perknh,

The reboot is needed to activate a new kernel (if one was installed). Just logging out and then back in will not activate a new kernel.

Regards,

-- Slim
Respect science, respect nature, respect each other.

Tread lightly: Fluxbox, JWM, i3, Openbox, awesome

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26437
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: does this update and clean the HD?
« Reply #5 on: August 30, 2015, 09:30:02 am »
What Slim.Fatz said :)
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline scifidude79

  • Hero
  • *****
  • Posts: 4029
  • Karma: 870
    • View Profile
  • Peppermint version(s): Peppermint 9
Re: does this update and clean the HD?
« Reply #6 on: August 30, 2015, 09:31:38 am »
Kernel updates, some driver updates and a few other things require a reboot.  Fortunately, Linux doesn't need a reboot at the drop of a hat like Windows, but there are still times where it's necessary.  AndyInMokum wrote a nice tutorial on how to tell if your system needs a reboot:

http://forum.peppermintos.com/index.php/topic,1842.0.html

Offline perknh

  • Trusted User
  • Hero
  • *****
  • Posts: 4030
  • Karma: 379
  • Soy un huevo, nada más.
    • View Profile
  • Peppermint version(s): Peppermint 10
Re: does this update and clean the HD?
« Reply #7 on: August 30, 2015, 09:45:47 am »
Slim.Fatz, PcNetSpec, and scifidude79,

This is very useful information. I had no idea there would be such a difference between rebooting and logging out. :o 

Also, thank you AndyInMokum for writing up that tutorial. ;)

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: 26437
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: does this update and clean the HD?
« Reply #8 on: August 30, 2015, 10:41:58 am »
initrd which is a root file system that gets set up in RAM (ramdisk) to accommodate the kernel, is loaded immediately by GRUB as the first thing to load (besides a few GRUB modules), and the kernel is loaded into that ramdisk .. so when you get a kernel update you'd need to cycle through GRUB to load the more recent initrd image and kernel.

A logoff/on won't load the new initrd and kernel .. you're still using the old initrd and kernel until you reboot through GRUB which has the pointers to load the new ones, as GRUB's config file was edited when the new kernel was installed.

Clear as mud ?
« Last Edit: August 30, 2015, 10:47:13 am by PCNetSpec »
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: 4030
  • Karma: 379
  • Soy un huevo, nada más.
    • View Profile
  • Peppermint version(s): Peppermint 10
Re: does this update and clean the HD?
« Reply #9 on: August 30, 2015, 01:50:31 pm »
No, PCNetSpec, that's a pretty darn good explanation for somebody who had no awareness of this issue at all before yesterday.  I take it, though, with a basic upgrade, there is no need to logout, or reboot, or anything.  It's the dist-upgrade where we must be sure to reboot grub.  A simple upgrade can be treated in the same manner as an update --with no need for any reboots at all.  Am I correct about this?

Thank you,

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: 26437
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: does this update and clean the HD?
« Reply #10 on: August 30, 2015, 02:40:10 pm »
"upgrade" (from the terminal) cannot on its own install a new kernel .. "upgrade" cannot add addition packages to the system, it can only update packages already installed .. because of the way kernel updates are installed as dependencies of a metapackage and all have different package names (so you can have multiple kernels installed at the same time) installing one requires that you ADD packages that didn't exist on the system previously (and "upgrade" cannot do that)

"dist-upgrade" CAN intelligently ADD packages as well as update already present packages.

So yeah, all an "upgrade" can do is replace packages you already have installed with newer versions .. rebooting isn't necessary, but if it updated an application that's currently open, you will not be using the new version until you close then reopen that application
things like say the nemo file manager, theoretically you CAN manually close it and reopen it, but that won't properly unload it because it's also controlling the desktop .. so you'd need to KILL nemo and restart it .. in such cases it may be easier to just log off/on (which will automatically kill nemo then reload it), but there's no NEED to load the new version, it'll just happen automatically when you either log off/on or reboot

did that help ?
(these things are easy to explain IN MY HEAD, but I'm never sure they came out legibly)



Please be aware that the update manager (mintupdate shield in system tray) runs a "dist-upgrade", so it can and does install Kernel updates if they are present.
« Last Edit: August 30, 2015, 02:43:31 pm by PCNetSpec »
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: 4030
  • Karma: 379
  • Soy un huevo, nada más.
    • View Profile
  • Peppermint version(s): Peppermint 10
Re: does this update and clean the HD?
« Reply #11 on: August 30, 2015, 03:28:00 pm »
Yes, PCNetSpec, that did help, and, again, I learned something new here today. 

No, even though I've seen plenty of new linux images over the last couple of months, I did not put two and two together that our new mintupdate runs a dist-upgrade also. 

Now, I'm beginning to wonder is the basis upgrade command is really that important at all.  It appears to me that updating and dist-upgrading covers just about everything concerning updates and upgrades.  I can only think of using the basic upgrade command if I did NOT want to update the kernel (and some drivers) --although I cannot imagine why I would not want to do so.

Thank you,

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: 26437
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: does this update and clean the HD?
« Reply #12 on: August 30, 2015, 05:27:52 pm »
Bearing in mind that "dist-upgrade" can intelligently resolve installation issues like removing one package that may be conflicting with another .. running "dist-upgrade" on its own when you may have 100's of updates and a lot of added PPA's, may end up resolving what it sees as a few issues leaving you with a few problems.
(99.999recurring % of the time it'll be fine, but if things go wrong it may end up in knots .. particularly where you have TONS of updates and PPA's)

My way of thinking is, run an "upgrade" first to get 99% of the plain upgrades out of the way

THEN "dist-upgrade" .. if things go wrong you'll have less to go through to figure out WTF happened

So in short .. Yup, "upgrade" isn't necessary and you can go straight to "dist-upgrade", and if you update often (so you never end up with tons of updates in one go) it should be 99.999999% safe
I just prefer letting it get the easy stuff out of the way before running the command that may need to intelligently fix stuff.

hth.
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: 4030
  • Karma: 379
  • Soy un huevo, nada más.
    • View Profile
  • Peppermint version(s): Peppermint 10
Re: does this update and clean the HD?
« Reply #13 on: August 31, 2015, 04:09:55 am »
Yes, that does help very much.  Thank you.
[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 gychang

  • Member
  • ***
  • Posts: 102
  • Karma: 7
  • New Forum User
    • View Profile
  • Peppermint version(s): 6
Re: does this update and clean the HD? (SOLVED)
« Reply #14 on: September 02, 2015, 02:45:52 pm »
seems like it is good idea to run this.

sudo apt update -y && apt upgrade && exit

after reboot followed by
sudo apt-get dist-upgrade and if any change reboot, then run sudo apt-get autoremove -y && exit

thanks for all the input.