0

I got this when I opened the terminal:

Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
leah@leah-pc ~>

... and I then tried to run a command:

leah@leah-pc ~> 'dpkg --configure -a' 
dpkg --configure -a: command not found

... which didn't work as expected. What do I do next?

5
  • You've not provided basic details such as what Ubuntu product, and release of that product you're using. Ubuntu Core for example does not have a dpkg command (it's a snap only version of Ubuntu).
    – guiverc
    Dec 9, 2023 at 6:35
  • 2
    You appear to be running the command inside single quotes with the quotes included like 'dpkg --configure -a' ... and that will pass the whole command including its options and arguments to be passed to the shell as a single token and handled as such ... That won't work ... Try removing the quotes instead like dpkg --configure -a and it should work.
    – Raffa
    Dec 9, 2023 at 9:15
  • @karel no, the OP here ran the command quoted, look at the error message.
    – terdon
    Dec 9, 2023 at 10:50
  • 1
    Imma be real here...as a very experienced professional software developer who literally spends hours every day at the command line I love fish shell, but I question whether it's appropriate for a non-expert. Be aware that many, many things you will want to copy-paste from the internet are not going to work as-is in fish. I recommend maybe using something like bash or zsh until you have enough experience to decide whether fish is right for you. My $0.02. Dec 9, 2023 at 15:28
  • Tangentially, you might want to use sudo dpkg --configure -a. Most dpkg commands will not work without administrator privileges. Dec 10, 2023 at 12:08

1 Answer 1

11

You appear to be running the command inside single quotes with the quotes included like 'dpkg --configure -a' (double quotes "..." will result in the same as well) ... and that will result in the whole command including its options and arguments to be read by the shell as a single token and handled as such i.e. the shell will try to call the command dpkg --configure -a instead of calling the command dpkg and passing it the options --configure and -a ... That won't work.

Try removing the quotes instead like dpkg --configure -a and use it with sudo as that operation requires elevated privileges to run like so:

sudo dpkg --configure -a

... and it should work.

1
  • 1
    This worked perfectly, thank you for understanding a Mom that had no Idea, yet it was so easy. Many hugs to you!!! Dec 12, 2023 at 1:56

You must log in to answer this question.

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