【问题标题】:Script to install Flash Player through postinst通过 postinst 安装 Flash Player 的脚本
【发布时间】:2011-06-24 19:10:45
【问题描述】:

我创建了一个 debian 包。我需要在安装这个 .deb 时检查 Adob​​e Flash Player。如果没有安装 Flash Player,那么我也需要安装它。在浏览时,我知道 postinst 文件可用于此目的。 postinst 文件是

#!/bin/bash

echo “Stopping any Firefox that might be running”
sudo killall -9 firefox

echo “Removing any other flash plugin previously installed:”
sudo apt-get remove -y –purge flashplugin-nonfree gnash gnash-common mozilla-plugin-gnash swfdec-mozilla libflashsupport nspluginwrapper
sudo rm -f /usr/lib/mozilla/plugins/*flash*
sudo rm -f ~/.mozilla/plugins/*flash*
sudo rm -f /usr/lib/firefox/plugins/*flash*
sudo rm -f /usr/lib/firefox-addons/plugins/*flash*
sudo rm -rfd /usr/lib/nspluginwrapper

echo “Installing Flash Player 10″
#cd ~
sudo cp /home/libflashplayer.so /usr/lib/mozilla/plugins/

echo “Linking the libraries so Firefox and apps depending on XULRunner.”
sudo ln -sf /usr/lib/mozilla/plugins/libflashplayer.so /usr/lib/firefox-addons/plugins/
sudo ln -sf /usr/lib/mozilla/plugins/libflashplayer.so /usr/lib/xulrunner-addons/plugins/

# now doing some cleaning up:
sudo rm -rf libflashplayer.so
sudo rm -rf libflashplayer-10.0.32.18.linux-x86_64.so.tar.gz

但是什么都没有发生。 谁能帮我写个脚本来通过脚本安装flash player?

【问题讨论】:

  • 为什么不使用 debian/control 将 flash 插件列为软件包的依赖项?
  • 有什么错误信息可以告诉我们吗?
  • 信号-9 (SIGKILL) 只能作为最后的手段使用,因为它无法被捕获,因此程序没有机会优雅地退出。尝试#!/bin/bash -x 进行跟踪,看看发生了什么。

标签: bash


【解决方案1】:

看来您的 $HOME 路径错误:

sudo cp /home/libflashplayer.so /usr/lib/mozilla/plugins/

你的意思是:

sudo cp $HOME/libflashplayer.so /usr/lib/mozilla/plugins/

【讨论】:

  • 感谢您的快速回复。实际代码是 echo “Installing Flash Player 10” cd ~ wget download.macromedia.com/pub/labs/flashplayer10/... tar zxvf libflashplayer-10.0.42.34.linux-x86_64.so.tar.gz sudo cp libflashplayer.so /usr /lib/mozilla/plugins/ 但我将 libflashplayer.so 保存在 /home 目录中
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-02-29
  • 1970-01-01
  • 2021-12-18
  • 1970-01-01
  • 1970-01-01
  • 2017-02-19
  • 2020-07-21
相关资源
最近更新 更多