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:
/usr/bin/my-compiz-config
/usr/share/applications/my-compiz-config.desktop
/usr/share/my-compiz-config/Default.ini
And the script, now called /usr/bin/my-compiz-config
, will contain:
#!/bin/sh
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]
Type=Application
Terminal=true
Name=My Compiz Configuration
Exec=/usr/bin/my-compiz-config
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
Date-2015_02_08
Actually gdebi
is just a front-end to the dpkg
with added functionality that it can check for dependency packages in the repositories and can install them in one-operation, while dpkg -i
requires two operations manually (later being apt-get -f install
).
Question 1:
1) How gdebi do this? install .deb Packages with Dependencies without using Apt PPA links added manually in configuration files?
Being a dpkg
front-end, it can use all of the functionality of dpkg
. Since every .deb
package file contains (provided that they are not corrupt) metadata about that deb file (like package name, maintainer, dependencies etc), it can easily check this file's dependency.
For example, you can check a .deb file's metadata using dpkg --info package-name.deb
And then it uses these information to construct dependency map and mark the locally available .deb files as already downloaded and download other .deb
files from Internet.
Take note that, those needed extra packages must be available (with proper version) in at least one of the repositories, which are configured in the system.
Then it proceed to like a normal apt installation. The difference is it doesn't re-download the main .deb file
Question 2:
(2) Can I use same gdebi command ( sudo su -c gdebi my.deb
)to install all other deb packages without adding a PPA? or do I have to change format sudo su -c myn.deb
where n is version of software etc?
The PPAs exists for a reason. The main reason is they provide latest versions of packages . And these higher versioned package usually depends on higher versions of sub-packages also, which are also normally served from the PPA, not from standard Ubuntu repository.
Example Scenario:
Suppose, A package named mother-package has the highest version of 2.0
in Standard Ubuntu repositories, and this mother-package depends on a package named child-package of version 2. Also suppose, some PPA provides mother-package of version 3.0
which requires on child-package
of 3.0
, both of them are available via that PPA repository.
The problem is, if you now download mother-package-3.0.deb from the repository page and try to install it with gdebi
, you'll (or gdebi
) fail.
Because, checking the mother-package-3.0.deb file, gdebi
knew that this mother-package needs child-package of version 3.0
or higher, but It only knows the location of version 2.0
. It doesn't know where to fetch the version 3.0
of child-package from. This is expected because, You didn't tell the system where you get this latest mother-package. In other words, You didn't configured the repository list to include that PPA.
So, the Obvious answer is of this question is It depends. If the necessary dependencies can be found in already configured repositories, the installation will be successful. But if not, then it'll fail to install this highered versioned package. That's why you still need PPAs and that is the easiest way without manually doing all these.
The second part of the second question didn't make sense to me.
Best Answer
Gdebi
gdebi
installs a deb package and its dependencies. To use it run:In newer versions of Ubuntu, this is not installed by default, so you will need to install it from the repositories.
See
man gdebi
for a full list of options.gdebi
is the command line equivalent to the graphical tool of the same name that used to be included by default in Ubuntu. The command for the graphical tool isgdebi-gtk
and has similar functionality: