How to reinstall a package? (Ubuntu 16.04)

asked 2017-10-18 12:32:18 -0600

tylerecouture gravatar image

I have a package installed with puppet:

  apt::ppa { 'ppa:thopiekar/cura':
      ensure => present,
  package { 'cura':
      ensure  => latest,
      require => [ Class['apt::update'], Apt::Ppa['ppa:thopiekar/cura'] ],

The package has stopped working, but I can get it to work if I manually remove it and its dependencies and reinstall:

sudo apt remove cura
sudo apt autoremove
sudo apt install cura

How can I get puppet to do this reinstall process on my nodes? I haven't pinpointed the cause of the error, but I know that reinstalling this way fixes it.

edit retag flag offensive close merge delete


Since PP 4.0 the `package` resource type has become refreshable. It has a `reinstall_on_refresh` attribute. However, only the `portage` provider has the feature `reinstallable`. So either tweak the `apt` provider, or simply write an `exec` resource doing your job, bc still smth's need to notify it.

Kai Burghardt gravatar imageKai Burghardt ( 2017-10-18 12:45:45 -0600 )edit