[英]Reinstall deb package from another release
I need reinstall package from another target release. 我需要从另一个目标版本中重新安装软件包。 Problem is that if package is already installed no action is taken. 问题是,如果已安装软件包,则不会采取任何措施。 My ansible playbook fragment is: 我的剧本片段是:
- name: Add jessie-backports repo
apt_repository:
repo: 'deb http://httpredir.debian.org/debian jessie-backports main'
state: present
- name: install libssl from jessie-backports
apt:
name: libssl1.0.0
default_release: jessie-backports
and ansible answer is: 答案是:
ptmp3 | SUCCESS => {
"cache_update_time": 1493744770,
"cache_updated": true,
"changed": false,
"invocation": {
....
}
}
I can remove old version before installing new, but whole bunch of packages depends on libssl
( ssh
for example). 我可以在安装新版本之前删除旧版本,但是整个软件包都取决于libssl
(例如ssh
)。
Btw command apt-get install libssl1.0.0 -t jessie-backports
at remote host works, and libssl is updated Btw命令apt-get install libssl1.0.0 -t jessie-backports
在远程主机上运行,并且libssl已更新
Solution is to include exact version of package to be installed in apt task. 解决方案是在apt任务中包括要安装的软件包的确切版本。 Exact version can be retrieved by apt-cache
( apt-cache policy libssl1.0.0
). 可以通过apt-cache
( apt-cache policy libssl1.0.0
)检索确切的版本。
Appropriate chunk of playbook would be: 适当的剧本块是:
- name: Add jessie-backports repo
apt_repository:
update_cache: yes
repo: 'deb http://httpredir.debian.org/debian jessie-backports main'
state: present
- name: get libssl1.0.0 jessie-backports version
shell: apt-cache policy libssl1.0.0 | grep jessie-backports -B1 | head -n1 | sed -e 's/^\s*\**\s*\(\S*\).*/\1/'
register: libsslinstalled
- name: install libssl from jessie-backports
apt:
name: "libssl1.0.0={{ libsslinstalled.stdout_lines[0] }}"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.