apt-get, update and upgrade

Chat about Linux in general
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 6 months after creation.
Locked
mike acker
Level 7
Level 7
Posts: 1517
Joined: Wed Jul 31, 2013 6:29 pm
Location: Kalamazoo, MI

apt-get, update and upgrade

Post by mike acker »

according to the manual

Code: Select all

man apt-get
I should be able to: (using sudo of course)

Code: Select all

apt-get update
followed by

Code: Select all

apt-get upgrade
...and this should result in all the packages that I have now ending up re-installed to their current package level

I'm targeting VLC,...
I did the apt-get update and this appeared to work as it should,-- I didn't see anything that looked like an error message. this should mean that my

Code: Select all

/etc/apt/sources.list.d $ ls
official-package-repositories.list
.... is up to date....

from this point the apt-get upgrade option should be ready to use... it might upgrade a program that is working now,-- that seems to be the risk to take with this. VLC has quite an assortment of different elements in the Package Manager,-- perhaps I should un-install/re-install each of these ?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
¡Viva la Resistencia!
User avatar
xenopeek
Level 25
Level 25
Posts: 29587
Joined: Wed Jul 06, 2011 3:58 am

Re: apt-get, update and upgrade

Post by xenopeek »

You're confusing some things.

apt-get update refreshes the package index cache on your local system from from remote servers. Those are stored on your system in /var/lib/apt/lists. These are the lists with information about the available packages from the repositories configured in the files /etc/apt/sources.list and /etc/apt/sources.list.d/*.list (use the command "inxi -r" to easily show all your configured repositories). apt-get update basically gives you a local copy of the inventory list on the servers.

apt-get upgrade will go through that list and compare currently installed versions on your system with available to install versions from the servers. If there is a newer version, an upgrade will be done.

It is more detailed than that though, as different repositories may be configured with different priorities and you may also "pin" packages so they are never upgraded automatically. If a package isn't upgrading but you did expect it, run this command and replace package with the name of the package:

Code: Select all

apt-cache policy package
This will show you the available versions of this package from all repositories and which (if any) of these is currently installed and which (if any) is the upgrade candidate. It also lists the priority of the repositories.
Image
Locked

Return to “Chat about Linux”