LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Using Java to install a package with dpkg in Debian (https://www.linuxquestions.org/questions/linux-newbie-8/using-java-to-install-a-package-with-dpkg-in-debian-604662/)

basis1980 12-05-2007 07:35 AM

Using Java to install a package with dpkg in Debian
 
I have got an interesting problem.

First I have to tell a little bit about the setting. I have a linux embedded device. I am using Debian with this device. I have made the necessary arrangements so that when I put a USB flash disk with a file update.jar in the USB flash, the device automatically run the command java -jar update.jar and do whatever necessary (create a directory, delete a file etc.).

This has been working like a charm till now. But now I have to install a package (openntpd) using this setting. In the update.jar java file I have the command:

/usr/bin/dpkg --install /media/usb0/openntpd.deb

I expect this to install the package without a problem when I put the USB flash stick. But it doesn't do that. However it does runs the other commands in the update.jar file.

So I suspect that the problem is related with dpkg command.

The interesting part is when I manually enter the command java -jar /media/usb0/update.jar into the console it does installs the package.

any ideas why this would be happenning?

pentode 12-05-2007 11:06 AM

Just guessing, but perhaps the .deb file is screwed up. dpkg expects to find the .deb file meeting the defined requirements. It gets cranky if something is missing or per spec.

Debian website has requirements for .deb file. I doubt the problem is in dpkg itself.

mrrangerman 12-05-2007 01:33 PM

Quote:

I have a linux embedded device. I am using Debian with this device.
Ok I know nothing about working with an embedded device, so my question is, does the device OS run as root or is there some kind of user. If its the later then I would say its a permission problem. You need root privilege for dpkg.
Just a shot in the dark.

basis1980 12-06-2007 01:39 AM

Quote:

Originally Posted by mrrangerman (Post 2981257)
Ok I know nothing about working with an embedded device, so my question is, does the device OS run as root or is there some kind of user. If its the later then I would say its a permission problem. You need root privilege for dpkg.
Just a shot in the dark.

this is also what I have in mind.. is there a way or a command that would allow me login as root? (I do not use a monitor or keyboard so I should directly run this command as a single line. such as "/bin/login user:root password:mypassword" sort of thing)..

basis1980 12-06-2007 02:45 AM

I got the error stream now it gets worse:

dpkg - error: PATH is not set.

I thought the path for dpkg is /usr/bin/dpkg

any comments?


All times are GMT -5. The time now is 04:55 AM.