LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-15-2012, 01:59 PM   #1
siemaeniu500
Member
 
Registered: Sep 2012
Posts: 44

Rep: Reputation: Disabled
I've delete dpkg by mistake ! Please help !


I've delete dpkg by mistake !
My system: debian 6.0 x64

This error have show:


Could not exec dpkg!
E: Sub-process /usr/bin/dpkg returned an error code (100)
 
Old 09-15-2012, 02:14 PM   #2
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid/RPIOS
Posts: 4,886
Blog Entries: 28

Rep: Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533
Debian Reference - Debian package management - http://qref.sourceforge.net/quick/ch-package.en.html
Quote:
6.3.7 What to do if the dpkg command is broken

A broken dpkg may make it impossible to install any .deb files. A procedure like the following will help you recover from this situation. (In the first line, you can replace "links" with your favorite browser command.)

$ links http://http.us.debian.org/debian/pool/main/d/dpkg/
... download the good dpkg_version_arch.deb
$ su
password: *****
# ar x dpkg_version_arch.deb
# mv data.tar.gz /data.tar.gz
# cd /
# tar xzfv data.tar.gz
 
Old 09-15-2012, 02:18 PM   #3
KinnowGrower
Member
 
Registered: May 2008
Location: Toronto
Distribution: Centos && Debian
Posts: 347

Rep: Reputation: 34
You have already getting help at http://www.linuxquestions.org/questi...or-4175427392/. Why did you created new thread?

However they give the solution in this link http://ubuntuforums.org/showthread.php?t=1856256&page=2

1. Wget the deb package for dpkg
2. Then untar it

Follow the steps in link
 
Old 09-15-2012, 02:56 PM   #4
siemaeniu500
Member
 
Registered: Sep 2012
Posts: 44

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by craigevil View Post
Debian Reference - Debian package management - http://qref.sourceforge.net/quick/ch-package.en.html
root@sieemaen:~# ar x dpkg_1.15.8.12_amd64.deb
-bash: ar: command not found
 
Old 09-15-2012, 03:00 PM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,897

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
you either removed ar too, or you have not set PATH correctly. Can you check if the file /usr/bin/ar exists?
 
Old 09-15-2012, 03:02 PM   #6
siemaeniu500
Member
 
Registered: Sep 2012
Posts: 44

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
you either removed ar too, or you have not set PATH correctly. Can you check if the file /usr/bin/ar exists?
No there isn't az file
 
Old 09-15-2012, 03:08 PM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,897

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
actually you can have an ar also, probably you can download it, but would be nice to know what else have been lost. In such cases reinstalling your os may give you a faster solution
 
Old 09-15-2012, 03:11 PM   #8
el chapulín
Member
 
Registered: Sep 2012
Posts: 75

Rep: Reputation: 19
Help others to help you - post outputs:

Code:
$ ls -l /usr/bin/dpkg
Code:
$ ls -l /usr/bin/ar
 
Old 09-15-2012, 03:15 PM   #9
siemaeniu500
Member
 
Registered: Sep 2012
Posts: 44

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by el chapulín View Post
Help others to help you - post outputs:

Code:
$ ls -l /usr/bin/dpkg
Code:
$ ls -l /usr/bin/ar

root@sieemaen:~# ls -l /usr/bin/dpkg
ls: cannot access /usr/bin/dpkg: No such file or directory
root@sieemaen:~# ls -l /usr/bin/ar
ls: cannot access /usr/bin/ar: No such file or directory





I can't reinstall my system, because i have important files which I can't upload/download
 
Old 09-15-2012, 03:36 PM   #10
el chapulín
Member
 
Registered: Sep 2012
Posts: 75

Rep: Reputation: 19
lt is in the same path as ar and dpkg ... so it looks like someone has been nuking files...?

You do not need to run either of those commands as root, try again and run as normal user with absolute paths

Code:
$ /usr/bin/ls -l /usr/bin/dpkg
Code:
$ /usr/bin/ls -l /usr/bin/ar
Also
Code:
$ /usr/bin/echo $PATH
"Important files" or not, you are facing reinstalling - hopefully next time you won't be mixing buntu packages or repos with Debian...

Last edited by el chapulín; 09-15-2012 at 03:40 PM.
 
Old 09-15-2012, 03:44 PM   #11
siemaeniu500
Member
 
Registered: Sep 2012
Posts: 44

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by el chapulín View Post
lt is in the same path as ar and dpkg ... so it looks like someone has been nuking files...?

You do not need to run either of those commands as root, try again and run as normal user with absolute paths

Code:
$ /usr/bin/ls -l /usr/bin/dpkg
Code:
$ /usr/bin/ls -l /usr/bin/ar
Also
Code:
$ /usr/bin/echo $PATH
"Important files" or not, you are facing reinstalling - hopefully next time you won't be mixing buntu packages or repos with Debian...
bash: /usr/bin/echo: No such file or directory
kamil@sieemaen:/root$ /usr/bin/ls -l /usr/bin/dpkg
bash: /usr/bin/ls: No such file or directory
kamil@sieemaen:/root$ /usr/bin/ls -l /usr/bin/ar
bash: /usr/bin/ls: No such file or directory
 
Old 09-15-2012, 04:23 PM   #12
siemaeniu500
Member
 
Registered: Sep 2012
Posts: 44

Original Poster
Rep: Reputation: Disabled
Now i type to console:


chmod 755 /usr/bin/dpkg



And error have rename to:

/usr/bin/dpkg: line 7: exec: dpkgs: not found
E: Sub-process /usr/bin/dpkg returned an error code (127)
 
Old 09-15-2012, 04:29 PM   #13
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,897

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
so there is no /usr/bin/ls, but ls /usr/bin/dpkg returned some answer. That looks really strange. What will
type ls
which ls
reply?
 
Old 09-15-2012, 04:33 PM   #14
siemaeniu500
Member
 
Registered: Sep 2012
Posts: 44

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
so there is no /usr/bin/ls, but ls /usr/bin/dpkg returned some answer. That looks really strange. What will
type ls
which ls
reply?




root@sieemaen:~# ls /usr/bin/dpkg
/usr/bin/dpkg



Dpkg content:

#!/bin/bash
if [ -e "/tmp/ThemeItLock" ]
then
rm -f /tmp/ThemeItLock
exec dpkgs $@ 1>/dev/null 2>/dev/null
else
exec dpkgs $@
fi

Last edited by siemaeniu500; 09-15-2012 at 04:34 PM.
 
Old 09-15-2012, 04:36 PM   #15
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,897

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
sorry, it does not help, what will reply the following commands:
type ls
which ls
echo $PATH
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dpkg: parse error, in file `/var/lib/dpkg/updates/0004 contact.aprie Linux - General 2 04-17-2012 09:01 PM
By mistake it deleted the /usr/bin/dpkg.exe please help!!! amritpalpathak Linux - Software 21 01-16-2011 04:14 AM
Ubuntu newbie, E: dpkg was interrupted, you must manually run 'dpkg --configure -a' ? chinkychan Linux - Newbie 1 01-28-2009 10:21 PM
Sound input wierdness (solved - silly mistake - mods pls delete) NDR008 Linux - Software 2 11-21-2006 03:35 AM
Delete by mistake accident of blue icon up2date. chico58 LQ Suggestions & Feedback 2 11-15-2003 05:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration