常见错误以及操作【未整理集合持续更新ing】"/>
Linux常见错误以及操作【未整理集合持续更新ing】
文章目录
- 1.gtkdocize: not found
- 2.parallel-tests: installing 'build-aux/test-driver'
- 3.configure.ac:34: error: possibly undefined macro: AC_PROG_LIBTOOL
- 4. No package 'polkit-gobject-1' found
- 5.configure: error: Package requirements (polkit-agent-1 >= 0.102) were not met:
- 6.configure: error: Package requirements (gudev-1.0 >= 165) were not met:
- 7.configure: error: Package requirements (blockdev >= 2.25) were not met:
- 8.configure: error: BlockDev part support requested but header or library not found
- 10.checking libblockdev-loop presence... no
- 11.checking libblockdev-swap presence... no
- 12.checking libblockdev-mdraid presence... no
- 13.configure: error: Package requirements (libatasmart >= 0.17) were not met:
- 14.E514: write error (file system full?)
- 15.corrupted size vs. prev_size 内存溢出
- 16.'packed' attribute ignored [-Werror=attributes] 错误处理
- 17.Printf设置出力字符串固定长度,不足空格补齐
- 18.warning: override: reassigning to symbol 问题解决
- 19.insserv: warning: script 'xxx' missing LSB tags and overrides
- 20.modprobe 使用相关问题,not found,文件不存在等
- 21.qt.qpa.screen: QXcbConnection: Could not connect to display
- 22.开机启动信息显示 Failed to insert module 'autofs4'
- 23.systemd[1] failed to mount tmpfs at /sys/fs/cgroup no such file or directory
- 24.python 安装软件错误:raise ReadTimeoutError(self._pool, None, 'Read timed out.')
- 25.buildroot ERROR: No hash found for xxx
- 26.sudo 出现unable to resolve host:Name or service not known 解决方法
- 27.Ubuntu20.04 解决32bits libcrypt.so.1: cannot open shared object file: No such file or directory 问题
- 28.Fix apt-get update “the following signatures couldn’t be verified because the public key is not available”
- 29.解决apt-get安装中的E: Sub-process /usr/bin/dpkg returned an error code (1)问题
- 30.使用apt升级单个软件包
- 31. A start job is running for wait for network to be Configured 阻塞
- 32.sudo: command not found 的解决方法
- 33.Linux/Debian/Ubuntu chromium,Firefox浏览器中文界面乱码
- 34.sudo或者sudo+命令卡住很久(Ubuntu)
- 351: error: unrecognized command line option "-mlittle-endian" (编译内核出错)
- 36.buildroot文件系统定制busybox -z参数不支持
- 37.’sudo echo x >’ 时’Permission denied’问题解决
- 38.error: pathspec ' xxx' did not match any file(s) known to git
1.gtkdocize: not found
sudo apt-get install gtk-doc-tools
2.parallel-tests: installing ‘build-aux/test-driver’
udisks/Makefile.am:149: error: HAVE_INTROSPECTION does not appear in AM_CONDITIONAL
autoreconf: automake failed with exit status: 1
sudo apt-get install gobject-introspection
3.configure.ac:34: error: possibly undefined macro: AC_PROG_LIBTOOL
sudo apt-get install libtool
configure: error: Package requirements (polkit-gobject-1 >= 0.102) were not met:
4. No package ‘polkit-gobject-1’ found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables POLKIT_GOBJECT_1_CFLAGS
and POLKIT_GOBJECT_1_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
sudo apt-get install libpolkit-gobject-1-dev
5.configure: error: Package requirements (polkit-agent-1 >= 0.102) were not met:
No package ‘polkit-agent-1’ found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables POLKIT_AGENT_1_CFLAGS
and POLKIT_AGENT_1_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
sudo apt-get install libpolkit-agent-1-dev
6.configure: error: Package requirements (gudev-1.0 >= 165) were not met:
No package ‘gudev-1.0’ found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables GUDEV_CFLAGS
and GUDEV_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
sudo apt-get install libgudev-1.0-dev
7.configure: error: Package requirements (blockdev >= 2.25) were not met:
No package ‘blockdev’ found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables BLOCKDEV_CFLAGS
and BLOCKDEV_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
sudo apt-get install libblockdev-dev
8.configure: error: BlockDev part support requested but header or library not found
sudo apt-get install libblockdev-part-dev libblockdev-part2
10.checking libblockdev-loop presence… no
libblockdev-loop-dev sudo abut header or library not found
sudo apt-get install libblockdev-loop-dev libblockdev-loop2
11.checking libblockdev-swap presence… no
configure: error: SWAP support requested but header or library not found
sudo apt-get install libblockdev-swap-dev libblockdev-swap2
12.checking libblockdev-mdraid presence… no
configure: error: BLOCKDEV MDRAID support requested but header or library not found
sudo apt-get install libblockdev-mdraid-dev libblockdev-mdraid2
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version}
BuildRequires: libgudev1-devel >= %{systemd_version}
BuildRequires: libatasmart-devel >= %{libatasmart_version}
BuildRequires: polkit-devel >= %{polkit_version}
BuildRequires: systemd >= %{systemd_version}
BuildRequires: systemd-devel >= %{systemd_version}
BuildRequires: libacl-devel
BuildRequires: chrpath
BuildRequires: gtk-doc
BuildRequires: gettext-devel
BuildRequires: redhat-rpm-config
BuildRequires: libblockdev-devel >= %{libblockdev_version}
BuildRequires: libblockdev-part-devel >= %{libblockdev_version}
BuildRequires: libblockdev-loop-devel >= %{libblockdev_version}
BuildRequires: libblockdev-swap-devel >= %{libblockdev_version}
BuildRequires: libblockdev-mdraid-devel >= %{libblockdev_version}
BuildRequires: libblockdev-fs-devel >= %{libblockdev_version}
BuildRequires: libblockdev-crypto-devel >= %{libblockdev_version}
BuildRequires: libmount-devel
BuildRequires: libuuid-devel
sudo apt-get install glib2-dev gobject-introspection-dev libgudev1-dev libatasmart-dev polkit-dev systemd-dev libacl-dev gettext-dev libblockdev-dev libblockdev-part-dev libblockdev-loop-dev libblockdev-swap-dev libblockdev-mdraid-dev libblockdev-fs-dev libblockdev-crypto-dev libmount-dev libuuid-devapt-get install libatasmart-dev libblockdev-dev libblockdev-part-dev libblockdev-loop-dev libblockdev-swap-dev libblockdev-mdraid-dev libblockdev-fs-dev libblockdev-crypto-dev libmount-dev
13.configure: error: Package requirements (libatasmart >= 0.17) were not met:
No package ‘libatasmart’ found
apt-get list libatasmart-dev
14.E514: write error (file system full?)
vim编辑某文件,保存的时候报错
“basebackup.sh” E514: write error (file system full?)
解决方案:磁盘是否写满
15.corrupted size vs. prev_size 内存溢出
核对memcpy() , memset() 等函数是否异常,越界等
16.‘packed’ attribute ignored [-Werror=attributes] 错误处理
把__attribute__((packed))放结构体名前面,如下
由
typedef struct {int32_t mmap_addr;char tag[4]; /* 'P', 'R', 'E', ' ' */
}prelink_info_t __attribute__((packed)) ;
改至
typedef struct {int32_t mmap_addr;char tag[4]; /* 'P', 'R', 'E', ' ' */
} __attribute__((packed)) prelink_info_t ;
‘packed’ attribute ignored [-Werror=attributes] 错误处理
17.Printf设置出力字符串固定长度,不足空格补齐
printf("%50s",str); //右对齐,左补空格,50是长度
printf("%-50s",str); //左对齐,右补空格,50是长度
printf("%02d",cnt); //右对齐,左补0,2是长度
18.warning: override: reassigning to symbol 问题解决
找到对应的配置项,检查是否有冲突配置或重复配置的,有则处理
19.insserv: warning: script ‘xxx’ missing LSB tags and overrides
根据错误可以看出是LSB规范的问题,一般在shell脚本中,可以在对应的shell脚本中添加如下:
#!/bin/bash
### BEGIN INIT INFO
# Provides: lostphp
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: wsocket service
# Description: wsocket service daemon
### END INIT INFO
或者,直接卸载相关软件:
apt-get remove insserv
20.modprobe 使用相关问题,not found,文件不存在等
1.将编译好的模块放入/lib/module/uname -r
下,
2. 用depmod更新modules.dep文件
3. modprobe helloworld.ko
21.qt.qpa.screen: QXcbConnection: Could not connect to display
该错误一般出现于用户没有登录进桌面却想在终端使用桌面的情况。
export DISPLAY=':0.0'
22.开机启动信息显示 Failed to insert module ‘autofs4’
把File Systems --> 里的 Kernel automounter version 4 support (also supports v3) 选上
23.systemd[1] failed to mount tmpfs at /sys/fs/cgroup no such file or directory
24.python 安装软件错误:raise ReadTimeoutError(self._pool, None, ‘Read timed out.’)
指定源:–index-url
添加超时:–default-timeout=100
以上二选一,推荐第一种。
25.buildroot ERROR: No hash found for xxx
可以在package_name.mk 中加入 BR_NO_CHECK_HASH_FOR += $(XXX_SOURCE)跳过检查来解决
或者
手动在对应的package的hash文件中添加对应的hash值 (sha256sum -c SHA265 文件)
26.sudo 出现unable to resolve host:Name or service not known 解决方法
/etc/hosts 配置异常,一般出现于新增的用户
解决方案:vi /etc/hosts
, 若sudo 的 用户为 user ,则sudo user 配置如下:
27.Ubuntu20.04 解决32bits libcrypt.so.1: cannot open shared object file: No such file or directory 问题
apt install libcrypt1
28.Fix apt-get update “the following signatures couldn’t be verified because the public key is not available”
sudo apt-key adv --keyserver keyserver.ubuntu --recv-keys xxxx
29.解决apt-get安装中的E: Sub-process /usr/bin/dpkg returned an error code (1)问题
cd /var/lib/dpkg/
sudo mv info/ info_bak # 现将info文件夹更名
sudo mkdir info # 再新建一个新的info文件夹
sudo apt-get update # 更新
sudo apt-get -f install # 修复
sudo mv info/* info_bak/ # 执行完上一步操作后会在新的info文件夹下生成一些文件,现将这些文件全部移到info_bak文件夹下
sudo rm -rf info # 把自己新建的info文件夹删掉
sudo mv info_bak info # 把以前的info文件夹重新改回名
30.使用apt升级单个软件包
apt install --only-upgrade <packagename>
31. A start job is running for wait for network to be Configured 阻塞
systemd-networkd-wait-online.service 中文手册
systemctl mask systemd-networkd-wait-online.service
32.sudo: command not found 的解决方法
#vi /etc/sudoers
visudo
找到"secure_path"一行,当你执行 sudo 命令时,"secure_path"中包含的路径将被当做默认 PATH 变量使用。按 “i” 键就可以进入插入模式(Insert mode),添加所需要的路径(如 /usr/local/bin)到"secure_path"下,Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
33.Linux/Debian/Ubuntu chromium,Firefox浏览器中文界面乱码
apt install fonts-wqy-zenhei #ubuntu
apt install ttf-wqy-zenhei #debian
vi /etc/fonts/conf.d/49-sansserif.conf
#添加如下
WenQuanYi Zen Hei
34.sudo或者sudo+命令卡住很久(Ubuntu)
添加主机名映射。
vi /etc/hosts
#127.0.1.1 <主机名>
127.0.1.1 user
351: error: unrecognized command line option “-mlittle-endian” (编译内核出错)
编译器不对,指定对应的编译器即可。
export CROSS_COMPILE="aarch64-linux-gnu-"
36.buildroot文件系统定制busybox -z参数不支持
busybox配置文件添加CONFIG_FEATURE_SEAMLESS_GZ
配置使能
vi buildroot/package/busybox/busybox.config
CONFIG_FEATURE_SEAMLESS_GZ=y
37.’sudo echo x >’ 时’Permission denied’问题解决
单独执行sudo echo a > 1.txt提示Permission denied
解决:
sudo sh -c "echo a > 1.txt"
参考:避免’sudo echo x >’ 时’Permission denied’
38.error: pathspec ’ xxx’ did not match any file(s) known to git
问题产生:命令输入输错,检查 git commit后面的-m是否加上
解决:
git commit -m "aaa"
更多推荐
Linux常见错误以及操作【未整理集合持续更新ing】
发布评论