Author Topic: sudo apt-get update/upgrade (SOLVED)  (Read 4986 times)

Offline lambousa

  • Member
  • ***
  • Posts: 69
  • Karma: 2
  • New Forum User
    • View Profile
  • Peppermint version(s): 3, 4, 5
sudo apt-get update/upgrade (SOLVED)
« on: April 30, 2018, 01:50:30 pm »
Tell me guys, how is it that after performing the sudo apt-get update/upgrade combination, there are still updates/upgrades to be done in the update manager?
« Last Edit: May 02, 2018, 10:52:37 am by lambousa »

Offline murraymint

  • Trusted User
  • Veteran
  • *****
  • Posts: 2181
  • Karma: 457
  • soft boiled with a yolk of gold
    • View Profile
  • Peppermint version(s): 7, 8, 9
Re: sudo apt-get update/upgrade
« Reply #1 on: April 30, 2018, 02:05:47 pm »
Usually you just need to refresh the update manager and it'll realise you've got them already. Sometimes on a new install you have to upgrade, reboot and then upgrade a few more.


Offline lambousa

  • Member
  • ***
  • Posts: 69
  • Karma: 2
  • New Forum User
    • View Profile
  • Peppermint version(s): 3, 4, 5
Re: sudo apt-get update/upgrade
« Reply #2 on: April 30, 2018, 02:22:28 pm »
Well, consistently, murraymint, I can bring up the update manager, independently run sudo apt-get update/upgrade combo, refresh the update manager, and yes, a number of the updates are removed, but there are still some remaining. It gives me the impression that the  sudo apt-get update/upgrade combo is not as thorough as the update manager. Does anyone else see this?

Offline zebedeeboss

  • Global Moderator
  • Hero
  • *****
  • Posts: 3233
  • Karma: 625
  • Life first... Peppermint a close 2nd :)
    • View Profile
  • Peppermint version(s): P10 / P9 Respin
Re: sudo apt-get update/upgrade
« Reply #3 on: April 30, 2018, 09:08:11 pm »
Hi lambousa,

there are two distinct upgrade commands you can use

Code: [Select]
sudo apt-get upgrade and
Code: [Select]
sudo apt-get dist-upgrade
you can combine them with an update as below

Code: [Select]
sudo apt-get update && sudo apt-get upgrade or
Code: [Select]
sudo apt-get update && sudo apt-get dist-upgrade

I always use the dist variant.  I do not know the exact differences but it maybe that is what the update manager is seeing compared to just a plain upgrade.

Regards Zeb...

ps I will probably get advised I should not have shown a command I don't know the full impact off (or have forgotten)   :o - other than it has never harmed my pc here when run  :)
Be Kind Whenever Possible...   It is Always Possible - Dalai Lama

P10r x64 Desktop - AMD Threadripper 2950X - 64Gb RAM - NVIDIA RTX2080Ti 11Gb - 2 x 27" 4k

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: sudo apt-get update/upgrade
« Reply #4 on: May 01, 2018, 06:14:19 pm »
Tell me guys, how is it that after performing the sudo apt-get update/upgrade combination, there are still updates/upgrades to be done in the update manager?

Because the update manager runs
Code: [Select]
sudo apt-get dist-upgradeand not just
Code: [Select]
sudo apt-get upgrade
"upgrade" will not install packages that are not on your system .. only upgrade ones that are.

"dist-upgrade" is allowed to install packages that don't already exists on your system, but are being pulled in as dependencies of something else that just got upgraded.

Kernel updates for example are done in a different way to most packages, they don't have a simple version bump, they have a whole new packagename, and are pulled in as dependencies by an updated linux-image-generic metapackage .. so as they're whole new packages according to the Debian naming convention, an "upgrade" can't pull then in, but a "dist-upgrade" can.
(this system is also what allows you to keep multiple kernels in case an updated one breaks your system)

If you notice, even the update manager asks you to click a button to accept the NEW PACKAGES when this happens.

If you want the commandline to do the same:
Code: [Select]
sudo apt-get update
sudo apt-get dist-upgrade
then there'll be nothing left for the update manager to pull in ;)
« Last Edit: May 01, 2018, 06:19:18 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline lambousa

  • Member
  • ***
  • Posts: 69
  • Karma: 2
  • New Forum User
    • View Profile
  • Peppermint version(s): 3, 4, 5
Re: sudo apt-get update/upgrade
« Reply #5 on: May 02, 2018, 10:52:12 am »
Awesome guys, as always, a pleasure and an enlightenment!

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: sudo apt-get update/upgrade (SOLVED)
« Reply #6 on: May 03, 2018, 04:17:18 am »
Further info

When you use
Code: [Select]
sudo apt-get upgradefrom the command line, occasionally (where packages that don't already exist on your system are being pulled in as dependencies), even the command line will warn you that packages have been "held back", this is the system telling you they need explicit instructions from you to be installed because they currently aren't installed so require a:
Code: [Select]
sudo apt-get dist-upgradeThe only other time that the update-manager might still list packages that you've just installed via the command line would be when the update-manager was listing them, then you upgraded via the command line, then went back to the update-manager before it had time to 'refresh' it's package cache in the background, so they're still showing as available for update, even though you've already installed them. Remember, the update manager only 'refreshes' it's list every half hour (by default), so what it's showing may not always reflect  the current state of affairs. Personally whenever I open the update-manager I always hit the 'Refresh' button before letting it install stuff, the reason being that occasionally if you just click 'Update' a package may fail simply because the package has been updated in the repos within the last half hour and the update-manager is only aware of the old version, which no longer exists.
(within the next half hour, when the update-manager does an auto refresh, that would be corrected)

hope that made sense ?
« Last Edit: May 03, 2018, 04:22:57 am by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline christianvl

  • Member
  • ***
  • Posts: 192
  • Karma: 42
  • The Wheel weaves as the Wheel wills
    • View Profile
  • Peppermint version(s): 9
Re: sudo apt-get update/upgrade (SOLVED)
« Reply #7 on: May 05, 2018, 11:44:47 am »
IMHO, I think using only APT is better than APT-GET. So you can update your system with:

Code: [Select]
sudo apt update
sudo apt upgrade

You can read the Debian Handbook for further information. Here's an excerpt on the subject (taken from https://debian-handbook.info/browse/stable/sect.apt-get.html):
Quote
6.2.3. System Upgrade
Regular upgrades are recommended, because they include the latest security updates. To upgrade, use apt upgrade, apt-get upgrade or aptitude safe-upgrade (of course after apt update). This command looks for installed packages which can be upgraded without removing any packages. In other words, the goal is to ensure the least intrusive upgrade possible. apt-get is slightly more demanding than aptitude or apt because it will refuse to install packages which were not installed beforehand.
There are neither beginnings or endings to the turning of the Wheel of Time. But it was a beginning.

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: sudo apt-get update/upgrade (SOLVED)
« Reply #8 on: May 05, 2018, 05:17:47 pm »
There are a couple of things "apt" can't do that "apt-get" can (or could) .. don't ask me what they are though, I've forgotten, in fact my info may be outdated now hence the "(or could)" ;)

In truth, I always "apt-get" simply out of habit .. "apt" just doesn't feel right to me, no reason for it, just habit :)

I'll continue to type "apt-get" in any instructions I give, I'd have to test them with "apt" because I don't use it so can't be 100% sure any instructions would work .. so I'm also kinda being lazy, even though "apt" would save me a second or so :))
« Last Edit: May 05, 2018, 06:59:36 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline mac

  • Veteran
  • ****
  • Posts: 1088
  • Karma: 336
    • View Profile
  • Peppermint version(s): Peppermint 7-8-9
Re: sudo apt-get update/upgrade (SOLVED)
« Reply #9 on: May 05, 2018, 05:36:30 pm »
The difference explained.....sort of: https://itsfoss.com/apt-vs-apt-get-difference/
Peppermint: Standing Out from the Cloud
Reg. Linux User #432835

Offline christianvl

  • Member
  • ***
  • Posts: 192
  • Karma: 42
  • The Wheel weaves as the Wheel wills
    • View Profile
  • Peppermint version(s): 9
Re: sudo apt-get update/upgrade (SOLVED)
« Reply #10 on: May 05, 2018, 07:58:11 pm »
There are a couple of things "apt" can't do that "apt-get" can (or could) .. don't ask me what they are though, I've forgotten, in fact my info may be outdated now hence the "(or could)" ;)

That's true,  but not because APT lacks some features, AFAIK some APT-GET commands were incorporated into anothers.

The only "problem" is that you still have to do a "update" before "upgrade"

You can also do
Code: [Select]
sudo pkcon update
It does everything (update and upgrade) and works accross every major distro (packagekit magic), regardless of the package manager. I've been using it without any problems so far but I do acknowledge that's safer for you to stick with the default commands for your distro.
There are neither beginnings or endings to the turning of the Wheel of Time. But it was a beginning.

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: sudo apt-get update/upgrade (SOLVED)
« Reply #11 on: May 06, 2018, 03:05:50 am »
Personally I like some of the extra steps with distinct commands for each step of the process (and the knowledge that comes from understanding them), makes me feel in charge .. when I want it all done for me, I just use the update manager clicky thing :)
« Last Edit: May 06, 2018, 03:11:18 am by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline mac

  • Veteran
  • ****
  • Posts: 1088
  • Karma: 336
    • View Profile
  • Peppermint version(s): Peppermint 7-8-9
Re: sudo apt-get update/upgrade (SOLVED)
« Reply #12 on: May 06, 2018, 03:24:29 am »
Combine apt-get update and apt-get upgrade into a single command

Open the terminal and type (sub your editor for "gedit" in the command)
Code: [Select]
sudo gedit /usr/local/bin/update
In the new file enter the following
Code: [Select]
#!/bin/bash
sudo apt-get update && sudo apt-get upgrade

Save the changes and close the editor

Make it executable -- in the terminal enter
Code: [Select]
sudo chmod +x /usr/local/bin/update
Then, to update / upgrade simply open a terminal and type "update" (no quotes)

« Last Edit: May 06, 2018, 03:30:03 am by mac »
Peppermint: Standing Out from the Cloud
Reg. Linux User #432835