Linux 实现deb包解压、修改等操作的方法

今天就跟大家聊聊有关Linux 实现deb包解压、修改等操作的方法,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。

#解压出包中的文件到extract目录下

lin@lin-host:~/Desktop/100次重启工具$ ls
LongTestTools.sh loong-test-s2s3_1.0.0-2_all.deb readme.txt
lin@lin-host:~/Desktop/100次重启工具$ dpkg -X loong-test-s2s3_1.0.0-2_all.deb extract/
./
./usr/
./usr/bin/
./usr/bin/BootReplace.sh
./usr/bin/BootTest.sh
./usr/bin/LongTestTools.sh
./usr/bin/RebootReplace.sh
./usr/bin/RebootTest.sh
./usr/bin/SleepTest.sh
./usr/bin/SuspendTest.sh
lin@lin-host:~/Desktop/100次重启工具$ ls
extract LongTestTools.sh loong-test-s2s3_1.0.0-2_all.deb readme.txt
lin@lin-host:~/Desktop/100次重启工具$ tree extract/
extract/
└── usr
  └── bin
    ├── BootReplace.sh
    ├── BootTest.sh
    ├── LongTestTools.sh
    ├── RebootReplace.sh
    ├── RebootTest.sh
    ├── SleepTest.sh
    └── SuspendTest.sh

#解压出包的控制信息extract/DEBIAN/下:

lin@lin-host:~/Desktop/100次重启工具$ dpkg -e loong-test-s2s3_1.0.0-2_all.deb extract/DEBIAN/ 
lin@lin-host:~/Desktop/100次重启工具$ tree extract/
extract/
├── DEBIAN
│   ├── control
│   └── md5sums
└── usr
  └── bin
    ├── BootReplace.sh
    ├── BootTest.sh
    ├── LongTestTools.sh
    ├── RebootReplace.sh
    ├── RebootTest.sh
    ├── SleepTest.sh
    └── SuspendTest.sh

3 directories, 9 files

#修改文件

vi extract/usr/bin/BootTest.sh

Linux 实现deb包解压、修改等操作的方法

对修改后的内容重新进行打包生成deb包

lin@lin-host:~/Desktop/100次重启工具$ dpkg-deb -b extract/ 
dpkg-deb:正在新建软件包 loong-test-s2s3,包文件为 extract.deb。
lin@lin-host:~/Desktop/100次重启工具$ ls
extract extract.deb LongTestTools.sh readme.txt

看完上述内容,你们对Linux 实现deb包解压、修改等操作的方法有进一步的了解吗?如果还想了解更多知识或者相关内容,请关注行业资讯频道,感谢大家的支持。