How do commands "apt-get update" and "apt-get upgrade" work?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
iliyan_pi
Level 1
Level 1
Posts: 40
Joined: Fri Apr 11, 2014 12:37 pm

How do commands "apt-get update" and "apt-get upgrade" work?

Post by iliyan_pi »

How do commands "apt-get update" and "apt-get upgrade" work? Why do they need to be started one after anоther?
Thank You.
User avatar
karlchen
Level 21
Level 21
Posts: 13323
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: How do commands "apt-get update" and "apt-get upgrade" work?

Post by karlchen »

Hello, iliyan_pi.

The command sudo apt-get update queries the software repositories for the most recent list of up-to-date software packages.
This software list is stored on your local disk.

The command sudo apt-get upgrade uses the locally stored software list on your local disk in order to
1. determine which software packages on your system need to be updated
2. download and install the updatable software packages

This is why you have to
1. update the list of available software packages (sudo apt-get update)
2. install the available updates (sudo apt-get upgrade)
in this order.

Best regards,
Karl
Image
Linux Mint 19.3 64-bit Cinnamon, Total Commander 9.51 64-bit
Haß gleicht einer Krankheit, dem Miserere, wo man vorne herausgibt, was eigentlich hinten wegsollte. (Goethe)
psklenar
Level 1
Level 1
Posts: 21
Joined: Sun Jan 06, 2019 2:30 pm

Re: How do commands "apt-get update" and "apt-get upgrade" work?

Post by psklenar »

Am I correct in my understanding that apt is replacing apt-get? And if so, can *any* command I see listed for apt-get be replaced by the matching apt command?

pat----
iliyan_pi
Level 1
Level 1
Posts: 40
Joined: Fri Apr 11, 2014 12:37 pm

Re: How do commands "apt-get update" and "apt-get upgrade" work?

Post by iliyan_pi »

If so, can I correct this list, for not to be upgrade one program , and where to find it?
Regards !
User avatar
kc1di
Level 16
Level 16
Posts: 6320
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: How do commands "apt-get update" and "apt-get upgrade" work?

Post by kc1di »

The newer command is apt which is replacing apt-get heres a page that will help you know the differences. https://itsfoss.com/apt-vs-apt-get-difference/

I might remind you that on mint it is better to use the update manager to do upgrade not the terminal. If you use the terminal you are negating the update levels and will eventually break the system.
Easy tips : https://easylinuxtipsproject.blogspot.com/ Pjotr's Great Linux projects page.
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608
User avatar
karlchen
Level 21
Level 21
Posts: 13323
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: How do commands "apt-get update" and "apt-get upgrade" work?

Post by karlchen »

<mumbling>
kc1di wrote:
Tue Feb 05, 2019 10:43 am
If you use the terminal you are negating the update levels and will eventually break the system.
I have negated the update levels since Mint 13 (published in May 2012). I have done so by enabling all 5 levels as visible and safe for installation (on Mint 18.3 levels 1 to 4) and by basically updating in the Ubuntu way. I have done so using Update Manager and hardly ever using the terminal. I have never broken my system this way, except once when an updated proprietary NVidia driver spoilt my GUI experience. Has never happened again since my systems are on open source drivers. :)
</mumbling>
Image
Linux Mint 19.3 64-bit Cinnamon, Total Commander 9.51 64-bit
Haß gleicht einer Krankheit, dem Miserere, wo man vorne herausgibt, was eigentlich hinten wegsollte. (Goethe)
gm10
Level 20
Level 20
Posts: 10999
Joined: Thu Jun 21, 2018 5:11 pm

Re: How do commands "apt-get update" and "apt-get upgrade" work?

Post by gm10 »

iliyan_pi wrote:
Tue Feb 05, 2019 10:24 am
If so, can I correct this list, for not to be upgrade one program , and where to find it?
Regards !
You are looking for

Code: Select all

apt hold <package> 
Or in Software Manager simply right click an update and select to ignore it.
gm10
Level 20
Level 20
Posts: 10999
Joined: Thu Jun 21, 2018 5:11 pm

Re: How do commands "apt-get update" and "apt-get upgrade" work?

Post by gm10 »

<mumbling>
karlchen wrote:
Wed Feb 06, 2019 10:19 am
<mumbling>
kc1di wrote:
Tue Feb 05, 2019 10:43 am
If you use the terminal you are negating the update levels and will eventually break the system.
I have negated the update levels since Mint 13 (published in May 2012). I have done so by enabling all 5 levels as visible and safe for installation (on Mint 18.3 levels 1 to 4) and by basically updating in the Ubuntu way. I have done so using Update Manager and hardly ever using the terminal. I have never broken my system this way, except once when an updated proprietary NVidia driver spoilt my GUI experience. Has never happened again since my systems are on open source drivers. :)
</mumbling>

We will be removing levels in Mint 19.2 - good riddance.
</mumbling>
User avatar
all41
Level 16
Level 16
Posts: 6407
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: How do commands "apt-get update" and "apt-get upgrade" work?

Post by all41 »

karlchen bd.jpg
Light travels faster than sound.
That's why some people appear smart until you hear what they are saying.
Post Reply

Return to “Newbie Questions”