I am using Ubuntu 16.04 while using clear in terminal, it produces error terminals database is inaccessible But when I use sudo clear it works as intended. I have removed some files in /var/www/ and this problem started. I checked this question "clear" command in GNOME terminal returns "terminals database is inaccessible" but that did not help in any way

Edit: Output of strace -etrace=open clear

open("/home/user/anaconda3/bin/../lib/tls/x86_64/libncursesw.so.5", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

open("/home/user/anaconda3/bin/../lib/tls/libncursesw.so.5", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

open("/home/user/anaconda3/bin/../lib/x86_64/libncursesw.so.5", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

open("/home/user/anaconda3/bin/../lib/libncursesw.so.5", O_RDONLY|O_CLOEXEC) = 3

open("/home/user/anaconda3/bin/../lib/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3

terminals database is inaccessible

+++ exited with 1 +++

  • 2
    Please edit your question to include the output of strace -etrace=open clear (without sudo) Dec 22 '17 at 17:18
  • @steeldriver I have updated the question with the output
    – Harwee
    Dec 22 '17 at 17:25
  • Hmm... have you messed with how the linker resolves dynamic dependencies (such as setting LD_RUN_PATH or LD_LIBRARY_PATH or similar)? what is the output of printenv | grep LIB? Dec 22 '17 at 17:30
  • @steeldriver anaconda3 is interfering with the clear command.
    – Harwee
    Dec 22 '17 at 17:46

Path for Anaconda3 is set in .bashrc. It is interfering with clear command. Removing Anaconda path from path solved the issue. Here is the github reference for the issue https://github.com/ContinuumIO/anaconda-issues/issues/331


You might have moved the anaconda directory after installation and some bash script links in some files from anaconda directory are still pointing to the previous location. Simplest solution is to delete your current anaconda installation directory, remove any paths in .bashrc pointing to it and reinstall it in the desired location.

  • How does this differ from the other answer? Jun 13 '18 at 3:14

This is an issue you'll face after moving the Anaconda Python directory to a different location. In your $PATH variable, you will your Python home's bin directory ($PYTHON_HOME/bin). Just go this bin directory, rename the existing "clear" binary file and login again.

mv clear clear.bkup

In case you see "(your_env_name)" to the left, typingconda deactivate will solve your problem

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.