Ubuntu – How to install programs from a .deb file, like apt-get install supertux


I am an maintainer for a lot of computers in my town running ubuntu 12.04 and 14.04 with mate desktop, this is to help people just having a computer that just works :), and i cannot make them all do terminal work, hense having a .deb install they can download from dropbox via facebook annonce to them will be much better.

So… i want to create a .deb file that does:

apt-get install compiz compiz-plugins compiz-plugins-extra compizconfig-settings-manager -y

and makes the config file in ~/.config/compiz-1/compizconfig/Default.ini so everything works, i will however advice them to start of by ALT + F2 _ compiz –replace to see if everything works ok.

But how do it do this?, i tried apt-get install in control but of course this does not work as it can't start a different install process while instilling this .deb…

this is how i have tried so far…

apt-get install compiz compiz-plugins compiz-plugins-extra compizconfig-settings-manager -y
mkdir ~/.config/compiz-1
mkdir ~/.config/compiz-1/compizconfig
echo "[ezoom]
s0_zoom_in_button = <Super>Button4
s0_zoom_out_button = <Super>Button5

s0_active_plugins = core;composite;opengl;compiztoolbox;decor;wall;resize;regex;imgpng;snap;commands;mousepoll;place;grid;move;animation;scale;ezoom;staticswitcher;
s0_toggle_window_maximized_key = Disabled

s0_focus_on_switch = true
s0_icon_only = true
s0_mipmap = false


s0_run_command0_key = <Control><Alt>t
s0_command0 = mate-terminal
s0_command1 = mate-panel --run-dialog
s0_run_command1_key = <Alt>F2
s0_command2 = mate-screenshot
s0_run_command2_key = Print


s0_mode = 2" > ~/.config/compiz-1/compizconfig/Default.ini

Best Answer

  • To install other packages along with yours, the simplest way is to mark them as dependencies.

    Affecting a user's home directory or settings, however, cannot be easily done by a package. Packages are not supposed to do this, so there's no standard mechanism. What you can do, however, is install the script, and the new default configuration, along with a launcher for the script. So the package will install:


    And the script, now called /usr/bin/my-compiz-config, will contain:

    mkdir -p ~/.config/compiz-1/compizconfig
    cp /usr/share/my-compiz-config/Default.ini ~/.config/compiz-1/compizconfig/Default.ini

    I took the liberty of moving the configuration file contents to a separate file.

    The .desktop file will contain:

    [Desktop Entry]
    Name=My Compiz Configuration

    Then the users can search for "My Compiz Configuration" in the Dash and run it. The whole thing can be accomplished from start to finish by the user entirely from the GUI.

    Added by Heine Nielsen this is the control for the compiz-install.deb

    Package: Compiz-install
    Version: 1.0
    Installed-Size: 9800
    Architecture: all
    Depends: compiz, compiz-plugins, compiz-plugins-extra, compizconfig-settings-manager
    Maintainer: Heine Nielsen <email removed>
    Description: Install Compiz + extras, and setup keys, settings etc