解决openwrt使用fdisk 和cfdisk命令报错

和黑猫之家聊聊?

解决openwrt使用fdisk 和cfdisk命令报错

原帖在此 https://www.right.com.cn/forum/thread-4011997-1-1.html

解决openwrt使用fdisk 和cfdisk命令报错 linux学习 第1张


想扩大系统分区,但是使用fdisk和cfdisk后出现以下提示:
root@OpenWrt:~# fdisk
Error relocating /usr/lib/libfdisk.so.1: secure_getenv: symbol not found
Error relocating /usr/lib/libblkid.so.1: secure_getenv: symbol not found
Error relocating /usr/lib/libsmartcols.so.1: secure_getenv: symbol not found
root@OpenWrt:~# cfdisk
Error relocating /usr/lib/libsmartcols.so.1: secure_getenv: symbol not found
Error relocating /usr/lib/libfdisk.so.1: secure_getenv: symbol not found
Error relocating /usr/lib/libmount.so.1: secure_getenv: symbol not found
Error relocating /usr/lib/libblkid.so.1: secure_getenv: symbol not found
请问各位大神,要怎么解决呢。




接下来是解决问题的方法

更换清华大学的x86_64的软件源


src/gz openwrt_core https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/19.07.5/targets/x86/64/packages
src/gz openwrt_kmods https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/19.07.5/targets/x86/64/kmods/4.14.209-1-68143adfcb7fc62a239c4be112fe40de
src/gz openwrt_base https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/19.07.5/packages/x86_64/base
src/gz openwrt_luci https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/19.07.5/packages/x86_64/luci
src/gz openwrt_packages https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/19.07.5/packages/x86_64/packages
src/gz openwrt_routing https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/19.07.5/packages/x86_64/routing
src/gz openwrt_telephony https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/19.07.5/packages/x86_64/telephony


更换软件源后直接安装fdisk是无效的:

opkg install fdisk
BusyBox v1.31.1 () built-in shell (ash)
  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r2999-81a53ea Mask Ver.D201231
 -----------------------------------------------------
root@OpenWrt:/# opkg install fdisk
Package fdisk (2.36.1-1) installed in root is up to date.


尝试移除软件包fdisk报错:

opkg remove fdisk
root@OpenWrt:/# opkg remove fdisk
No packages removed.
Collected errors:
 * print_dependents_warning: Package fdisk is depended upon by packages:
 * print_dependents_warning:    luci-app-docker
 * print_dependents_warning: These might cease to work if package fdisk is removed.
 * print_dependents_warning: Force removal of this package with --force-depends.
 * print_dependents_warning: Force removal of this package and its dependents
 * print_dependents_warning: with --force-removal-of-dependent-packages.

我们强制移除软件包fdisk:

opkg remove fdisk --force-depends
root@OpenWrt:/# opkg remove fdisk --force-depends
Removing package fdisk from root...

移除fdisk成功


继续安装fdisk:

opkg install fdisk
root@OpenWrt:/# opkg install fdisk
Installing fdisk (2.34-1) to root...
Downloading https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/19.07.5/packages/x86_64/base/fdisk_2.34-1_x86_64.ipk
Configuring fdisk.

安装新版本fdisk成功.

测试一下fdisk效果:

root@OpenWrt:/# fdisk
fdisk: bad usage
Try 'fdisk --help' for more information.
root@OpenWrt:/# fdisk -l
Disk /dev/loop0: 810.58 MiB, 849936384 bytes, 1660032 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sda: 7.38 GiB, 7918460928 bytes, 15465744 sectors
Disk model: Centerm SSD     
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x74d7103b
Device     Boot   Start      End  Sectors  Size Id Type
/dev/sda1  *        512    33279    32768   16M 83 Linux
/dev/sda2         33792  2098175  2064384 1008M 83 Linux
/dev/sda3       2099200 15465743 13366544  6.4G 83 Linux
root@OpenWrt:/#

可见软件包fdisk已经可正常使用了!!!


找了我三天.然后把fdisk的ipk解包后,觉得可能是fdisk软件包版本的问题.

解决openwrt使用fdisk 和cfdisk命令报错 linux学习 第2张

换源,最终修复了fdisk无法使用的bug.



微信搜索公众号黑猫之家看更多资讯哦

来黑猫之家看看呗

Copyright © 2021-2023 | 个人技术展示 |赣ICP备18005425号-1 | 赣公网安备36070202000869 |