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

如果您需要这里的文本:获取文件'/media/ubuntu-gnome/Backup/User'的信息时出错:输入/输出错误
我是 Ubuntu 的新手。我可以在这里找到我的错误日志var/log/apache2/error.log。但我无法清除它。我试图更改编辑内容的权限。但是没能达到。
请帮我删除它。我已经阅读了之前提出的一些问题。但这对我没有帮助。
这个我读过https://askubuntu.com/questions/574725/how-to-clear-system-logs-in-ubuntu。
这是我的终端屏幕截图:
每次启动 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”,但我还没有尝试过。
我最近尝试使用“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) 这会隐藏第一个命令的输出,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) 我有“损坏的包”,但是当我尝试在 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) 我需要将我正在运行的命令的输出重定向到带有时间戳的日志文件(因此是一个函数而不是日志文件本身),但错误和输出都不应该显示在控制台中。下列 -
command | my_func 2> /dev/null
Run Code Online (Sandbox Code Playgroud)
不管用。
就像是
command 2> logfile
Run Code Online (Sandbox Code Playgroud)
有效,但我无法在第二种情况下记录时间戳。我该怎么办?
我有 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 ×10
bash ×2
command-line ×2
16.04 ×1
22.04 ×1
apache2 ×1
atom ×1
bluetooth ×1
fat32 ×1
gimp ×1
libreoffice ×1
partitioning ×1
permissions ×1
redirect ×1
scripts ×1
stdout ×1
timestamp ×1