What does "dpkg: warning: while removing directory /usr/local not empty so not removed" mean?

The message is common when the folder is not empty, as the message suggests. This is because other packages also put their files in this folder. A package can not easily remove a folder that is not empty, that would leave an unstable or broken system.

It is also possible that you yourself have stored files in this folder. And it would certainly be annoying if those files were suddenly disappeared along with the folder.

Furthermore, especially this folder is one of the default folders part of the Filesystem Hierarchy Standard. To remove this folder is therefore generally not a good idea.

Historically and strictly according to the standard, /usr/local/ is for data that must be stored on the local host (as opposed to /usr/, which may be mounted across a network). Most of the time /usr/local/ is used for installing software/data that are not part of the standard operating system distribution (in such case, /usr/ would only contain software/data that are part of the standard operating system distribution). It is possible that the FHS standard may in the future be changed to reflect this de facto convention).


There is nothing to worry about. dpkg does not remove directories where are some other files, not created by the removed package.