Results 1 to 9 of 9

Thread: Accidentally deleted dpkg, can't update

  1. #1
    Join Date
    May 2010
    Location
    Zagreb, Croatia
    Beans
    39
    Distro
    Ubuntu 10.04 Lucid Lynx

    Accidentally deleted dpkg, can't update

    i have accidentally deleted dpkg, so i have this error in Synatic when trying to update




    or through terminal, showing this error:

    root@XXXXXX:~# apt-get -f install
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Correcting dependencies... Done
    The following extra packages will be installed:
    fglrx
    The following NEW packages will be installed:
    fglrx
    0 upgraded, 1 newly installed, 0 to remove and 39 not upgraded.
    2 not fully installed or removed.
    Need to get 0B/29.2MB of archives.
    After this operation, 100MB of additional disk space will be used.
    Do you want to continue [Y/n]? Y
    Could not exec dpkg!
    E: Sub-process /usr/bin/dpkg returned an error code (100)

    How to get original dpkg? and where to copy?
    Last edited by rizameister; June 23rd, 2010 at 03:08 PM.

  2. #2
    Join Date
    Jun 2009
    Location
    Manchester
    Beans
    87

    Re: Accidentally deleted dpkg, can't update

    Can you not compile and install from source?

  3. #3
    Join Date
    Jun 2009
    Location
    Open Linux Forums
    Beans
    2,710

    Re: Accidentally deleted dpkg, can't update

    download the package from this page: http://packages.ubuntu.com/lucid/dpkg
    hopefully gdebi still works for you, just launch the package from your browser.
    I'm not antisocial. I'm just not user friendly...
    Open Linux Forums

  4. #4
    Join Date
    Mar 2010
    Location
    Freedom 3
    Beans
    379
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Accidentally deleted dpkg, can't update

    From the liveCD (if I remember well) or from http://archive.ubuntu.com/ubuntu/pool/main/d/dpkg/ (just make sure you select the correct version for your distro).

    Since you don't have dpkg anymore you cannot use dpkg to install the .deb file (its the chicken and egg problem ). So you will have to use `ar' to unpack the .deb archive (debian packages are `ar' type archives).

    See `man ar' for details - it may also be the case that you will be able to unpack it from inside the gnome gui (don't know since I have never needed that). Then copy dpkg -since you just deleted this file, there is no need to touch config files etc- in /usr/bin/ .

    Use `chmod 750 /usr/bin/dpkg' afterwards to set the right permissions for the executable.
    To suppress free speech is a double wrong. It violates the rights of the hearer as well as those of the speaker.
    Free Software - Free Society | The GNU Project | FSF | ESP

  5. #5
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: Accidentally deleted dpkg, can't update

    Assuming that you are using Ubuntu 10.04. Download the package:
    Code:
    mkdir /tmp/dpkg
    cd /tmp/dpkg
    for 32bit:
    Code:
    wget http://archive.ubuntu.com/ubuntu/pool/main/d/dpkg/dpkg_1.15.5.6ubuntu4_i386.deb
    for 64bit:
    Code:
    wget http://archive.ubuntu.com/ubuntu/pool/main/d/dpkg/dpkg_1.15.5.6ubuntu4_amd64.deb
    Extract the archive:
    Code:
    ar x dpkg*.deb data.tar.gz
    tar xfvz data.tar.gz ./usr/bin/dpkg
    Copy the binary to /usr/bin:

    Code:
    sudo cp ./usr/bin/dpkg /usr/bin/
    Now try to reinstall dpkg:
    Code:
    sudo apt-get update
    sudo apt-get install --reinstall dpkg

  6. #6
    Join Date
    May 2010
    Location
    Zagreb, Croatia
    Beans
    39
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Accidentally deleted dpkg, can't update

    Quote Originally Posted by sisco311 View Post
    Assuming that you are using Ubuntu 10.04. Download the package:
    Code:
    mkdir /tmp/dpkg
    cd /tmp/dpkg
    for 32bit:
    Code:
    wget http://archive.ubuntu.com/ubuntu/pool/main/d/dpkg/dpkg_1.15.5.6ubuntu4_i386.deb
    for 64bit:
    Code:
    wget http://archive.ubuntu.com/ubuntu/pool/main/d/dpkg/dpkg_1.15.5.6ubuntu4_amd64.deb
    Extract the archive:
    Code:
    ar x dpkg*.deb data.tar.gz
    tar xfvz data.tar.gz ./usr/bin/dpkg
    Copy the binary to /usr/bin:

    Code:
    sudo cp ./usr/bin/dpkg /usr/bin/
    Now try to reinstall dpkg:
    Code:
    sudo apt-get update
    sudo apt-get install --reinstall dpkg
    Thank you all! It is working!
    sisco 311 You're God!

  7. #7
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: Accidentally deleted dpkg, can't update

    You're welcome!


    Please mark this thread as [SOLVED].

    At the top of the page, click the "Thread Tools" Menu and then "Mark this thread as Solved".

    Thanks.

  8. #8
    Join Date
    Jun 2011
    Beans
    1

    Re: Accidentally deleted dpkg, can't update

    Hi Sisco311,

    I need help as I know nothing about using Terminal and handling .deb files. I actually face exactly same problem in this thread. Are you able to SSH into my iphone if I give you my Wifi ip address?

    Hope you can help me.

    Thank you in advance.

    Nicholas.

  9. #9
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: Accidentally deleted dpkg, can't update

    Quote Originally Posted by nic168 View Post
    Hi Sisco311,

    I need help as I know nothing about using Terminal and handling .deb files. I actually face exactly same problem in this thread. Are you able to SSH into my iphone if I give you my Wifi ip address?

    Hope you can help me.

    Thank you in advance.

    Nicholas.
    Hi nic168 and welcome to the forums!

    You can do the same thing via the GUI.

    You have to download dpkg_1.16.0~ubuntu8_i386.deb from http://archive.ubuntu.com/ubuntu/pool/main/d/dpkg/

    Then open your file manager and navigate to the directory where the file was downloaded. Right click on the file and select Extract here. The file will be extracted in a new directory: dpkg_1.16.0~ubuntu8_i386.

    Now open your file manager as root, press Alt+F2 and run:
    Code:
    gksu nautilus
    Navigate to the dpkg_1.16.0~ubuntu8_i386/usr/bin directory and copy the dpkg file in the /usr/bin directory. Close the file manager.

    Open Synaptic package manager, search for the dpkg package and reinstall it.

    HTH

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •