不知道怎么回事,Ubuntu终端打开直接报错,字体全是白色,虚拟环境也进不去。

不想重装Anaconda的话,参照下边示例。

打开终端,输入

gedit ~/.bashrc

仔细检查有没有不对劲的命令,我的环境变量里面是多了一段报错命令

找到后删除或者注释即可

以下是我的环境变量,可以对照一下

# ~/.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;;
esac# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth# append to the history file, don't overwrite it
shopt -s histappend# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000# 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 ]; thendebian_chroot=$(cat /etc/debian_chroot)
fi# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" inxterm-color|*-256color) color_prompt=yes;;
esac# 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
#force_color_prompt=yes##########这里开始if [ -n "$force_color_prompt" ]; thenif [ -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.)color_prompt=yeselsecolor_prompt=fi
fiif [ "$color_prompt" = yes ]; then
#    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\Ubuntu18.04环境变量h\[\033[00m\]:\[\033[01;34m\]\w\#[\033[00m\]\$ '
#else
#    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '#######上边一段被我注释掉的是错误代码!!!!!PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
elsePS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
########到这里结束,这些是决定Ubuntu终端颜色的!!!
########至少到这里我们应该都是一样的,我的是Ubuntu18.04!!!unset color_prompt force_color_prompt# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1";;
*);;
esac# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; thentest -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'
fi# 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
fi# 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; thenif [ -f /usr/share/bash-completion/bash_completion ]; then. /usr/share/bash-completion/bash_completionelif [ -f /etc/bash_completion ]; then. /etc/bash_completionfi
fi#export CUDA_HOME=/usr/local/cuda
#export PATH=$PATH:$CUDA_HOME/bin
#export LD_LIBRARY_PATH=/usr/local/cuda-11.3/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
#export PATH=$PATH:/usr/local/cuda/bin
#export CUDA_HOME=$CUDA_HOME:/usr/local/cudaexport PATH="/usr/local/cuda/bin:$PATH"export LD_LIBRARY_PATH="/usr/lcoal/cuda/lib64:$LD_LIBRARY_PATH"export CUDA_HOME="/usr/local/cuda"#export LD_LIBRARY_PATH=/your/path/to/cuda/lib64:$LD_LIBRARY_PATH# added by Anaconda3 installer
export PATH="/home/dell/anaconda3/bin:$PATH"export TF_CPP_MIN_LOG_LEVEL=2

上边都差不多的话,关闭这个文本文档

然后

终端输入

source ~/.bashrc

完美解决,报错消失,字体也恢复正常!

没解决的可以评论区或私信

Ubuntu终端颜色全白+报错 bash: /home/dell/.bashrc: 行 144: 语法错误: 未预期的文件结尾解决办法相关推荐

  1. linux 执行脚本报错:nginx_check.sh:行10: 语法错误: 未预期的文件结尾

    出现的问题可能是格式有问题: 脚本是windows下写的,然后传到linux下运行的,文件格式需要给dos文件格式转成unix dos转unix 安装: yum install dos2unix 命令 ...

  2. linux 运行脚本时报错:语法错误: 未预期的文件结尾

    在跑shell代码时遇到如下错误提示: 行 175: 语法错误: 未预期的文件结尾. 引用一位网友的话"shell不会对错误进行精确定位,而是在试图结束一个语句时进行错误统计.所以在shel ...

  3. linux语法错误 未预期的文件结尾,centos shell运行报语法错误: 未预期的文件结尾...

    shell脚本启动语法错误syntax error near unexpected token '{ 执行shell脚本时失败,报语法错误,但脚本内容检查正常 原因为该脚本是在非Lin ...

  4. 报错'参数**没有默认值',或 语法错误(操作符丢失)的解决方法

    问题:当写的SQL语句执行时总是报错参数没有默认值,或语法错误(操作符丢失)时,导致程序报错无法继续执行..... 原因:通常是语句里面的变量的引号的问题,引号没有加或者加的不对让delphi误认为是 ...

  5. 出现VW自适应方案报错already has a ‘content‘ property, give up to overwrite it的原因及解决办法

    出现VW自适应方案报错already has a 'content' property, give up to overwrite it的原因及解决办法 背景及原因 解决办法 文章参考 背景及原因 在 ...

  6. 闪退没由报错_使命召唤:(cod16)出现的闪退问题以及解决办法

    <使命召唤16>无提示闪退桌面解决方法无提示闪退桌面怎么办(有其他问题可以评论留言哦,能解决的小鸿必定竭尽全力) 1.打开游戏看到主菜单后,不要进行游戏,直接按选项,在图形选单里,选择重新 ...

  7. slf4j报错:SLF4J:Failed to load class org.slf4j.impl.StaticLoggerBinder.Defaulting to no-operat有效解决办法

    运行maven程序时报如下错误: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: D ...

  8. push时git报错 error: failed to push some refs to 'git@gitee.com:git_zn/jianli.git' 解决办法...

    完整的错误提示如下 To gitee.com:git_zn/jl.git! [rejected] master -> master (fetch first) error: failed to ...

  9. 报错(SQLite 3.8.3 or later is required (found 3.7.17).)的解决办法

    在服务器上刚部署完Django项目,python manage.py runserver 0.0.0.0:8000启动启动的时候报错:django.core.exceptions.Improperly ...

最新文章

  1. SystemCenter2012SP1实践(31)P2V迁移故障一则
  2. 职业生涯发展技巧20则
  3. BLE简介和Android BLE编程
  4. spyder中绘图无法显示负号_[转载]Matlab常用函数
  5. python跳过错误_Pandas之read_csv()读取文件跳过报错行的解决
  6. 什么是CAS及其相关的配置
  7. url存在宽字节跨站漏洞_【XSS漏洞】XSS漏洞相关总结v1.0
  8. python如何叉乘_向量点乘与向量叉乘
  9. 计算机程序设计vb怎么保存,VB编程:读取文本文件和保存文本文件的方法
  10. mdx词典包_译者的电子工具——手机词典上篇
  11. MRI图像处理:VBM原理和步骤
  12. [转载]系统提示:“您可能是微软盗版的受害者”的解决方法
  13. 记录自己的UCF—Crime代码debug
  14. 模电_安规X电容_Y电容-区别与作用-20190507
  15. 搜狗输入法原先能在word中输入中文,现在不行。
  16. android ibeacon sdk,如何通过Android上的SDK更改iBeacon参数(UUID,Major,Minor,TxPower)的值...
  17. win10系统点击开始菜单没反应
  18. 关于DialogBox的使用
  19. “醒醒吧,世界上有技术驱动型公司!”
  20. Acrobat_8_Pro_SC 激活老是提示你输入的授权码无效

热门文章

  1. EPICS工具CSS学习笔记
  2. 计算机找不到网络设备,解决在设备管理器中找不到网卡的问题
  3. 面试官:生产环境碰到系统CPU飙高和频繁GC,你要怎么排查?
  4. 【华人学者风采】李烨 华为
  5. 基于参数化模型(MANO)的手势姿态估计---全面剖析
  6. flex:0 flex:1 flex:auto flex:none之间的区别
  7. 信息系统开发与管理【二】之 管理信息系统的基本知识
  8. 一眼“看穿破绽”,3D视觉成锂电池“智造”降本增效利器
  9. 【selenium学习笔记】selenium自动化测试环境安装
  10. 基督山伯爵---大仲马