Sponsored Content
Operating Systems Linux Ubuntu Problem creating Desktop shortcuts through Debian dpkg installer scripts Post 302415264 by royalibrahim on Thursday 22nd of April 2010 06:33:20 AM
Old 04-22-2010
Problem creating Desktop shortcuts through Debian dpkg installer scripts

Hi,

I am creating a debian package (*.deb) for my application using the command
Quote:
fakeroot dpkg-deb --build <mypackage>
I am using debian pre/post installer scripts to do certain tasks before/after installation/uninstallation. One such task is to create a shortcut on the user's desktop to launch my application. I am trying to do this by copying the *.desktop file from /usr/share/applications/<mypackage>.desktop to "${HOME}"/Desktop. As we are running the dpkg install command (or gdebi-gtk UI installer) as root (sudo) unfortunately the process does not predicate the user on whom behalf the install command is running. Hence the copy is not taking place as expected. The script could not figure out the correct user if I issue the command "logname", "id -un", "whoami" or "$USER" as all these commands return the user as root. I also tried to create a symbolic link on the users Desktop directory and failed to do that.

Please help me how to solve this problem?

Also, I am using delivering a notification through a pop-up screen if the user tries to remove/uninstall on his system that installed package when one of the instance is running. This I am doing using "notify-send" command of "libnotify-bin" package. To get the pop up screen I need to run the command as
Quote:
gksudo -u <user> "sudo dpkg --purge <mypackage>"
What my question is, since we are running this using gksudo, why I need to give sudo command once again and why I am getting "dpkg: requested operation requires superuser privilege" error if I am not giving that?
 

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with scripting APT / dpkg in Debian 4

Hello, I am attempting to write a (bash) shell script that will do some basic reporting based on the APT utilities and dpkg. I need the following in the report: Packages installed (COLUMNS=200 dpkg -l | grep '/^ii/' > packages_installed) Packages not installed I suppose that I can do ... (0 Replies)
Discussion started by: orspain
0 Replies

2. UNIX for Advanced & Expert Users

rpm,pkg and debian installer

Hi, Can someone explain what's the difference between rpm, pkg and debian installer and what is the advantage of one above the other? Thanks (2 Replies)
Discussion started by: naan
2 Replies

3. Debian

Debian installer or how to preseed

Good afternoon! Could you please clarify me how to use correct Debian's preseed file? I have a kernel version 4.15.0-20-generic (Ubuntu 18.04) and default initrd (both downloaded from official repo) Also I have a little kickstart file and main preseed cfg file Installation start by iPXE... (4 Replies)
Discussion started by: nodorgrom
4 Replies
dpkg-trigger(1) 						    dpkg suite							   dpkg-trigger(1)

NAME
dpkg-trigger - a package trigger utility SYNOPSIS
dpkg-trigger [option...] trigger-name dpkg-trigger [option...] command DESCRIPTION
dpkg-trigger is a tool to explicitly activate triggers and check for its support on the running dpkg. This can be used by maintainer scripts in complex and conditional situations where the file triggers, or the declarative activate triggers control file directive, are insufficiently rich. It can also be used for testing and by system administrators (but note that the triggers won't actually be run by dpkg-trigger). Unrecognized trigger name syntaxes are an error for dpkg-trigger. COMMANDS
--check-supported Check if the running dpkg supports triggers (usually called from a postinst). Will exit 0 if a triggers-capable dpkg has run, or 1 with an error message to stderr if not. Normally, however, it is better just to activate the desired trigger with dpkg-trigger. -?, --help Show the usage message and exit. --version Show the version and exit. OPTIONS
--admindir=dir Change the location of the dpkg database. The default location is /var/lib/dpkg. --by-package=package Override trigger awaiter (normally set by dpkg through the DPKG_MAINTSCRIPT_PACKAGE environment variable of the maintainer scripts, naming the package to which the script belongs, and this will be used by default). --no-await This option arranges that the calling package T (if any) need not await the processing of this trigger; the interested package(s) I, will not be added to T's trigger processing awaited list and T's status is unchanged. T may be considered installed even though I may not yet have processed the trigger. --await This option does the inverse of --no-await (since dpkg 1.17.21). It is currently the default behavior. --no-act Just test, do not actually change anything. EXIT STATUS
0 The requested action was successfully performed. Or a check or assertion command returned true. 1 A check or assertion command returned false. 2 Fatal or unrecoverable error due to invalid command-line usage, or interactions with the system, such as accesses to the database, memory allocations, etc. ENVIRONMENT
DPKG_ADMINDIR If set and the --admindir option has not been specified, it will be used as the dpkg data directory. SEE ALSO
dpkg(1), deb-triggers(5), /usr/share/doc/dpkg-dev/triggers.txt.gz. 1.19.0.5 2018-04-16 dpkg-trigger(1)
All times are GMT -4. The time now is 01:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy