check_rpm.sh

本文介绍了一个用于检查RPM软件包安装兼容性的Shell脚本。该脚本通过调用rpm命令来获取软件包的描述信息和文件列表,并尝试进行安装测试,以此判断RPM包是否可以在当前系统上安装。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

#!/bin/bash
#rpm_check.sh
SUCCESS=0
E_NOARGES=65
if [ -z $1 ]
	then
	echo "Usage:`basename $0` rpm-file"
	exit $E_NOARGES
	fi
{
 echo
 echo "Archive Description:"
 rpm -qpi $1
 echo
 echo "Archive Listing:"
 rpm -qpl $1
 echo
 rpm -i --test $1
 if [ "$?" -eq $SUCCESS ]
	then
	echo "$1 can be installed."
	else
	echo "$1 can not be installed."
	fi
	echo 
	} > "$1.test"
exit 0

练习shell


[root@bogon dl]# sh denglin_hamming-0.406.6-202502282210-kylin-x86_64.run --target /dl /dl/cuda10.0 /dl/cuda_10_0_cudnn_7_6_5.patch Creating directory /dl Verifying archive integrity... 100% MD5 checksums are OK. All good. Uncompressing dl env 100% [LOG] SDK package check passed patching file builtin_types.h patching file CL/cl_egl.h patching file CL/cl_ext.h patching file CL/cl_gl_ext.h patching file CL/cl_gl.h patching file CL/cl.h patching file CL/cl.hpp patching file CL/cl_platform.h patching file crt/device_functions.h patching file crt/host_defines.h patching file crt/mma.h patching file crt/mma.hpp patching file cublas_api.h patching file cuda_bf16.h patching file cuda_bf16.hpp patching file cuda_fp16.h patching file cuda.h patching file cuda_runtime_api.h patching file cuda_runtime.h patching file cuda_surface_types.h patching file cusparse.h patching file driver_types.h patching file sm_20_atomic_functions.h patching file sm_20_atomic_functions.hpp patching file surface_types.h patching file thrust/system/cuda/detail/cub/util_type.cuh patching file vector_types.h [LOG] CUDA headers installed [LOG] Previous installation cleaned Activate Release Package @ /dl/sdk [LOG] Environment setup completed [LOG] Firmware installation completed make: Entering directory '/dl/sdk/kernel' make[1]: Entering directory '/dl/sdk/kernel/denglin' Makefile:27: *** "KERNEL_DIR(/lib/modules/4.19.90-89.11.v2401.ky10.x86_64/build) is not a valid kernel header tree". Stop. make[1]: Leaving directory '/dl/sdk/kernel/denglin' make: *** [Makefile:14: clean] Error 2 make: Leaving directory '/dl/sdk/kernel' [ERROR] Kernel driver module build failed [ERROR] Kernel module installation failed [ERROR] Installation failed
06-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值