LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-02-2018, 05:30 AM   #1
zaivala
Member
 
Registered: Mar 2008
Location: Blaine TN USA
Distribution: Linux Mint 19.3, Bodhi 5, OpenMandriva Lx 4.1, Manjaro Cinnam,on 2020, others
Posts: 246
Blog Entries: 38

Rep: Reputation: 46
update vs. upgrade


I know that apt-get update updates the packages you currently have, and apt-get upgrade gets you the latest versions of the packages you have... I cannot find whether upgrade INCLUDES update. In other words, do you have to do update after doing upgrade? Does upgrade only affect packages which have version upgrades?

I'm thinking upgrade should be inclusive, or some command should be inclusive, to do all updates and upgrades at the same time, perhaps upgrades first...
 
Old 03-02-2018, 05:53 AM   #2
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: Currently OpenMandriva. Previously openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,440

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
Quote:
Originally Posted by zaivala View Post
I know that apt-get update updates the packages you currently have, and apt-get upgrade gets you the latest versions of the packages you have... I cannot find whether upgrade INCLUDES update. In other words, do you have to do update after doing upgrade? Does upgrade only affect packages which have version upgrades?

I'm thinking upgrade should be inclusive, or some command should be inclusive, to do all updates and upgrades at the same time, perhaps upgrades first...
Maybe have a look at this - look under "Maintenance commands".
 
Old 03-02-2018, 06:40 AM   #3
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 3,507

Rep: Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548
Quote:
Originally Posted by zaivala View Post
I know that apt-get update updates the packages you currently have, and apt-get upgrade gets you the latest versions of the packages you have... I cannot find whether upgrade INCLUDES update. In other words, do you have to do update after doing upgrade? Does upgrade only affect packages which have version upgrades?

I'm thinking upgrade should be inclusive, or some command should be inclusive, to do all updates and upgrades at the same time, perhaps upgrades first...
Your understanding is not quite correct.
Code:
apt-get update
will only update the DATABASE of package versions available.
Code:
apt-get upgrade  or
apt-get dist-upgrade
will USE that data to bring all of your installed package up to the current available level.

Neither implies the other in any way.
 
1 members found this post helpful.
Old 03-02-2018, 07:43 AM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

Rep: Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182
... and in retrospect maybe they should have used a different subcommand-name ... "'update' what?"

It is ambiguous. But, we're stuck with it now.
 
Old 03-02-2018, 08:13 AM   #5
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,124
Blog Entries: 1

Rep: Reputation: 870Reputation: 870Reputation: 870Reputation: 870Reputation: 870Reputation: 870Reputation: 870
$ sudo apt-get update

updates the known list of available packages. Which can include knowledge of upgrades. It does not change anything other than it's "list".

$ sudo apt-get upgrade

will check for updates on the "list", but does not run apt-get update. And will grab those updates and apply them, or tell you nothing that is currently installed has updates.

I normally use them in this way. Given that my american 3rd world telecom is SLOW, super slow by international standards.

$ sudo apt-get update
$ sudo apt-get -d dist-upgrade
$ sudo apt-get update
$ sudo apt-get -d dist-upgrade
$ sudo apt-get dist-upgrade

The 2nd update is to check for any NEW updates since I started downloading the "list" of updates. If it does grab some, I might run it a 3rd time. When the 2nd or more update finds nothing new (as determined by how long it takes / data transfers), then I get and apply the updates.
 
1 members found this post helpful.
Old 03-02-2018, 04:52 PM   #6
mr.travo
Member
 
Registered: Oct 2017
Location: All over the US
Distribution: Mint 18.3 Cinnamon, Gallium, Ubuntu Armbian (headless), Arch (learning)
Posts: 138

Rep: Reputation: 10
I'm sorry for the ignorant question I am about to ask, but wasn't apt-get replaced by the "newer" apt command? Just wondering if there is still a difference. I have been using just apt for the last few months.

Knowledge is power and I have the power of a watch battery right now

T

Last edited by mr.travo; 03-02-2018 at 04:56 PM.
 
Old 03-03-2018, 08:30 AM   #7
zaivala
Member
 
Registered: Mar 2008
Location: Blaine TN USA
Distribution: Linux Mint 19.3, Bodhi 5, OpenMandriva Lx 4.1, Manjaro Cinnam,on 2020, others
Posts: 246

Original Poster
Blog Entries: 38

Rep: Reputation: 46
Some distros have tried to move us to the "new" apt command. I have found that apt-get continues to work as before.

And thank you to all the above for your answers.
 
Old 03-03-2018, 08:40 AM   #8
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2909Reputation: 2909Reputation: 2909Reputation: 2909Reputation: 2909Reputation: 2909Reputation: 2909Reputation: 2909Reputation: 2909Reputation: 2909Reputation: 2909
Quote:
Originally Posted by mr.travo View Post
I'm sorry for the ignorant question I am about to ask, but wasn't apt-get replaced by the "newer" apt command? Just wondering if there is still a difference. I have been using just apt for the last few months.

Knowledge is power and I have the power of a watch battery right now

T
There are indeed a few differences.

For example, apt update also lets you know if any packages need upgrading, whereas apt-get update doesn't.

In general, I would advise that you use apt, only reverting to apt-get, apt-cache etc. (apt is intended as a replacement for several applications) if apt doesn't provide the required functionality.
 
Old 03-03-2018, 03:07 PM   #9
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,124
Blog Entries: 1

Rep: Reputation: 870Reputation: 870Reputation: 870Reputation: 870Reputation: 870Reputation: 870Reputation: 870
apt-get still works, so no need to relearn things just yet.
 
Old 03-03-2018, 03:50 PM   #10
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,575

Rep: Reputation: 1885Reputation: 1885Reputation: 1885Reputation: 1885Reputation: 1885Reputation: 1885Reputation: 1885Reputation: 1885Reputation: 1885Reputation: 1885Reputation: 1885
man apt:

Code:
SCRIPT USAGE AND DIFFERENCES FROM OTHER APT TOOLS
       The apt(8) commandline is designed as an end-user tool and it may change
       behavior between versions. While it tries not to break backward
       compatibility this is not guaranteed either if a change seems beneficial
       for interactive use.

       All features of apt(8) are available in dedicated APT tools like apt-
       get(8) and apt-cache(8) as well.  apt(8) just changes the default value
       of some options (see apt.conf(5) and specifically the Binary scope). So
       you should prefer using these commands (potentially with some additional
       options enabled) in your scripts as they keep backward compatibility as
       much as possible.
 
  


Reply

Tags
apt-get update, apt-get upgrades


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Slective update/upgrade in yum update -y command sysmicuser Linux - Newbie 4 09-02-2016 10:40 PM
update/upgrade/dist-upgrade timl Debian 1 05-16-2016 07:52 PM
[SOLVED] Update Manager - Unable to update or upgrade Flaysey Linux - Newbie 7 01-06-2014 11:20 PM
Update -vs Upgrade carlosinfl Debian 14 10-30-2011 02:06 PM
Unable to upgrade to ubuntu 7.10, update manager fails to update.... jonbvgood Linux - Software 2 02-05-2008 04:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration