dpkg 是 Debian 系统中的包管理器,在安装、卸载、升级软件包时会执行一些脚本,其中 postrm 就是卸载软件包时执行的脚本。
在编写 postrm 脚本时,需要注意以下几点:
在脚本的开头添加
#!/bin/sh
,表示使用 sh 这个 shell 来执行脚本。在脚本的最前面添加如下内容:
set -e
if [ "$1" = "remove" -o "$1" = "upgrade" ]; then
# 在这里写卸载时要执行的操作
fi
dpkg 是 Debian 系统中的包管理器,在安装、卸载、升级软件包时会执行一些脚本,其中 postrm 就是卸载软件包时执行的脚本。
在编写 postrm 脚本时,需要注意以下几点:
在脚本的开头添加 #!/bin/sh
,表示使用 sh 这个 shell 来执行脚本。
在脚本的最前面添加如下内容:
set -e
if [ "$1" = "remove" -o "$1" = "upgrade" ]; then
# 在这里写卸载时要执行的操作
fi