LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   By mistake it deleted the /usr/bin/dpkg.exe please help!!! (https://www.linuxquestions.org/questions/linux-software-2/by-mistake-it-deleted-the-usr-bin-dpkg-exe-please-help-856468/)

amritpalpathak 01-15-2011 07:04 AM

By mistake it deleted the /usr/bin/dpkg.exe please help!!!
 
By mistake i deleted the /usr/bin/dpkg.exe file.Now i am unable to install anything .when i tried to install ssh i got the following error message.

Reading package lists... Done
Building dependency tree
Reading state information... Done
openssh-server is already the newest version.
openssh-client is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 386 not upgraded.
2 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Could not exec dpkg!
E: Sub-process /usr/bin/dpkg returned an error code (100)


Please somebody help me to resolve this.

Thanks

sycamorex 01-15-2011 07:06 AM

Linux executables do not have the .exe extension. Which version of Ubuntu are you using? Have you still got the installation DVD?

sycamorex 01-15-2011 07:11 AM

A couple of links with solutions:
http://ubuntuforums.org/showthread.php?t=197819
http://art.ubuntuforums.org/showthread.php?t=1516119

HTH

amritpalpathak 01-15-2011 07:38 AM

@sycamorex
Sorry it wasn't exe file but looks like that and properties showed executable .I am using ubuntu 10.04.Now what to do ?

Thanks.

sycamorex 01-15-2011 07:42 AM

Quote:

Originally Posted by amritpalpathak (Post 4225094)
@sycamorex
Sorry it wasn't exe file but looks like that and properties showed executable .I am using ubuntu 10.04.Now what to do ?

Thanks.


Yes, the file had executable permissions. I was just pointing out that linux does not use the .exe file extension. It's a windows thing.
Please check the links I posted above. They seem to have solutions to your problem.

amritpalpathak 01-15-2011 08:02 AM

According to your link when i tried ,i got the following error.
sudo apt-get install dpkg --reinstall

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
dpkg
1 upgraded, 0 newly installed, 0 to remove and 385 not upgraded.
2 not fully installed or removed.
Need to get 0B/2,192kB of archives.
After this operation, 0B of additional disk space will be used.
/usr/bin/dpkg: 1: ELF: not found
/usr/bin/dpkg: 2: @@@@@@00pp@p@@@4@4@: not found
/usr/bin/dpkg: 1: Syntax error: Unterminated quoted string
E: Sub-process /usr/bin/dpkg returned an error code (2)

It seems to be different from that link.Now again strange.Help?

Thanks

teebones 01-15-2011 08:09 AM

http://art.ubuntuforums.org/showpost...05&postcount=5

This post appears to help, according to the OP on that forum thread. (same type of problem)

sycamorex 01-15-2011 08:09 AM

What about the second link, post #6?

teebones 01-15-2011 08:11 AM

that's the same, as my link (based on your link, lol) .. but with a "it works" comment ;)

sycamorex 01-15-2011 08:15 AM

Quote:

Originally Posted by teebones (Post 4225120)
that's the same, as my link (based on your link, lol) .. but with a "it works" comment ;)

Did not notice your comment when writing mine:)

amritpalpathak 01-15-2011 08:19 AM

I tried the this link too.But at the last command i got error as:

sudo apt-get install --reinstall dpkg

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
dpkg
1 upgraded, 0 newly installed, 0 to remove and 385 not upgraded.
2 not fully installed or removed.
Need to get 0B/2,192kB of archives.
After this operation, 0B of additional disk space will be used.
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend requires a screen at least 13 lines tall and 31 columns wide.)
debconf: falling back to frontend: Readline
/usr/bin/dpkg: 1: ELF: not found
/usr/bin/dpkg: 2: @@@@@@00pp@p@@@4@4@: not found
/usr/bin/dpkg: 1: Syntax error: Unterminated quoted string
E: Sub-process /usr/bin/dpkg returned an error code (2)


Please Help me.
Thanks

sycamorex 01-15-2011 08:29 AM

Quote:

Originally Posted by amritpalpathak (Post 4225128)
I tried the this link too.But at the last command i got error as:

sudo apt-get install --reinstall dpkg

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
dpkg
1 upgraded, 0 newly installed, 0 to remove and 385 not upgraded.
2 not fully installed or removed.
Need to get 0B/2,192kB of archives.
After this operation, 0B of additional disk space will be used.
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend requires a screen at least 13 lines tall and 31 columns wide.)
debconf: falling back to frontend: Readline
/usr/bin/dpkg: 1: ELF: not found
/usr/bin/dpkg: 2: @@@@@@00pp@p@@@4@4@: not found
/usr/bin/dpkg: 1: Syntax error: Unterminated quoted string
E: Sub-process /usr/bin/dpkg returned an error code (2)


Please Help me.
Thanks

Perhaps, some ubuntu users will be able to crack this one as I have no other suggestions than
installing dpkg from source. I'm sure there's a simpler solution, but if the worst comes to
the worst, you can always grab dpkg sources and compile it:

Code:

$ ./configure
$ make
# make install


knudfl 01-15-2011 09:20 AM

The easy way is to download a dpkg for your Ubuntu version.
http://packages.ubuntu.com/hardy/dpkg

ar dpkg_<version>.deb : will unpack to : data.tar.gz
tar xvf data.tar.gz : will unpack the executable /usr/bin/dpkg

... Then : sudo cp dpkg /usr/bin/
...

amritpalpathak 01-15-2011 10:57 AM

I have now /usr/bin/dpkg execable file.but still
sudo dpkg --configure -a
give the error like
dpkg: failed to open package info file `/usr/local/var/lib/dpkg/status' for reading: No such file or directory


Thanks

crts 01-15-2011 11:29 AM

Quote:

Originally Posted by amritpalpathak (Post 4225276)
I have now /usr/bin/dpkg execable file.but still
sudo dpkg --configure -a
give the error like
dpkg: failed to open package info file `/usr/local/var/lib/dpkg/status' for reading: No such file or directory


Thanks

Normally the status file should be in /var/lib/dpkg/status, at least it is on ubuntu 10.10. What is the output of
ls -l /var/lib/dpkg/

If 'status' is in it you could create a link to it like
ln -s /var/lib/dpkg/status /usr/local/var/lib/dpkg/status

If you keep having more problems related to missing files in /usr/local/lib/dpkg/ then you could try to relink the whole directory, i.e. if the config files are available in the default directory (/var/lib/dpkg/).


All times are GMT -5. The time now is 03:36 PM.