标签: error-handling

是否可以记录/监控蓝牙错误?

我的蓝牙键盘在我从暂停状态唤醒计算机后停止工作,没有明显原因(暂停后无法使用蓝牙键盘写入)。

所以我相信一个错误正在悄悄地输出。

我想知道是否有办法监控蓝牙错误,可能在终端中?

bluetooth error-handling

5
推荐指数
1
解决办法
1万
查看次数

如何修复 Fat 32 文件系统分区“输入/输出错误”

分区 (Dev/sda2) 分区是如何被删除的。所以我用TestDisk把它带回来……我第一次这样做时它擦除了整个硬盘……第二次它确实恢复了分区,这很好。但是现在当我尝试在 Files(Gnome) 中打开它时,它给了我一个错误提示。

在此处输入图片说明

如果您需要这里的文本:获取文件'/media/ubuntu-gnome/Backup/User'的信息时出错:输入/输出错误

partitioning error-handling fat32

5
推荐指数
2
解决办法
1万
查看次数

Ubuntu清除Apache2错误日志

我是 Ubuntu 的新手。我可以在这里找到我的错误日志var/log/apache2/error.log。但我无法清除它。我试图更改编辑内容的权限。但是没能达到。

请帮我删除它。我已经阅读了之前提出的一些问题。但这对我没有帮助。

这个我读过https://askubuntu.com/questions/574725/how-to-clear-system-logs-in-ubuntu

这是我的终端屏幕截图:

在此处输入图片说明

permissions error-handling apache2

5
推荐指数
2
解决办法
3万
查看次数

Ubuntu 15.10 上的内部错误 /lib/upowerd。是什么导致了这个错误?

每次启动 Ubuntu 15.10 时,都会出现此错误:

Internal error:
ExecutablePath: /usr/lib/upower/upowerd
Package: upower 0.99.3-1build2
ProblemType: crash
Run Code Online (Sandbox Code Playgroud)

我在一些论坛上读到这可能是由连接 idevice(例如 iPhone)引起的。是什么原因造成的?有没有其他人有同样的问题?

一个可能的建议修复是安装库“libimobiledevice-utils”,但我还没有尝试过。

error-handling

5
推荐指数
1
解决办法
3077
查看次数

无法启动 gimp

我最近尝试使用“sudo apt-get install gimp”从官方来源安装 gimp,并使用“sudo apt-get -f install”修复所有依赖项。但是每当我尝试启动 gimp(通过终端中的“gimp”)时,它会立即关闭并显示以下错误消息:

(gimp:20357): GLib-GObject-WARNING **: g_object_set_valist: object class 'GeglConfig' has no property named 'cache-size'
(gimp:20357): GEGL-gegl-operation.c-WARNING **: Cannot change name of operation class 0x1701C80 from "gimp:point-layer-mode" to "gimp:dissolve-mode"
(gimp:20357): GEGL-gegl-operation.c-WARNING **: Cannot change name of operation class 0x1702150 from "gimp:point-layer-mode" to "gimp:behind-mode"
(gimp:20357): GEGL-gegl-operation.c-WARNING **: Cannot change name of operation class 0x1702910 from "gimp:point-layer-mode" to "gimp:multiply-mode"
(gimp:20357): GEGL-gegl-operation.c-WARNING **: Cannot change name of operation class 0x1702C60 from "gimp:point-layer-mode" to "gimp:screen-mode"
(gimp:20357): GEGL-gegl-operation.c-WARNING **: …
Run Code Online (Sandbox Code Playgroud)

command-line gimp error-handling 16.04

5
推荐指数
1
解决办法
256
查看次数

FreeCad 和 ODA 文件转换器在 Ubuntu 18.04 上停止工作

最近 ODA 文件转换器完全停止工作,FreeCad UI 表现得很奇怪。看着被压扁和摇下的窗户是空的。在此处输入图片说明有任何想法吗?有人注意到类似的事情吗?

error-handling

5
推荐指数
2
解决办法
1273
查看次数

如何在使用 || 时隐藏第一个命令的输出 运算符并退出?

这会隐藏第一个命令的输出,Oops如果失败则打印到 stderr。到目前为止,一切都很好。

#!/usr/bin/env bash
invalid_command > /dev/null 2>&1 || >&2 echo "Oops"
echo hi
Run Code Online (Sandbox Code Playgroud)

输出如下:

Oops
hi
Run Code Online (Sandbox Code Playgroud)

但如果第一个命令失败,我需要退出并打印一条消息。所以我尝试使用括号。

Oops
hi
Run Code Online (Sandbox Code Playgroud)

这是它的输出:

Oops
hi
Run Code Online (Sandbox Code Playgroud)

但现在exit不起作用,因为它是在子 shell 中执行的,导致它打印hi,即使我希望脚本退出。

那么,如果使用操作符执行特定命令失败,如何让 Bash 获取echo某些文本并退出||?我知道我可以使用单行语句来做到这一点,但如果可以避免的话,if我宁愿不必使用完整的语句。if

#!/usr/bin/env bash
invalid_command > /dev/null 2>&1 || ( >&2 echo "Oops" ; exit )
echo hi
Run Code Online (Sandbox Code Playgroud)

command-line bash scripts error-handling redirect

5
推荐指数
1
解决办法
1764
查看次数

如何修复损坏的 LibreOffice 软件包

我有“损坏的包”,但是当我尝试在 Synaptic 包管理器中修复它们时,我收到以下错误消息:

dpkg: unrecoverable fatal error, aborting:
 files list file for package `libreoffice-calc' contains empty filename
E: Sub-process /usr/bin/dpkg returned an error code (2)
A package failed to install.  Trying to recover:
dpkg: dependency problems prevent configuration of libreoffice-writer:
 libreoffice-writer depends on libreoffice-core (= 1:3.6.2~rc2-0ubuntu4); however:
  Version of libreoffice-core on system is 1:3.6.2~rc2-0ubuntu3.
 libreoffice-writer depends on libreoffice-base-core (= 1:3.6.2~rc2-0ubuntu4); however:
  Version of libreoffice-base-core on system is 1:3.6.2~rc2-0ubuntu3.

dpkg: error processing libreoffice-writer (--configure):
 dependency problems - leaving unconfigured
dpkg: error …
Run Code Online (Sandbox Code Playgroud)

package-management error-handling libreoffice

4
推荐指数
1
解决办法
3万
查看次数

如何将命令的输出重定向到函数但抑制错误并输出到控制台?

我需要将我正在运行的命令的输出重定向到带有时间戳的日志文件(因此是一个函数而不是日志文件本身),但错误和输出都不应该显示在控制台中。下列 -

command | my_func 2> /dev/null 
Run Code Online (Sandbox Code Playgroud)

不管用。

就像是

command 2> logfile
Run Code Online (Sandbox Code Playgroud)

有效,但我无法在第二种情况下记录时间戳。我该怎么办?

bash error-handling stdout timestamp

4
推荐指数
2
解决办法
3182
查看次数

无法在 Ubuntu 22.04 LTS 上启动 Atom

我有 Ubuntu 22.04 LTS 并按照这篇文章安装了 Atom 。从图标启动后,窗口会打开,但保持空白,然后在几秒钟内崩溃。在终端上我得到:

\n
$ atom\n/usr/bin/atom: line 195: 30027 Illegal instruction     (core dumped) nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1\n[30027:0429/141844.105294:FATAL:gpu_data_manager_impl_private.cc(439)] GPU process isn\'t usable. Goodbye.\n--2022-04-29 14:18:44--  https://atom.io/crash_reports\nResolving atom.io (atom.io)... 20.119.16.4\nConnecting to atom.io (atom.io)|20.119.16.4|:443... connected.\nHTTP request sent, awaiting response... 204 No Content\n2022-04-29 14:18:45 (0.00 B/s) - \xe2\x80\x98/dev/fd/4\xe2\x80\x99 saved [0]\n\n\nUnexpected crash report id length\nFailed to get crash dump id.\nReport Id: \n--2022-04-29 14:18:45--  https://atom.io/crash_reports\nResolving atom.io (atom.io)... 20.119.16.4\nConnecting to atom.io (atom.io)|20.119.16.4|:443... connected.\nHTTP request sent, awaiting response... 204 No …
Run Code Online (Sandbox Code Playgroud)

error-handling atom 22.04

4
推荐指数
1
解决办法
5700
查看次数