Score:0

error cp: cannot overwrite directory '/usr/bin/dpkg' with non-directory

ck flag

Go to this url http://security.ubuntu.com/ubuntu/pool/main/d/dpkg/ and you will see a list of dpkg packages. You need to find the dpkg version you need than open new terminal.

Anywhere your machine I select Desktop.

mkdir dpkg 
cd dpkg

Run:

wget http://security.ubuntu.com/ubuntu/pool/main/d/dpkg/ 

(Add the version of dpkg you need after the last /)

For example I needed dpkg_1.17.5ubuntu5.2_amd64.deb but this does not exist any more so I chose the closest one which is

dpkg_1.17.5ubuntu5.8_amd64.deb 

So:

wget http://security.ubuntu.com/ubuntu/pool/main/d/dpkg/dpkg_1.17.5ubuntu5.8_amd64.deb

Run

ar x dpkg_1.17.5ubuntu5.8_amd64.deb 

Now you can see the contents:

~/dpkg $ ls
control.tar.gz  data.tar.gz  debian-binary  dpkg_1.17.5ubuntu5.8_amd64.deb

Run

~/dpkg $ tar xfvz data.tar.gz ./usr/bin/dpkg
./usr/bin/dpkg
~/dpkg $ ls
control.tar.gz  data.tar.gz  debian-binary  dpkg_1.17.5ubuntu5.8_amd64.deb  usr
~/dpkg $ cd usr/bin/
~/dpkg/usr/bin $ ls
dpkg

~/dpkg/usr/bin $ sudo cp dpkg /usr/bin/

Hi after performing all the above steps it is giving me an error cp: cannot overwrite directory '/usr/bin/dpkg' with non-directory

Got this error after last step What can be this error?

Artur Meinild avatar
vn flag
Why are you messing with `dpkg`? You are aware that this is a vital part of the system?
Artur Meinild avatar
vn flag
I think you somehow messed up by creating the dir `/usr/bin/dpkg` instead of `./usr/bin/dpkg`. I find that guide very confusing, and I don't see the point of it...
BeastOfCaerbannog avatar
ca flag
Also where are these steps from? Can you provide a link to the source?
Hitesh Kumar avatar
ck flag
By mistake i removed dpkg, that is the reason i am doing this.
Artur Meinild avatar
vn flag
Ok. Please state the version of Ubuntu you're running. Then find the matching version of dpkg.
guiverc avatar
cn flag
Refer https://askubuntu.com/help/on-topic where you'll notice only supported releases of Ubuntu and flavors are on-topic for this site. *Your `dpkg` package isn't for a supported release of Ubuntu*
guiverc avatar
cn flag
[Ubuntu 16.04 LTS has reached the end of it's *standard* support life](https://fridge.ubuntu.com/2021/03/13/extended-security-maintenance-for-ubuntu-16-04-xenial-xerus-begins-april-30-2021/) thus is now off-topic here unless your question is specific to helping you move to a supported release of Ubuntu. Ubuntu 16.04 ESM support is available, but not on-topic here, see https://askubuntu.com/help/on-topic See also https://ubuntu.com/blog/ubuntu-16-04-lts-transitions-to-extended-security-maintenance-esm
Hitesh Kumar avatar
ck flag
@ArturMeinild I am using 22.04LTS version of Ubuntu
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.