Wednesday 2 December 2020

Ubuntu Fully remove software | Reinstall is not working correctly, due to last install

How to completely remove a package?

How to fully remove a package?

I have installed software Munin and then removed it and tried to install again, 2nd install did not have the config files, so used below, which fully removed the sofware and new install was fine with all config.
Removing packages with sudo apt purge ... or sudo apt --purge remove ... will remove them and all their global (i.e., systemwide) configuration files.

# apt-get --purge remove munin
I removing using just remove, some folders were there for software, so removed them usin 'rm', then performed an install, it did not install fully with the config fixes. So the --purge did the trick for me. root@linux-u20:~# apt remove munin munin-node Reading package lists... Done Building dependency tree Reading state information... Done Package 'munin' is not installed, so not removed Package 'munin-node' is not installed, so not removed The following packages were automatically installed and are no longer required: jo jq libalgorithm-c3-perl libb-hooks-endofscope-perl libb-hooks-op-check-perl libclass-c3-perl libclass-c3-xs-perl libclass-data-inheritable-perl libclass-method-modifiers-perl libclass-xsaccessor-perl libdata-optlist-perl libdate-manip-perl libdbi1 libdevel-callchecker-perl libdevel-caller-perl libdevel-globaldestruction-perl libdevel-lexalias-perl libdevel-stacktrace-perl libdist-checkconflicts-perl libdynaloader-functions-perl libemail-date-format-perl libeval-closure-perl libexception-class-perl libexporter-tiny-perl libfile-copy-recursive-perl libio-multiplex-perl libipc-shareable-perl libjq1 liblist-moreutils-perl liblog-dispatch-perl liblog-log4perl-perl libmail-sendmail-perl libmime-lite-perl libmime-types-perl libmodule-implementation-perl libmodule-runtime-perl libmro-compat-perl libnamespace-autoclean-perl libnamespace-clean-perl libnet-cidr-perl libnet-server-perl libnet-snmp-perl libonig5 libpackage-stash-perl libpackage-stash-xs-perl libpadwalker-perl libparams-classify-perl libparams-util-perl libparams-validationcompiler-perl libreadonly-perl libref-util-perl libref-util-xs-perl librole-tiny-perl librrd8 librrds-perl libspecio-perl libsub-exporter-perl libsub-exporter-progressive-perl libsub-identify-perl libsub-install-perl libsub-quote-perl libsys-hostname-long-perl libvariable-magic-perl libxstring-perl munin-common munin-doc munin-plugins-core munin-plugins-extra rrdtool Use 'apt autoremove' to remove them. 0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade. root@linux-u20:~# apt-get --purge remove munin Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: jo jq libalgorithm-c3-perl libb-hooks-endofscope-perl libb-hooks-op-check-perl libclass-c3-perl libclass-c3-xs-perl libclass-data-inheritable-perl libclass-method-modifiers-perl libclass-xsaccessor-perl libdata-optlist-perl libdate-manip-perl libdbi1 libdevel-callchecker-perl libdevel-caller-perl libdevel-globaldestruction-perl libdevel-lexalias-perl libdevel-stacktrace-perl libdist-checkconflicts-perl libdynaloader-functions-perl libemail-date-format-perl libeval-closure-perl libexception-class-perl libexporter-tiny-perl libfile-copy-recursive-perl libio-multiplex-perl libipc-shareable-perl libjq1 liblist-moreutils-perl liblog-dispatch-perl liblog-log4perl-perl libmail-sendmail-perl libmime-lite-perl libmime-types-perl libmodule-implementation-perl libmodule-runtime-perl libmro-compat-perl libnamespace-autoclean-perl libnamespace-clean-perl libnet-cidr-perl libnet-server-perl libnet-snmp-perl libonig5 libpackage-stash-perl libpackage-stash-xs-perl libpadwalker-perl libparams-classify-perl libparams-util-perl libparams-validationcompiler-perl libreadonly-perl libref-util-perl libref-util-xs-perl librole-tiny-perl librrd8 librrds-perl libspecio-perl libsub-exporter-perl libsub-exporter-progressive-perl libsub-identify-perl libsub-install-perl libsub-quote-perl libsys-hostname-long-perl libvariable-magic-perl libxstring-perl munin-common munin-doc munin-plugins-core munin-plugins-extra rrdtool Use 'apt autoremove' to remove them. The following packages will be REMOVED munin* 0 to upgrade, 0 to newly install, 1 to remove and 0 not to upgrade. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] y (Reading database ... 175171 files and directories currently installed.) Purging configuration files for munin (2.0.56-1ubuntu1) ... apache2_invoke postrm: Purging configuration munin.conf dpkg: warning: while removing munin, directory '/var/lib/munin' not empty so not removed dpkg: warning: while removing munin, directory '/var/cache/munin/www' not empty so not removed Processing triggers for systemd (245.4-4ubuntu3.3) ... root@linux-u20:~# apt-get --purge remove munin munin-node Reading package lists... Done Building dependency tree Reading state information... Done Package 'munin' is not installed, so not removed The following packages were automatically installed and are no longer required: jo jq libalgorithm-c3-perl libb-hooks-endofscope-perl libb-hooks-op-check-perl libclass-c3-perl libclass-c3-xs-perl libclass-data-inheritable-perl libclass-method-modifiers-perl libclass-xsaccessor-perl libdata-optlist-perl libdate-manip-perl libdbi1 libdevel-callchecker-perl libdevel-caller-perl libdevel-globaldestruction-perl libdevel-lexalias-perl libdevel-stacktrace-perl libdist-checkconflicts-perl libdynaloader-functions-perl libemail-date-format-perl libeval-closure-perl libexception-class-perl libexporter-tiny-perl libfile-copy-recursive-perl libio-multiplex-perl libipc-shareable-perl libjq1 liblist-moreutils-perl liblog-dispatch-perl liblog-log4perl-perl libmail-sendmail-perl libmime-lite-perl libmime-types-perl libmodule-implementation-perl libmodule-runtime-perl libmro-compat-perl libnamespace-autoclean-perl libnamespace-clean-perl libnet-cidr-perl libnet-server-perl libnet-snmp-perl libonig5 libpackage-stash-perl libpackage-stash-xs-perl libpadwalker-perl libparams-classify-perl libparams-util-perl libparams-validationcompiler-perl libreadonly-perl libref-util-perl libref-util-xs-perl librole-tiny-perl librrd8 librrds-perl libspecio-perl libsub-exporter-perl libsub-exporter-progressive-perl libsub-identify-perl libsub-install-perl libsub-quote-perl libsys-hostname-long-perl libvariable-magic-perl libxstring-perl munin-common munin-doc munin-plugins-core munin-plugins-extra rrdtool Use 'apt autoremove' to remove them. The following packages will be REMOVED munin-node* 0 to upgrade, 0 to newly install, 1 to remove and 0 not to upgrade. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] y (Reading database ... 175127 files and directories currently installed.) Purging configuration files for munin-node (2.0.56-1ubuntu1) ... Processing triggers for systemd (245.4-4ubuntu3.3) ...

Tuesday 1 December 2020

Installing Munin on Ubuntu 20

Useful Links: https://www.howtoforge.com/tutorial/server-monitoring-with-munin-and-monit-on-ubuntu-16-04-lts/
https://www.digitalocean.com/community/tutorials/how-to-install-the-munin-monitoring-tool-on-ubuntu-14-04
Following worked for me without any changes. 



As root or using sudo option, install Munin (of course, do an update 1st) # apt install munin munin-node # systemctl restart munin-node

Alias /munin /var/cache/munin/www
<Directory /var/cache/munin/www>
 # Require local
 Require all granted
 Options FollowSymLinks SymLinksIfOwnerMatch
 Options None
</Directory>

ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
<Location /munin-cgi/munin-cgi-graph>
 # Require local
 Require all granted
 Options FollowSymLinks SymLinksIfOwnerMatch
 <IfModule mod_fcgid.c>
 SetHandler fcgid-script
 </IfModule>
 <IfModule !mod_fcgid.c>
 SetHandler cgi-script
 </IfModule>
</Location> 


Appendix

root@linux-u20:~# apt install munin munin-node Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: munin-plugins-java The following NEW packages will be installed munin munin-node 0 to upgrade, 2 to newly install, 0 to remove and 0 not to upgrade. Need to get 71.8 kB/204 kB of archives. After this operation, 919 kB of additional disk space will be used. Get:1 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 munin-node all 2.0.56-1ubuntu1 [71.8 kB] Fetched 71.8 kB in 0s (843 kB/s) Preconfiguring packages ... Selecting previously unselected package munin. (Reading database ... 175120 files and directories currently installed.) Preparing to unpack .../munin_2.0.56-1ubuntu1_all.deb ... Unpacking munin (2.0.56-1ubuntu1) ... Selecting previously unselected package munin-node. Preparing to unpack .../munin-node_2.0.56-1ubuntu1_all.deb ... Unpacking munin-node (2.0.56-1ubuntu1) ... Setting up munin (2.0.56-1ubuntu1) ... apache2_invoke: Enable configuration munin.conf Setting up munin-node (2.0.56-1ubuntu1) ... Initializing plugins..done. Restarting munin-node..Created symlink /etc/systemd/system/multi-user.target.wants/munin-node.service → /lib/systemd/system/munin-node.service. Processing triggers for man-db (2.9.1-1) ... Processing triggers for systemd (245.4-4ubuntu3.3) ...

Apache config change

Faced two error during apache Restart

Invalid command 'RewriteEngine'

Invalid command 'ProxyPass'


To fix, had to enable the apache module, in Ubuntu, used this: sudo a2enmod rewrite sudo a2enmod proxy_http sudo systemctl restart apache2

Appendix errors faced

Dec 01 13:01:38 linux-u20 systemd[1]: Starting The Apache HTTP Server... Dec 01 13:01:38 linux-u20 apachectl[6829]: AH00526: Syntax error on line 3 of /etc/apache2/sites-enabled/mysite.conf: Dec 01 13:01:38 linux-u20 apachectl[6829]: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration Dec 01 13:01:38 linux-u20 apachectl[6809]: Action 'start' failed. Dec 01 13:01:38 linux-u20 apachectl[6809]: The Apache error log may have more information. Dec 01 13:01:38 linux-u20 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE Dec 01 13:01:38 linux-u20 systemd[1]: apache2.service: Failed with result 'exit-code'. Dec 01 13:01:38 linux-u20 systemd[1]: Failed to start The Apache HTTP Server. Dec 01 13:03:42 linux-u20 systemd[1]: Starting The Apache HTTP Server... Dec 01 13:03:42 linux-u20 apachectl[6921]: AH00526: Syntax error on line 6 of /etc/apache2/sites-enabled/mysite.conf: Dec 01 13:03:42 linux-u20 apachectl[6921]: Invalid command 'ProxyPass', perhaps misspelled or defined by a module not included in the server configuration Dec 01 13:03:42 linux-u20 apachectl[6906]: Action 'start' failed. Dec 01 13:03:42 linux-u20 apachectl[6906]: The Apache error log may have more information. Dec 01 13:03:42 linux-u20 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE Dec 01 13:03:42 linux-u20 systemd[1]: apache2.service: Failed with result 'exit-code'. Dec 01 13:03:42 linux-u20 systemd[1]: Failed to start The Apache HTTP Server.