Why can't I update my system via shell script?
5,962
udpate
and udgrade
are wrong!
try this :
#!/bin/bash
echo "Updating system..."
sudo apt-get update
sudo apt-get upgrade
Related videos on Youtube
Author by
q9f
Updated on September 18, 2022Comments
-
q9f over 1 year
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?
-
Pabi almost 10 yearsYou have some typos.. its update and upgrade.
-
Pandya almost 10 years@vertoe command-line clearly showing error:
E: Invalid operation udpate
so check spelling right isupdate
notudpate
and same forupgrade
! -
citynorman over 6 yearsin 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.
-