4

On issuing the command sudo dpkg -i (package name) at chronos@localhost ~ $, I get the response sudo: dpkg: command not found. Anyone know why?

I'm trying to load version 3 of network-manager and three related files to correct a known problem accessing wifi in 12.04 on some Toshiba computers, so Ubuntu is offline.

I've downloaded the four files, but I'm unclear on where they should be stored in order for dpkg -i (package name) to find them. Could I pursue the installation via apt-get if dpkg is actually missing? If so, what would be the correct command syntax?

2
  • Is this an actual problem?
    – A.B.
    Oct 21, 2015 at 4:56
  • I got brought here by google searching for "dpkg: command not found". Not sure why something so specific doesn't have a question/answer for newbies. It's maddening trying to learn this stuff!
    – Ben Power
    Jun 1, 2020 at 6:55

5 Answers 5

3

The original poster, Graubart, was able to solve their own problem. The Ubuntu system was being chrooted into from another, non-Ubuntu system. But the dpkg command was accidentally being issued outside of the chroot. By chrooting into the filesystem in which Ubuntu was installed, Graubart was able to run dpkg with no problems.

Okay, I discovered why I couldn't find dpkg--it's in chroot, and I was in chronos@localhost. Switched to chroot, and there it was! Typical greenhorn error, I suppose.

Graubart Apr 24 '14 at 3:18

0

It is unlikely that dpkg is missing from your system. If such a thing were possible, you couldn't download and install dpkg without dpkg! What is the result of:

dpkg --help

If it outputs text about how to use the command, then the command is present.

It doesn't matter where you downloaded the deb files as long as you navigate the terminal to that location first. For example, suppose you downloaded the files to your desktop. Then in the terminal:

cd ~/Desktop

Now list the contents of the directory:

ls

Are all the debs shown?

network-manager-3.99-00-ubuntu.deb
some_other_file-ubuntu3.deb
etc.deb

If so, install them:

sudo dpkg -i network*.deb

You can use the wildcard * to keep from typing the entire file name. You can also do:

sudo dpkg -i *.deb 

dpkg will attempt to install all of them at once and notify you if you have any missing dependencies.

1
  • Tried dpkg --help and was again told the command didn't exist. As noted, I entered the commands from chronos@localhost~$. Could that be the problem?
    – Graubart
    Apr 23, 2014 at 2:58
0

sudo dpkg -i *pkgname* is used to install deb file. if you have deb files downloaded then run this command. try to search the hardware driver in hardware manager.

apt-get install command search the software manager which is hosted on launchpad, whether this software is available on software channel.

for example:

sudo apt-get install vlc

if it is available in software channel, it will install without any problem.

first of all please tell do you have the deb files? is yes then try:

sudo dpkg -i <filename>

else search the driver in hardware manager. And if still you didn't get the driver install, please reply the model name of your system and wifi model build in the system. so that I can tell you how can you install the drivers.

2
  • Okay, I discovered why I couldn't find dpkg--it's in chroot, and I was in chronos@localhost. Switched to chroot, and there it was! Typical greenhorn error, I suppose.
    – Graubart
    Apr 23, 2014 at 22:23
  • Finally stumbled onto how to extract the wifi model information.
    – Graubart
    Apr 24, 2014 at 3:18
0

Try running the command:

:~$ locate dpkg

which should be found in /usr/bin/ as /usr/bin/dpkg. I only say this because: if the output from running any command tells you the command cannot be found, than you do not have that command installed.

The output of running a dpkg command where the dpkg binary cannot locate where the .deb archive is would be something like this:

dpkg: error processing archive packagenotfound.deb (--install):
cannot access archive: No such file or directory
Errors were encountered while processing:
packagenotfound.deb

so if the output looks similar to what I have posted the dpkg utility is installed and you need to change directories to the directory where the .debs reside and continue as you previously did.

1
  • I have the same problem as OP. When I go to /usr/bin, the dpkg folder is missing. I was going to use dpkg to install a .deb that I found, which was going to install apt. Not sure why both of these are missing.
    – Millar248
    May 30, 2019 at 14:15
0

Try su -l (enter your root pass), then cd to the dir where you deb file resides and then try again dpkg -i instertyourdebname.deb.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .