-
Notifications
You must be signed in to change notification settings - Fork 23.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apt module failing to update cache in Ubuntu 16.04 LTS #18987
Comments
From @koenpunt on May 29, 2016 16:2 For me installing the |
From @ansibot on July 31, 2016 22:16 @ansible, ping. This issue is still waiting on your response. |
From @subcreator on September 2, 2016 10:20 I have the same problem! |
From @ansibot on September 2, 2016 10:28 @ansible, ping. This issue is still waiting on your response. |
From @resuni on September 16, 2016 3:40 Experiencing the same problem on Debian 8 with Ansible 2.1.1.0.
Should probably use
|
From @zezke on September 20, 2016 13:0 I can verify that install aptitude did work, but it brought along some extra packages as well. Would be nice if all that could be avoided by making Ansible use |
From @ansibot on September 20, 2016 13:17 @ansible, ping. This issue is still waiting on your response. |
From @ansibot on October 6, 2016 14:44 @ansible, ping. This issue is still waiting on your response. |
From @codegastudio on October 19, 2016 13:34 Same problem with raspberry pi on jessie
|
From @Pkuutn on October 20, 2016 13:49 I have the same issue with Debian Stretch |
From @ansibot on October 22, 2016 8:56 @ansible, ping. This issue is still waiting on your response. |
From @gerhard-tinned on October 23, 2016 18:49 +1 I have the same issue. Interestingly, my Ubuntu servers work without problem. my Debian host on the other hand shows exactly this issue. |
From @ansibot on November 6, 2016 9:51 @ansible, ping. This issue is still waiting on your response. |
From @bdgscotland on November 22, 2016 9:28 +1 on AWS Ubuntu 16.04 LTS AMI and Ansible 2.2.0.0
|
From @ansibot on November 22, 2016 9:59 @ansible, ping. This issue is still waiting on your response. |
From @bekerov on December 4, 2016 18:1 same trouble. i cant figure out. Installed today ansible on new machine and my ansible is not work |
From @ansibot on December 7, 2016 20:4 This repository has been locked. All new issues and pull requests should be filed in https://github.com/ansible/ansible Please read through the repomerge page in the dev guide. The guide contains links to tools which automatically move your issue or pull request to the ansible/ansible repo. |
heya ppl!
after doing some research I've conculded that error appears when there are
some problems wit repositories or repository settings.
i.e. i had a stalled google chrome repo config in /etc/apt/sources.list.d
First thing you should do is ssh and check the result of apt-get update
command manually
2016-12-08 17:00 GMT+03:00 YPCrumble <notifications@github.com>:
… *From @gerhard-tinned <https://github.com/gerhard-tinned> on October 23,
2016 18:49*
+1
I have the same issue. Interestingly, my Ubuntu servers work without
problem. my Debian host on the other hand shows exactly this issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18987 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFWX0lkJTMQPyttQLXBhF5Ht3lEY0v-2ks5rGA1igaJpZM4LH2PK>
.
|
I am having this exact issue, with Ubuntu 16.04 and |
I had same issue using APT | Update on Debian 7. |
The weirdest thing about this actually is that the following fails:
But this does work:
|
@koenpunt That makes perfect sense, no? Since the issue is that a |
I would think that the apt task always uses the same tool in the background, but apparently it's not. |
I am also experiencing the "Could not fetch updated apt files" error when |
same here with ubuntu 16.04 lts and ansible 2.2.1.0 |
Same issue on ansible 2.2.1.0 |
Same issue here. @koenpunt's workaround seems to have helped! |
@YPCrumble did you ever find a workaround? aptitude didn't help for me also. running everything as raw didn't either |
Are there plans to address this issue? The current workaround, for me, is to run the following command before using Ansible:
I use Packer with Ansible, so it's fairly straight forward to put that into a script that bootstraps Ansible on Ubuntu but it's a really ugly hack. |
I'm having this exact issue, with Ubuntu 16.04 and ansible 2.2.0.0. |
@misham luckily you can work this around within Ansible, as only certain
which would fail due to lack of
and you are good as before. |
Also getting this on version 2.3.1.0.... Tried using @MarcinOrlowski solution but that hasn't worked for me and produces a huge error message https://pastebin.com/Q9JHXX0y <-- Yeah It's that big!! |
The behavior of
and the second point seems to be the reason for using With
where the options induce the expected & desired behavior. This is again according to the man page, and also this askubuntu question) So... I'm gonna submit a pull request where the An argument in favor of |
@gurutom I only took a very quick look at your pasetbin, but the fact that the output contains
is (at least for me) an indicator that this might be due to a pre-existing condition ; ) Looking a bit further, I see
Wild guess: Is it possible that your boot partition is full of kernel images?
I think there might be something wrong with your system, @MarcinOrlowski's solution should fix it. |
In answer to ansible#2540, `aptitude` was introduced as tool of choice for running upgrades in the apt module and installing new packages that arise as dependencies during upgrades. This recently lead to problems, as for example Ubuntu Xenial (16.04) ships without aptitude (installed). Studying the man pages of both apt-get and aptitude, it appears that we can achieve the effects of `aptitude safe-upgrade` using ``` apt-get upgrade --with-new-pkgs --autoremove ``` while `aptitude full-upgrade` seems to be identical to `apt-get dist-upgrade`. An argument in favor of apt-get over aptitude is that the former is more back-end, while the latter is more user-friendly - I suppose (peronsal humble opinion) that in ansible core, we should try to use the potentially more stable and backwards compatible back-end tools. Cf. ansible#18987
In answer to ansible#2540, `aptitude` was introduced as tool of choice for running upgrades in the apt module and installing new packages that arise as dependencies during upgrades. This recently lead to problems, as for example Ubuntu Xenial (16.04) ships without aptitude (installed). Studying the man pages of both apt-get and aptitude, it appears that we can achieve the effects of `aptitude safe-upgrade` using ``` apt-get upgrade --with-new-pkgs --autoremove ``` while `aptitude full-upgrade` seems to be identical to `apt-get dist-upgrade`. We use `apt-get` as described above as a fall-back in case that `aptitude` cannot be found, issuing a warning when it does so. Furthermore it introduces a flag `force_apt_get` which may be used to enforce usage of apt-get (which does not issue a warning). The integration tests are updated accordingly. Cf. also the discussion in ansible#27370. Fixes ansible#18987
In answer to #2540, `aptitude` was introduced as tool of choice for running upgrades in the apt module and installing new packages that arise as dependencies during upgrades. This recently lead to problems, as for example Ubuntu Xenial (16.04) ships without aptitude (installed). Studying the man pages of both apt-get and aptitude, it appears that we can achieve the effects of `aptitude safe-upgrade` using ``` apt-get upgrade --with-new-pkgs --autoremove ``` while `aptitude full-upgrade` seems to be identical to `apt-get dist-upgrade`. We use `apt-get` as described above as a fall-back in case that `aptitude` cannot be found, issuing a warning when it does so. Furthermore it introduces a flag `force_apt_get` which may be used to enforce usage of apt-get (which does not issue a warning). The integration tests are updated accordingly. Cf. also the discussion in #27370. Fixes #18987
see: * ansible/ansible-modules-core#3523 * ansible/ansible#18987 modified: roles/common/tasks/includes/development/development-python3.yml modified: roles/common/tasks/includes/development/development-zeal.yml modified: roles/common/tasks/includes/utilities/utilities-antivirus.yml modified: roles/common/tasks/includes/utilities/utilities-cli.yml modified: roles/common/tasks/includes/utilities/utilities-gui.yml modified: roles/common/tasks/includes/utilities/utilities-passwords.yml modified: roles/common/tasks/includes/utilities/utilities-powerline.yml modified: roles/common/tasks/includes/utilities/utilities-syncthing.yml modified: roles/common/tasks/includes/utilities/utilities-vim.yml modified: roles/common/tasks/main.yml
Even though this is closed, I would like to add my experience in case it helps others. In my case ansibles "apt: update_cache: yes" was failing because the command "sudo apt update" was raising some warnings about a cdrom source that it could not find or wasn't in the expected format. Apparently the ansible "apt" module caught these warnings as errors and proceded to fail the task. My solution was to remove (or comment) the lines with "cdrom" in "/etc/apt/sources.list". I did this through ansible, using the "lineinfile" module. My setup:
Hope this helps someone. |
From @tjbenator on April 23, 2016 7:18
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
CONFIGURATION
Mostly defaults, nothing that would affect this.
https://github.com/binarypenguin/automation/blob/master/ansible.cfg
OS / ENVIRONMENT
Ubuntu 16.04 -> Ubuntu 16.04
SUMMARY
STEPS TO REPRODUCE
EXPECTED RESULTS
Download apt updates
ACTUAL RESULTS
sudo apt-get update
works fine on the host. I thought the issue was that Ubuntu 16.04 LTS does not include Aptitude by default. Also python-apt wasn't installed. Installing them both on the remote machine did not fix the issue.Copied from original issue: ansible/ansible-modules-core#3523
The text was updated successfully, but these errors were encountered: