dpkg-repack跳过任何错误

嗨,使用此命令备份已安装的软件包及其依赖

package=firefox
dpkg-repack $(apt-cache depends $package |awk '!/\</{print $2}') $package

上面的代码从特定的包+依赖关系创建deb文件 但是,如果没有安装软件包,它将中断。 我想忽略错过的包裹(跳过它们)并继续完成。

这是一个示例执行命令

iris@q4os-desktop:~$ apt-cache depends --false-suggests firefox | awk '!/\</{print $2}'
libgtk-3-0
libglib2.0-0
libpango1.0-0
libdbus-glib-1-2
ghostscript
pulseaudio

apulse << it isn't installed!! causes break and don't let create deb for libavcodec-extra, ...

libavcodec58    
libavcodec-extra58

锁定这里是我的问题

iris@q4os-desktop:~/nord$ package=firefox
iris@q4os-desktop:~/nord$ sudo dpkg-repack $(apt-cache depends $package |awk '!/\</{print $2}') $package
dpkg-deb: building package 'libgtk-3-0' in './libgtk-3-0_3.24.5-1_amd64.deb'.
dpkg-deb: building package 'libglib2.0-0' in './libglib2.0-0_2.58.3-2+deb10u2_amd64.deb'.
dpkg-deb: building package 'libpango1.0-0' in './libpango1.0-0_1.42.4-8~deb10u1_amd64.deb'.
dpkg-deb: building package 'libdbus-glib-1-2' in './libdbus-glib-1-2_0.110-4_amd64.deb'.
dpkg-deb: building package 'ghostscript' in './ghostscript_9.27~dfsg-2+deb10u3_amd64.deb'.
dpkg-deb: building package 'pulseaudio' in './pulseaudio_12.2-4+deb10u1_amd64.deb'.
dpkg-query: package 'apulse' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files.
dpkg-repack: error: dpkg --root=/ -s apulse subprocess returned exit status 1
iris@q4os-desktop:~/nord$ ls
ghostscript_9.27~dfsg-2+deb10u3_amd64.deb  libglib2.0-0_2.58.3-2+deb10u2_amd64.deb  libpango1.0-0_1.42.4-8~deb10u1_amd64.deb
libdbus-glib-1-2_0.110-4_amd64.deb         libgtk-3-0_3.24.5-1_amd64.deb            pulseaudio_12.2-4+deb10u1_amd64.deb
iris@q4os-desktop:~/nord$

由于未安装apulse,它会中断,我想跳过/忽略它并继续

评论