When I installed Redmine I had a problem in the middle of the database configuration. I think I ctrl C'ed in the middle of it because I tried to switch to Mysql after starting with sqlite3. Since then I can't remove it, install it, configure it, or reinstall it. The other question about fixing half installed package is returning an error 123.
sudo apt-get install redmine
Do you want to continue? [Y/n] y
dpkg: error processing package redmine (--configure):
package redmine is not ready for configuration
cannot configure (current status 'half-installed')
Errors were encountered while processing:
redmine
E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo apt-get remove redmine
Do you want to continue? [Y/n] y
dpkg: error processing package redmine (--remove):
package is in a very bad inconsistent state; you should
reinstall it before attempting a removal
Errors were encountered while processing:
redmine
E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo apt-get install --reinstall redmine
Preparing to unpack .../redmine_3.2.1-2_all.deb ...
Unpacking redmine (3.2.1-2) over (3.2.1-2) ...
ls: cannot access '/etc/redmine/*/database.yml': No such file or directory
dirname: missing operand
Try 'dirname --help' for more information.
basename: missing operand
Try 'basename --help' for more information.
dpkg: warning: subprocess old post-removal script returned error exit status 123
dpkg: trying script from the new package instead ...
ls: cannot access '/etc/redmine/*/database.yml': No such file or directory
dirname: missing operand
Try 'dirname --help' for more information.
basename: missing operand
Try 'basename --help' for more information.
dpkg: error processing archive /var/cache/apt/archives /redmine_3.2.1-2_all.deb (--unpack):
subprocess new post-removal script returned error exit status 123
ls: cannot access '/etc/redmine/*/database.yml': No such file or directory
dirname: missing operand
Try 'dirname --help' for more information.
basename: missing operand
Try 'basename --help' for more information.
dpkg: error while cleaning up:
subprocess new post-removal script returned error exit status 123
Errors were encountered while processing:
/var/cache/apt/archives/redmine_3.2.1-2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Redmine seem to have specific reinstallation procedure that I tried, but it fail at the step where you call Redmine because it's not installed.
I've tried the solution in this question about half installed package and its still not working :
sudo dpkg --remove --force-remove-reinstreq redmine
dpkg: warning: overriding problem because --force enabled:
dpkg: warning: package is in a very bad inconsistent state; you should
reinstall it before attempting a removal
(Reading database ... 409396 files and directories currently installed.)
Removing redmine (3.2.1-2) ...
ls: cannot access '/etc/redmine/*/database.yml': No such file or directory
dirname: missing operand
Try 'dirname --help' for more information.
basename: missing operand
Try 'basename --help' for more information.
dpkg: error processing package redmine (--remove):
subprocess installed post-removal script returned error exit status 123
Errors were encountered while processing:
redmine
Is there a way to fix this mess ? I don't care at all about what is in the mysql database or about the redmine configuration. I just want to start from scratch and be able to use redmine again.
Edit : I thougth I solved the problem with :
sudo rm /var/lib/dpkg/info/redmine*
sudo dpkg --force-remove-reinstreq --remove redmine
dpkg: warning: overriding problem because --force enabled:
dpkg: warning: package is in a very bad inconsistent state; you should
reinstall it before attempting a removal
dpkg: warning: files list file for package 'redmine-sqlite' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'redmine-mysql' missing; assuming package has no files currently installed
(Reading database ... 409382 files and directories currently installed.)
Removing redmine (3.2.1-2) ...
After an "apt-get purge --auto-remove redmine" to clean all the related packages, and to get rid of the configuration file, I was able to install redmine again... in theory. Because Rake is now failing (because of the ghost database configuration ?).
rake aborted!
Cannot load `Rails.application.database_configuration`:
Could not load database configuration. No such file - ["/usr/share/redmine/instances/default/config/database.yml"]
Then I still have the removal problem with apt-get remove :
ls: cannot access '/etc/redmine/*/database.yml': No such file or directory