Terminal does not work

Hello! I run Ubuntu Mate 20.10 and now am having a problem with the terminal, which stopped working. When launched, the command prompt symbol ("$") does not appear. The line stops at the tilde ("~").
What can I do to restore the terminal? Should it be reinstalled? What wouldo be the best/safest way to do this?

Hi @lostados :slight_smile:

What is happening if you input bash inside this broken terminal ?

Can you share your .bashrc and .profile files (hidden file inside your home directory - In Caja : View / Show hidden files to see them)

Thanks for your attention. Just to make sure, should I copy both files and paste them here or is there another way of sharing them?

If the files do not contain some secret configuration you can paste it as answer directly on the forum :slight_smile:

OK. No problem. They just seemed very large to me. But here they are:

~/.bashrc: executed by bash(1) for non-login shells.
see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
for examples

If not running interactively, don't do anything
case $- in
i) ;;
*) return;;

don't put duplicate lines or lines starting with space in the history.
See bash(1) for more options

append to the history file, don't overwrite it
shopt -s histappend

for setting history length see HISTSIZE and HISTFILESIZE in bash(1)

check the window size after each command and, if necessary,
update the values of LINES and COLUMNS.
shopt -s checkwinsize

If set, the pattern "**" used in a pathname expansion context will
match all files and zero or more directories and subdirectories.shopt -s globstar

make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)

set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;

uncomment for a colored prompt, if the terminal has the capability; turned
off by default to not distract the user: the focus in a terminal window
should be on the output of commands, not on the prompt

if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)

if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}[\033[01;32m]\u@\h[\033[00m]:[\033[01;34m]\w[\033[00m]$ '
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$ '
unset color_prompt force_color_prompt

If this is an xterm set the title to user@host:dir
case "$TERM" in
PS1="[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a]$PS1"

enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'


colored GCC warnings and errors
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

Add an "alert" alias for long running commands. Use like so:
sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '''s/^\s*[0-9]+\s*//;s/[;&|]\s*alert$//''')"'

Alias definitions.
You may want to put all your additions into a separate file like
~/.bash_aliases, instead of adding them here directly.
See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases

enable programmable completion features (you don't need to enable
this, if it's already enabled in /etc/bash.bashrc and /etc/profile
sources /etc/bash.bashrc).
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion

~/.profile: executed by the command interpreter for login shells.
This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
see /usr/share/doc/bash/examples/startup-files for examples.
the files are located in the bash-doc package.

the default umask is set in /etc/profile; for setting the umask
for ssh logins, install and configure the libpam-umask package.
mask 022

if running bash
if [ -n "$BASH_VERSION" ]; then
include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"

set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then

set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then

It looks ok for me, I have similar. What is happening if you type bash inside this terminal ?

Do you use mate-terminal ? Can you please check this settings ?

Like this?

Screenshot at 2021-05-23 16-11-45

Looks OK too :slight_smile:

It is with mate-terminal that you have the issue ? what about the bash command, is it helping somehow ?

I cannot type anything in the terminal.

It will be a difficult case as we cannot deal with bash :confused:

Can you try those things :

  1. Switch to a text mode tty with Ctrl+Alt+F1, connect with your user and credentials and see if you can type some commands

  2. Make a new profile inside mate-terminal with this custom command and try to type some commands :

  3. You can also insure that /bin/bash is your default shell, with some command line available :

    sudo grep /etc/passwd

but as you cannot do that, you can get a look here :

Screenshot at 2021-05-23 16-57-51

Not much help, I am afraid. Perhaps the easiest solution in a clean install of Ubuntu Mate.

A clean install is all the time solving issues xD

Otherwise, the problem is interesting to get solved xD

I understand you 100%. But you will agree that one has to have a working terminal or else...

1 Like

One question: is it possible to reinstall the terminal? There is a query in AskUbuntu but it is very old and may have been superseded.

Just a thought ... since the GUI works, can you create a new user, cm2, log on using that user and see the terminal prompt?

Have you tried to use xterm or uxterm? If you go to the main menu under system you should be able to enable them and see if you can use them for your terminal. If you have Synpatic or software center/boutique you could also try installing Tilda or LXterminal and see if they work. Then you would be able to trouble shoot and hopefully fix the Mate terminal. You could also boot recovery mode and use fix broken packages or the command line to re-install the Mate Terminal. It might save you from a fresh install.

Thank you very much. It did not work, however. I have decided to go for a clean install. I also have a minor bug with Caja - not serious but annoying - and that has to be addressed too.
I think now it is pretty safe to run UMate 21.04.
Thanks again

Thank you, jymm, but I think I am going to a fresh install. I had thought I would wait for a LTS but now I think it will be worthwhile to try and use the Hirsute Hippo. As I told pavlos_kairis, I also have a small glitch with Caja, nothing serious, just annoying, which I am sure the Hippo will correct.

Good luck, remember to do a good backup. Not just data, but bookmarks, address books, and browser addons. It seems I always forget something!

1 Like