What does cache=yes mean in apt: update_cache=yes in Ansible?
Clash Royale CLAN TAG#URR8PPP
I know that apt update
updates existing package-indexes on a supporting distro but not upgrading installed-packages (utilities) that were being installed based on these package-indexes (as apt upgrade
upgrades the packages).
From the apt-get
man:
update
update
is used to resynchronize the package index files from their sources. The indexes of available
packages are fetched from the location(s) specified in/etc/apt/sources.list
. For example, when
using a Debian archive, this command retrieves and scans thePackages.gz
files, so that information
about new and updated packages is available. An update should always be performed before anupgrade
ordist-upgrade
. Please be aware that the overall progress meter will be incorrect as the size of
the package files cannot be known in advance.
I also know that Ansible has the apt
module which includes this directive:
- name: update the apt package index i.e. apt-get update
apt: update_cache=yes
The relevant Ansible docs say:
Run the equivalent of apt-get update before the operation. Can be run
as part of the package installation or as a separate step.
I assume they say "equivalent" because Ansible translates "old" codes to their community-derived up2date equivalents (if the original codes themselves change).
But I still miss what caching has to do with anything here? To me the concept of caching in computing is making a copy of something far in a closer place, to save navigation when we need to use it, thus saving resources, but I still miss what it has to do with apt update
or Ansible processing of apt update
.
apt ansible software-updates
add a comment |
I know that apt update
updates existing package-indexes on a supporting distro but not upgrading installed-packages (utilities) that were being installed based on these package-indexes (as apt upgrade
upgrades the packages).
From the apt-get
man:
update
update
is used to resynchronize the package index files from their sources. The indexes of available
packages are fetched from the location(s) specified in/etc/apt/sources.list
. For example, when
using a Debian archive, this command retrieves and scans thePackages.gz
files, so that information
about new and updated packages is available. An update should always be performed before anupgrade
ordist-upgrade
. Please be aware that the overall progress meter will be incorrect as the size of
the package files cannot be known in advance.
I also know that Ansible has the apt
module which includes this directive:
- name: update the apt package index i.e. apt-get update
apt: update_cache=yes
The relevant Ansible docs say:
Run the equivalent of apt-get update before the operation. Can be run
as part of the package installation or as a separate step.
I assume they say "equivalent" because Ansible translates "old" codes to their community-derived up2date equivalents (if the original codes themselves change).
But I still miss what caching has to do with anything here? To me the concept of caching in computing is making a copy of something far in a closer place, to save navigation when we need to use it, thus saving resources, but I still miss what it has to do with apt update
or Ansible processing of apt update
.
apt ansible software-updates
Maybe this should be migrated to DevOps stackexhcange - not sure.
– JohnDoea
Dec 11 at 17:13
1
May I suggest for future questions that you focus on what you want to find out, rather than explaining what you think you already know (since that tends to sow confusion rather than help anything)? Your questions would be much better if they focused on a specific point (in this case, “What’s the cache implied by Ansible’sapt
module’supdate_cache
parameter?”), instead of being “Tell me everything I need to know to understand ...” (which is how I understand your “I know ...”-based questions).
– Stephen Kitt
Dec 11 at 17:32
Well, I don't want to be accused of XY problem or a an XY concept abuse charade (there are people bored enough to do just that)... Part of explaining what I'm trying to do is explaining what I know that was had to be done or why, I assume.
– JohnDoea
Dec 11 at 17:34
add a comment |
I know that apt update
updates existing package-indexes on a supporting distro but not upgrading installed-packages (utilities) that were being installed based on these package-indexes (as apt upgrade
upgrades the packages).
From the apt-get
man:
update
update
is used to resynchronize the package index files from their sources. The indexes of available
packages are fetched from the location(s) specified in/etc/apt/sources.list
. For example, when
using a Debian archive, this command retrieves and scans thePackages.gz
files, so that information
about new and updated packages is available. An update should always be performed before anupgrade
ordist-upgrade
. Please be aware that the overall progress meter will be incorrect as the size of
the package files cannot be known in advance.
I also know that Ansible has the apt
module which includes this directive:
- name: update the apt package index i.e. apt-get update
apt: update_cache=yes
The relevant Ansible docs say:
Run the equivalent of apt-get update before the operation. Can be run
as part of the package installation or as a separate step.
I assume they say "equivalent" because Ansible translates "old" codes to their community-derived up2date equivalents (if the original codes themselves change).
But I still miss what caching has to do with anything here? To me the concept of caching in computing is making a copy of something far in a closer place, to save navigation when we need to use it, thus saving resources, but I still miss what it has to do with apt update
or Ansible processing of apt update
.
apt ansible software-updates
I know that apt update
updates existing package-indexes on a supporting distro but not upgrading installed-packages (utilities) that were being installed based on these package-indexes (as apt upgrade
upgrades the packages).
From the apt-get
man:
update
update
is used to resynchronize the package index files from their sources. The indexes of available
packages are fetched from the location(s) specified in/etc/apt/sources.list
. For example, when
using a Debian archive, this command retrieves and scans thePackages.gz
files, so that information
about new and updated packages is available. An update should always be performed before anupgrade
ordist-upgrade
. Please be aware that the overall progress meter will be incorrect as the size of
the package files cannot be known in advance.
I also know that Ansible has the apt
module which includes this directive:
- name: update the apt package index i.e. apt-get update
apt: update_cache=yes
The relevant Ansible docs say:
Run the equivalent of apt-get update before the operation. Can be run
as part of the package installation or as a separate step.
I assume they say "equivalent" because Ansible translates "old" codes to their community-derived up2date equivalents (if the original codes themselves change).
But I still miss what caching has to do with anything here? To me the concept of caching in computing is making a copy of something far in a closer place, to save navigation when we need to use it, thus saving resources, but I still miss what it has to do with apt update
or Ansible processing of apt update
.
apt ansible software-updates
apt ansible software-updates
edited Dec 11 at 17:33
Stephen Kitt
163k24362440
163k24362440
asked Dec 11 at 17:13
JohnDoea
1221132
1221132
Maybe this should be migrated to DevOps stackexhcange - not sure.
– JohnDoea
Dec 11 at 17:13
1
May I suggest for future questions that you focus on what you want to find out, rather than explaining what you think you already know (since that tends to sow confusion rather than help anything)? Your questions would be much better if they focused on a specific point (in this case, “What’s the cache implied by Ansible’sapt
module’supdate_cache
parameter?”), instead of being “Tell me everything I need to know to understand ...” (which is how I understand your “I know ...”-based questions).
– Stephen Kitt
Dec 11 at 17:32
Well, I don't want to be accused of XY problem or a an XY concept abuse charade (there are people bored enough to do just that)... Part of explaining what I'm trying to do is explaining what I know that was had to be done or why, I assume.
– JohnDoea
Dec 11 at 17:34
add a comment |
Maybe this should be migrated to DevOps stackexhcange - not sure.
– JohnDoea
Dec 11 at 17:13
1
May I suggest for future questions that you focus on what you want to find out, rather than explaining what you think you already know (since that tends to sow confusion rather than help anything)? Your questions would be much better if they focused on a specific point (in this case, “What’s the cache implied by Ansible’sapt
module’supdate_cache
parameter?”), instead of being “Tell me everything I need to know to understand ...” (which is how I understand your “I know ...”-based questions).
– Stephen Kitt
Dec 11 at 17:32
Well, I don't want to be accused of XY problem or a an XY concept abuse charade (there are people bored enough to do just that)... Part of explaining what I'm trying to do is explaining what I know that was had to be done or why, I assume.
– JohnDoea
Dec 11 at 17:34
Maybe this should be migrated to DevOps stackexhcange - not sure.
– JohnDoea
Dec 11 at 17:13
Maybe this should be migrated to DevOps stackexhcange - not sure.
– JohnDoea
Dec 11 at 17:13
1
1
May I suggest for future questions that you focus on what you want to find out, rather than explaining what you think you already know (since that tends to sow confusion rather than help anything)? Your questions would be much better if they focused on a specific point (in this case, “What’s the cache implied by Ansible’s
apt
module’s update_cache
parameter?”), instead of being “Tell me everything I need to know to understand ...” (which is how I understand your “I know ...”-based questions).– Stephen Kitt
Dec 11 at 17:32
May I suggest for future questions that you focus on what you want to find out, rather than explaining what you think you already know (since that tends to sow confusion rather than help anything)? Your questions would be much better if they focused on a specific point (in this case, “What’s the cache implied by Ansible’s
apt
module’s update_cache
parameter?”), instead of being “Tell me everything I need to know to understand ...” (which is how I understand your “I know ...”-based questions).– Stephen Kitt
Dec 11 at 17:32
Well, I don't want to be accused of XY problem or a an XY concept abuse charade (there are people bored enough to do just that)... Part of explaining what I'm trying to do is explaining what I know that was had to be done or why, I assume.
– JohnDoea
Dec 11 at 17:34
Well, I don't want to be accused of XY problem or a an XY concept abuse charade (there are people bored enough to do just that)... Part of explaining what I'm trying to do is explaining what I know that was had to be done or why, I assume.
– JohnDoea
Dec 11 at 17:34
add a comment |
1 Answer
1
active
oldest
votes
apt
maintains a local list of packages; that’s how it “knows” what packages are available, their dependencies etc. apt update
updates these lists of packages by retrieving them from the repositories; it doesn’t upgrade any package.
That’s what the cache is: it is a local cache of the package information available from the repositories configured on the system. apt
makes all its decisions based on this cache, so it must be kept up-to-date. An outdated cache can lead apt
to miss updates or to fail to install a package altogether (because the version it wants is no longer available from the repositories).
update_cache=yes
tells Ansible’s apt
module to refresh the caches before applying whatever change is necessary (if any).
Wait,update_cache=yes tells Ansible’s apt module to refresh the caches before applying whatever change is necessary (if any).
? Either the cache is updated or it isn't, right? So what do you mean byrefresh the caches before applying whatever change is necessary (if any)
?
– JohnDoea
Dec 11 at 17:21
2
Either the cache is updated or it isn’t, yes. I’m talking about usingupdate_cache
along with another option (e.g.apt: - name: nginx - update_cache: yes
to update the caches and installnginx
); in that case, the cache is updated, but the other action might not result in a change (if thenginx
package is already installed and up-to-date).
– Stephen Kitt
Dec 11 at 17:24
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f487400%2fwhat-does-cache-yes-mean-in-apt-update-cache-yes-in-ansible%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
apt
maintains a local list of packages; that’s how it “knows” what packages are available, their dependencies etc. apt update
updates these lists of packages by retrieving them from the repositories; it doesn’t upgrade any package.
That’s what the cache is: it is a local cache of the package information available from the repositories configured on the system. apt
makes all its decisions based on this cache, so it must be kept up-to-date. An outdated cache can lead apt
to miss updates or to fail to install a package altogether (because the version it wants is no longer available from the repositories).
update_cache=yes
tells Ansible’s apt
module to refresh the caches before applying whatever change is necessary (if any).
Wait,update_cache=yes tells Ansible’s apt module to refresh the caches before applying whatever change is necessary (if any).
? Either the cache is updated or it isn't, right? So what do you mean byrefresh the caches before applying whatever change is necessary (if any)
?
– JohnDoea
Dec 11 at 17:21
2
Either the cache is updated or it isn’t, yes. I’m talking about usingupdate_cache
along with another option (e.g.apt: - name: nginx - update_cache: yes
to update the caches and installnginx
); in that case, the cache is updated, but the other action might not result in a change (if thenginx
package is already installed and up-to-date).
– Stephen Kitt
Dec 11 at 17:24
add a comment |
apt
maintains a local list of packages; that’s how it “knows” what packages are available, their dependencies etc. apt update
updates these lists of packages by retrieving them from the repositories; it doesn’t upgrade any package.
That’s what the cache is: it is a local cache of the package information available from the repositories configured on the system. apt
makes all its decisions based on this cache, so it must be kept up-to-date. An outdated cache can lead apt
to miss updates or to fail to install a package altogether (because the version it wants is no longer available from the repositories).
update_cache=yes
tells Ansible’s apt
module to refresh the caches before applying whatever change is necessary (if any).
Wait,update_cache=yes tells Ansible’s apt module to refresh the caches before applying whatever change is necessary (if any).
? Either the cache is updated or it isn't, right? So what do you mean byrefresh the caches before applying whatever change is necessary (if any)
?
– JohnDoea
Dec 11 at 17:21
2
Either the cache is updated or it isn’t, yes. I’m talking about usingupdate_cache
along with another option (e.g.apt: - name: nginx - update_cache: yes
to update the caches and installnginx
); in that case, the cache is updated, but the other action might not result in a change (if thenginx
package is already installed and up-to-date).
– Stephen Kitt
Dec 11 at 17:24
add a comment |
apt
maintains a local list of packages; that’s how it “knows” what packages are available, their dependencies etc. apt update
updates these lists of packages by retrieving them from the repositories; it doesn’t upgrade any package.
That’s what the cache is: it is a local cache of the package information available from the repositories configured on the system. apt
makes all its decisions based on this cache, so it must be kept up-to-date. An outdated cache can lead apt
to miss updates or to fail to install a package altogether (because the version it wants is no longer available from the repositories).
update_cache=yes
tells Ansible’s apt
module to refresh the caches before applying whatever change is necessary (if any).
apt
maintains a local list of packages; that’s how it “knows” what packages are available, their dependencies etc. apt update
updates these lists of packages by retrieving them from the repositories; it doesn’t upgrade any package.
That’s what the cache is: it is a local cache of the package information available from the repositories configured on the system. apt
makes all its decisions based on this cache, so it must be kept up-to-date. An outdated cache can lead apt
to miss updates or to fail to install a package altogether (because the version it wants is no longer available from the repositories).
update_cache=yes
tells Ansible’s apt
module to refresh the caches before applying whatever change is necessary (if any).
edited Dec 11 at 17:27
answered Dec 11 at 17:16
Stephen Kitt
163k24362440
163k24362440
Wait,update_cache=yes tells Ansible’s apt module to refresh the caches before applying whatever change is necessary (if any).
? Either the cache is updated or it isn't, right? So what do you mean byrefresh the caches before applying whatever change is necessary (if any)
?
– JohnDoea
Dec 11 at 17:21
2
Either the cache is updated or it isn’t, yes. I’m talking about usingupdate_cache
along with another option (e.g.apt: - name: nginx - update_cache: yes
to update the caches and installnginx
); in that case, the cache is updated, but the other action might not result in a change (if thenginx
package is already installed and up-to-date).
– Stephen Kitt
Dec 11 at 17:24
add a comment |
Wait,update_cache=yes tells Ansible’s apt module to refresh the caches before applying whatever change is necessary (if any).
? Either the cache is updated or it isn't, right? So what do you mean byrefresh the caches before applying whatever change is necessary (if any)
?
– JohnDoea
Dec 11 at 17:21
2
Either the cache is updated or it isn’t, yes. I’m talking about usingupdate_cache
along with another option (e.g.apt: - name: nginx - update_cache: yes
to update the caches and installnginx
); in that case, the cache is updated, but the other action might not result in a change (if thenginx
package is already installed and up-to-date).
– Stephen Kitt
Dec 11 at 17:24
Wait,
update_cache=yes tells Ansible’s apt module to refresh the caches before applying whatever change is necessary (if any).
? Either the cache is updated or it isn't, right? So what do you mean by refresh the caches before applying whatever change is necessary (if any)
?– JohnDoea
Dec 11 at 17:21
Wait,
update_cache=yes tells Ansible’s apt module to refresh the caches before applying whatever change is necessary (if any).
? Either the cache is updated or it isn't, right? So what do you mean by refresh the caches before applying whatever change is necessary (if any)
?– JohnDoea
Dec 11 at 17:21
2
2
Either the cache is updated or it isn’t, yes. I’m talking about using
update_cache
along with another option (e.g. apt: - name: nginx - update_cache: yes
to update the caches and install nginx
); in that case, the cache is updated, but the other action might not result in a change (if the nginx
package is already installed and up-to-date).– Stephen Kitt
Dec 11 at 17:24
Either the cache is updated or it isn’t, yes. I’m talking about using
update_cache
along with another option (e.g. apt: - name: nginx - update_cache: yes
to update the caches and install nginx
); in that case, the cache is updated, but the other action might not result in a change (if the nginx
package is already installed and up-to-date).– Stephen Kitt
Dec 11 at 17:24
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f487400%2fwhat-does-cache-yes-mean-in-apt-update-cache-yes-in-ansible%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Maybe this should be migrated to DevOps stackexhcange - not sure.
– JohnDoea
Dec 11 at 17:13
1
May I suggest for future questions that you focus on what you want to find out, rather than explaining what you think you already know (since that tends to sow confusion rather than help anything)? Your questions would be much better if they focused on a specific point (in this case, “What’s the cache implied by Ansible’s
apt
module’supdate_cache
parameter?”), instead of being “Tell me everything I need to know to understand ...” (which is how I understand your “I know ...”-based questions).– Stephen Kitt
Dec 11 at 17:32
Well, I don't want to be accused of XY problem or a an XY concept abuse charade (there are people bored enough to do just that)... Part of explaining what I'm trying to do is explaining what I know that was had to be done or why, I assume.
– JohnDoea
Dec 11 at 17:34