Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
Quote:
Originally Posted by zaivala
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".
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.
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.
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.
Distribution: Mint 18.3 Cinnamon, Gallium, Ubuntu Armbian (headless), Arch (learning)
Posts: 138
Rep:
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
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.