[linux 错误] “Sorry, command-not-found has crashed! Please file a bug report at”

一、问题
今天ssh登陆linux突然报错,如下

Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:

command-not-found version: 0.3
Python version: 3.4.3 final 0
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:        14.04
Codename:       trusty
Exception information:

'utf-8' codec can't encode character '\udcc0' in position 8: surrogates not allowed
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard
    callback()
  File "/usr/lib/command-not-found", line 90, in main
    if not cnf.advise(args[0], options.ignore_installed) and not options.no_failure_msg:
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 265, in advise
    packages = self.getPackages(command)
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 157, in getPackages
    result.update([(pkg, db.component) for pkg in db.lookup(command)])
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 85, in lookup
    result = self.db.lookup(command)
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 41, in lookup
    key = key.encode('utf-8')
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcc0' in position 8: surrogates not allowed

二,解决
原来是刚刚编辑了$HOME/.profile,然后这个文件被加密系统加密了,其他命令读这个文件是乱码的,所以报错。
申请解密或者复制个没有加密的.profile即可。

当你在开发一个应用程序时,有时候你可能会遇到一个错误信息:"app crashed - waiting for file changes before starting"。这个错误通常出现在你修改了应用程序的代码或者文件后重新启动应用程序时。 这个错误信息的意思是应用程序在启动过程中崩溃了,并且正在等待文件更改完成后重新启动。这通常是由于以下几个原因导致的: 1. 代码错误:你可能在应用程序的代码中引入了一个错误,导致应用程序崩溃。这可能是语法错误、逻辑错误或者其他类型的错误。 2. 依赖问题:你的应用程序可能依赖于其他库或者框架,而这些库或者框架可能存在问题,导致应用程序崩溃。 3. 文件损坏:你修改的文件可能已经损坏或者不完整,导致应用程序无法正确加载。 为了解决这个问题,你可以尝试以下几个步骤: 1. 检查代码:仔细检查你修改的代码,确保没有语法错误或者逻辑错误。你可以使用调试工具来帮助你找到问题所在。 2. 检查依赖:确保你的应用程序所依赖的库或者框架是最新版本,并且没有任何已知的问题。如果有必要,你可以尝试更新或者切换到其他版本的依赖库。 3. 恢复文件:如果你怀疑某个文件损坏导致应用程序崩溃,你可以尝试恢复该文件到之前的版本,或者重新下载该文件。 4. 清除缓存:有时候应用程序崩溃是由于缓存问题引起的。你可以尝试清除应用程序的缓存,并重新启动应用程序。 如果以上步骤都没有解决问题,你可以尝试在开发环境中重新创建一个新的项目,并逐步将代码和文件添加到新项目中,以确定问题所在。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值