2

I have a very simple script, let's call it update.sh:

#!/bin/bash

echo "Updating system..."
sudo apt-get udpate
sudo apt-get udgrade

Running this script, throws the following error:

me@host $ ./update.sh
Updating system...
E: Invalid operation udpate
E: Invalid operation udgrade

This is Ubuntu Server 14.04 LTS x64.

me@host $ uname -a
Linux host 3.13.0-30-generic #54-Ubuntu SMP Mon Jun 9 22:45:01 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Running the command from shell directly works as desired:

me@host $ sudo apt-get update
Ign http://some.mirror.ubuntu.com trusty InRelease
Ign http://some.mirror.ubuntu.com trusty-updates InRelease
Hit http://some.mirror.ubuntu.com trusty Release.gpg
Hit http://some.mirror.ubuntu.com trusty-updates Release.gpg
Hit http://some.mirror.ubuntu.com trusty Release
[...]

Why is that? Any idea?

closed as off-topic by muru, Fabby, Eric Carvalho, Maythux, waltinator Jul 16 '15 at 17:39

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This describes a problem that can't be reproduced that seemingly went away on its own or was only relevant to a very specific period of time. It's off-topic as it's unlikely to help future readers." – muru, Fabby, Eric Carvalho, Maythux, waltinator
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    You have some typos.. its update and upgrade. – Pabi Jul 2 '14 at 14:08
  • @vertoe command-line clearly showing error: E: Invalid operation udpate so check spelling right is update not udpate and same for upgrade! – Pandya Jul 2 '14 at 14:38
  • in my case it was a matter of saving with the right line endings. I was running vagrant in windows and saving a script file with windows settings so it wouldn't read correctly in the linux box. – citynorman Dec 31 '17 at 1:52
5

udpate and udgrade are wrong!

try this :

#!/bin/bash

echo "Updating system..."
sudo apt-get update
sudo apt-get upgrade
  • Lol thanks for spotting my TYPO!!!! +1 – Waqar Lim Jul 2 '14 at 14:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.