LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 04:30 AM   #1
zaivala
Member
 
Registered: Mar 2008
Location: Blaine TN USA
Distribution: Linux Mint 20.1 Bodhi 6, OpenMandriva Lx 4.2, others
Posts: 264
Blog Entries: 52

Rep: Reputation: 51
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, 04:53 AM   #2
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
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, 05:40 AM   #3
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,623

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
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, 06:43 AM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
... 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, 07:13 AM   #5
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
$ 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, 03: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 03:56 PM.
 
Old 03-03-2018, 07:30 AM   #7
zaivala
Member
 
Registered: Mar 2008
Location: Blaine TN USA
Distribution: Linux Mint 20.1 Bodhi 6, OpenMandriva Lx 4.2, others
Posts: 264

Original Poster
Blog Entries: 52

Rep: Reputation: 51
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, 07:40 AM   #8
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
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, 02:07 PM   #9
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

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

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
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



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 09:40 PM
update/upgrade/dist-upgrade timl Debian 1 05-16-2016 06:52 PM
[SOLVED] Update Manager - Unable to update or upgrade Flaysey Linux - Newbie 7 01-06-2014 10:20 PM
Update -vs Upgrade carlosinfl Debian 14 10-30-2011 01:06 PM
Unable to upgrade to ubuntu 7.10, update manager fails to update.... jonbvgood Linux - Software 2 02-05-2008 03:58 PM

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

All times are GMT -5. The time now is 08:44 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