10

I am currently running Ubuntu 14.04 LTS. Out of nowhere, my 3.6.2 GNOME terminal is returning "terminals database is inaccessible" when the "clear" command is executed. Any suggestions on how I can troubleshoot this problem?

Thanks for the help,

Eric

dlin
  • 3,900
  • Wild guess: what does dpkg -V ncurses-base ncurses-term return? – steeldriver Aug 05 '16 at 16:40
  • Thanks for the reply steeldriver. "dpkg -V ncurses-base ncurses-term" returns nothing. – Eric Smoll Aug 05 '16 at 16:42
  • did this help? http://superuser.com/questions/319912/i-cant-clear-the-terminal-in-mac-os-x-lion-terminals-database-is-inaccessibl – Anwar Aug 19 '16 at 10:32
  • Do you happen to use conda? I had the same issue and found the solution here. https://github.com/ContinuumIO/anaconda-issues/issues/994 – Dilmurat Aug 24 '16 at 08:45
  • Hello Dilmurat, I think you are correct. I do use conda and removing conda bin from my path resolves the "terminals database is inaccessible" error. I will pursue the solution in the link you provided. Thank you! – Eric Smoll Aug 24 '16 at 16:18

3 Answers3

10

This can happen a lot with terminal multiplexers (screen, tmux, etc...)

If if you are running one of those, make sure that your TERM is set to screen-256color for the broadest support. I've run into issues in BSD, Linux, Multiple x window managers, etc... from this.

Check for set -g default-terminal screen-256color in ~/.tmux.conf or term screen-256color in ~/.screenrc as TERM is changed by your multiplexer when you load it.

If echo $TERM already says screen-256color try this:

TERM='xterm' clear. If that works, then your terminal emulator doesn't support the standard multiplexer configuration. You might need to add something special for that particular terminal emulator in your bashrc/bash_profile.

Keep in mind that this problem is related to your tool selection and configuration. Ubuntu attempts to choose defaults that work well with other defaults so that everything 'just works'.

SkyLeach
  • 211
  • 3
    I was able to solve the problem by just commenting out this line in my tmux conf (which was the example conf shipped with tmux): #set -g default-terminal "tmux-256color" – compguy24 Jan 10 '19 at 15:36
  • 1
    After you update your .tmux.conf, you can use tmux kill-server to force a reload of the configuration. – Christian Long Jun 02 '22 at 15:37
0

Open the hidden ~/.bashrc bash customization file, see if the clear command is being overridden with something else, then comment it with an hash at the start of the line, close the terminal and restart, or type in . ~/.bashrc to refresh the bashrc script immediately.

Also both the commands env and set will give you information about the environment variables of your OS, you can start troubleshooting there.

  • just run alias to see a list of aliases – Amias Aug 19 '16 at 10:33
  • Hello Amias. I was unaware of this usage of the alias command. Thank you for the suggestion. – Eric Smoll Aug 24 '16 at 16:25
  • Hello uncanny_valley. There was no alias interfering with my usage of the clear command. Thank you for the troubleshooting suggestion. As it turns out, user Dilmurat was correct in assuming that my conda installation has an ncurses issue that was interfering with my usage of the clear command. – Eric Smoll Aug 24 '16 at 16:30
  • @EricSmoll No problem, glad you managed to solve the problem. – uncanny_valley Aug 24 '16 at 18:28
0

Either your $TERM variable is not right or your TERMCAP db is corrupted.

This message occurs when your terminal type cannot be matched in the TERMCAP database.

the termcap database on ubuntu 16.04 is in /lib/terminfo , not sure if its the same on 14.04 , there must be an file in that tree of the same name as the value in your $TERM.

the ncurses-base package manages this , check if its installed.

Anwar
  • 77,924
Amias
  • 5,369