rsyslog Unsafe symlinks encountered in /var/log, refusing

When updating packages on an Ubuntu server, I got the error “Unsafe symlinks encountered in /var/log, refusing.”.

This is due to wrong file ownership for /var/log folder.

I found the directory “/var” was owned by user www-data

To fix the error I changed ownership of /var directory to root user.

IMPORTANT: Do not use chown -R as the /var folder contains files owned by different users, if you change all file/folder ownership to root, it will mess up the system. For example /var/log/mysql need to be owned by user “mysql”, if you change it to the user “root”, MySQL will fail to start.

You may also need to check ownership of folder /var/log and files inside. You can compare it with another Ubuntu server to make sure directory/file ownerships are correct.

Back to apt

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *