How to fix 'unknown user 'redis' in statoverride file' - redis

I'm installing redis, everytime I run this command sudo apt install redis-server I got an unrecoverable fatal error
I already tried many solutions to completly remove redis, redis-server, but nothing worked, this is the error
dpkg: unrecoverable fatal error, aborting:
unknown user 'redis' in statoverride file
E: Sub-process /usr/bin/dpkg returned an error code (2)

I solved it by opening the statoverride file using
sudo nano /var/lib/dpkg/statoverride
then removing the line with the user called "redis" along with any blank lines.

Related

Lynis wont work, 'error: Unknown option 'ssl-certificate-paths-to-ignore' found (with value: /etc/letsencrypt/archive:)

How do I correct/get rid of the following error? It prevents me from executing any lynis commands.
Output of "Sudo lynis show version" or any lynis command:
"Error: Unknown option 'ssl-certificate-paths-to-ignore' found (with value: /etc/letsencrypt/archive:)".
Background: Installed lynis, but couldn't figure out how to use it - got stuck on changing the parameters following a guide. Tried using another guide (https://adamtheautomator.com/lynis/), which included installing lynis again, and got this error
Tried purging and removing lynis, but got this error again after reinstalling, because thought the error had occured when I had first tried to install and configure lynis.
During the purge got:
"Purging configuration files for lynis (3.0.8-100) ...
dpkg: warning: while removing lynis, directory '/etc/lynis' not empty so not removed
Purging configuration files for menu (2.1.47ubuntu4) ...".

Vagrant - Ansible error installing Apache

I'm working on a project with Vagrant and Ansible and Virtualbox.
When I try to install Apache on an ubuntu precise (14.04) box, Vagrant fails. I improved the answer after.
It seems a known bug, but even if I'm installing a newer version, the error shows up.
I tried also as stated here, but with no luck.
How can I resolve this issue?
Thank you.
UPDATED ANSWER
This is the Ansible task.
Version 1:
- name: Install Apache
sudo: yes
apt: pkg=apache2 state=latest
register: apache2_apt
Output:
failed: [default] => {"failed": true}
stderr: E: Sub-process /usr/bin/dpkg returned an error code (1)
stdout: Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
www-browser apache2-doc apache2-suexec-pristine apache2-suexec-custom
The following NEW packages will be installed:
apache2
0 upgraded, 1 newly installed, 0 to remove and 183 not upgraded.
Need to get 0 B/146 kB of archives.
After this operation, 460 kB of additional disk space will be used.
(Reading database ... 52932 files and directories currently installed.)
Unpacking apache2 (from .../apache2_2.4.12-1+deb.sury.org~precise+5_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/apache2_2.4.12-1+deb.sury.org~precise+5_amd64.deb (--unpack):
error setting ownership of `/var/www/html.dpkg-new': Operation not permitted
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Errors were encountered while processing:
/var/cache/apt/archives/apache2_2.4.12-1+deb.sury.org~precise+5_amd64.deb
msg: '/usr/bin/apt-get -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" install 'apache2'' failed: E: Sub-process /usr/bin/dpkg returned an error code (1)
FATAL: all hosts have already failed -- aborting
Version 2:
- name: Install Apache
command: "sudo apt-get install apache2"
register: apache2_apt
Output:
failed: [default] => {"changed": true, "cmd": ["sudo", "apt-get", "install", "apache2"], "delta": "0:00:07.745095", "end": "2015-06-09 11:08:53.726031", "rc": 100, "start": "2015-06-09 11:08:45.980936", "warnings": []}
stderr: E: Sub-process /usr/bin/dpkg returned an error code (1)
stdout: Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
www-browser apache2-doc apache2-suexec-pristine apache2-suexec-custom
The following NEW packages will be installed:
apache2
0 upgraded, 1 newly installed, 0 to remove and 183 not upgraded.
Need to get 0 B/146 kB of archives.
After this operation, 460 kB of additional disk space will be used.
(Reading database ... 52932 files and directories currently installed.)
Unpacking apache2 (from .../apache2_2.4.12-1+deb.sury.org~precise+5_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/apache2_2.4.12-1+deb.sury.org~precise+5_amd64.deb (--unpack):
error setting ownership of `/var/www/html.dpkg-new': Operation not permitted
Processing triggers for man-db ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
Errors were encountered while processing:
/var/cache/apt/archives/apache2_2.4.12-1+deb.sury.org~precise+5_amd64.deb
FATAL: all hosts have already failed -- aborting
There are few possible issues for this
You need to disable apparmor or better add a rule to apparmor service for ability to have access by the script to /var/www within guest machine
There is a trouble with host machine permissions for /var/www folder. Try to check if the user has access to local folder, mapped as shared folder from host to guest - possibly you need to add permissions for local user at host machine.
try to use ansible-galaxy and search for already created role with fixes for both previous issues

Error installing libapache2-mod-rpaf for detecting IPs using nginx as a reverse proxy

I've seen here, that I should install mod_rpaf so that Apache will be able to detect the IPs coming from the Nginx reverse proxy.
Even seen that there is a bug on Ununtu SO, and it should be solved changing the first line on /etc/apache2/mods-available/rpaf.conf.
The first line contains <IfModule rpaf_module>. I've tried replacing with <IfModule mod_rpaf-2.0.c>, but nothing changes when I restart the Apache.
This is the output when I try to install this module:
apt-get install libapache2-mod-rpaf
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
libapache2-mod-rpaf
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/9,126 B of archives.
After this operation, 67.6 kB of additional disk space will be used.
Selecting previously unselected package libapache2-mod-rpaf.
(Reading database ... 28714 files and directories currently installed.)
Unpacking libapache2-mod-rpaf (from .../libapache2-mod-rpaf_0.6-2ubuntu1_amd64.deb) ...
Setting up libapache2-mod-rpaf (0.6-2ubuntu1) ...
Enabling module rpaf.
* Restarting web server apache2 [fail]
* The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/rpaf.load: API module structure 'rpaf_module' in file /usr/lib/apache2/modules/mod_rpaf.so is garbled - expected signature 41503234 but saw 41503232 - perhaps this is not an Apache module DSO, or was compiled for a different Apache version?
Action 'configtest' failed.
The Apache error log may have more information.
invoke-rc.d: initscript apache2, action "restart" failed.
dpkg: error processing libapache2-mod-rpaf (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
libapache2-mod-rpaf
E: Sub-process /usr/bin/dpkg returned an error code (1)
Per the error, you already have a version of /usr/lib/apache2/modules/mod_rpaf.so on your system with a filehash that differs from what the package config is expecting (expected signature 41503234 but saw 41503232), so you either need to:
1) Work out what installed the conflicting version and uninstall it:
dpkg -S /usr/lib/apache2/modules/mod_rpaf.so
apt-get --purge remove <package>
Or if manually added:
mv /usr/lib/apache2/modules/mod_rpaf.so /usr/lib/apache2/modules/mod_rpaf.so.bak
apt-get install libapache2-mod-rpaf
This may break other stuff.
2) Manually download, re-compile and install from source, should solve the immediate issue, but you'll hit the same conflicting signature issue if you try to update via apt.
3) Unpack the deb file, hack the hash in the config, repackage and install.

RabbitMQ server error

UPDATED error message
I am getting a BOOT FAILED error every time I try to start the rabbitmq server. Does anybody know how I can fix this? I have attached the error message. I have tried a few different things including uninstalling and reinstalling it and am now getting a new error message, but am at a loss for what to try next. Any suggestions are much appreciated! Thank you!!
BOOT FAILED
===========
Error description:
{error,
{schema_integrity_check_failed,
[{table_missing,rabbit_exchange_serial},
{table_missing,rabbit_runtime_parameters},
{table_missing,rabbit_durable_queue},
{table_missing,rabbit_queue},
{table_missing,gm_group},
{table_missing,mirrored_sup_childspec}]}}
Log files (may contain more information):
/usr/local/var/log/rabbitmq/rabbit#localhost.log
/usr/local/var/log/rabbitmq/rabbit#localhost-sasl.log
Stack trace:
[{rabbit_mnesia,ensure_schema_integrity,0,
[{file,"src/rabbit_mnesia.erl"},{line,519}]},
{rabbit_mnesia,init_db,3,[{file,"src/rabbit_mnesia.erl"},{line,450}]},
{rabbit_mnesia,init_db_and_upgrade,3,
[{file,"src/rabbit_mnesia.erl"},{line,458}]},
{rabbit_mnesia,init,0,[{file,"src/rabbit_mnesia.erl"},{line,99}]},
{rabbit,'-run_boot_step/1-lc$^1/1-1-',1,
[{file,"src/rabbit.erl"},{line,488}]},
{rabbit,run_boot_step,1,[{file,"src/rabbit.erl"},{line,487}]},
{rabbit,'-start/2-lc$^0/1-0-',1,[{file,"src/rabbit.erl"},{line,453}]},
{rabbit,start,2,[{file,"src/rabbit.erl"},{line,453}]}]
BOOT FAILED
===========
Error description:
{could_not_start,rabbit,
{bad_return,
{{rabbit,start,[normal,[]]},
{'EXIT',
{rabbit,failure_during_boot,
{error,
{schema_integrity_check_failed,
[{table_missing,rabbit_exchange_serial},
{table_missing,rabbit_runtime_parameters},
{table_missing,rabbit_durable_queue},
{table_missing,rabbit_queue},
{table_missing,gm_group},
{table_missing,mirrored_sup_childspec}]}}}}}}}
Log files (may contain more information):
/usr/local/var/log/rabbitmq/rabbit#localhost.log
/usr/local/var/log/rabbitmq/rabbit#localhost-sasl.log
{"init terminating in do_boot",{rabbit,failure_during_boot,{could_not_start,rabbit,{bad_return,{{rabbit,start,[normal,[]]},{'EXIT',{rabbit,failure_during_boot,{error,{schema_integrity_check_failed,[{table_missing,rabbit_exchange_serial},{table_missing,rabbit_runtime_parameters},{table_missing,rabbit_durable_queue},{table_missing,rabbit_queue},{table_missing,gm_group},{table_missing,mirrored_sup_childspec}]}}}}}}}}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
I don't know how rabbitmq works, but the error message looks clear: it tries to delete the directory /usr/local/var/lib/rabbitmq/mnesia/rabbit#localhost-plugins-expand, and fails because the process has nt the access right to delete the file /usr/local/var/lib/rabbitmq/mnesia/rabbit#localhost-plugins-expand/amqp_client-3.1.3/ebin/amqp_auth_mechanisms.beam.
Take a look at who is the owner of this file and directory, what are the access right to them.
This occurred for me during a rabbitmq upgrade with brew.
It was easier for me to just remove the directory all together and install from scratch.
sudo rm -rf /usr/local/var/rabbitmq/
brew uninstall rabbitmq;
brew install rabbitmq
rabbitmq-server
Got this to work. Just delete the database directory and restart server. Note if you had brew installed, database might still be outside Cellar directory. So need to manually delete directory and restart.

Setting up ruby-rvm (1.6.9-0ubuntu2) ... error

Setting up ruby-rvm (1.6.9-0ubuntu2) ...
dpkg-statoverride: error: syntax error: unknown group 'admin' in statoverride file
dpkg: error processing ruby-rvm (--configure):
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
ruby-rvm
E: Sub-process /usr/bin/dpkg returned an error code (1)
This error is drivin me crazy. can anyone help me.. m fed offfffff
https://bugs.launchpad.net/ubuntu/+source/ruby-rvm/+bug/963662
Locate /var/lib/dpkg/info/ruby-rvm.postinst
Opened it and replaced the admin group requirement to sudo. Save the file and try again.