为什么我不能通过 shell 脚本更新我的系统?

Afr*_*Afr 3 server updates apt scripts 14.04

我有一个非常简单的脚本,我们称之为update.sh

#!/bin/bash

echo "Updating system..."
sudo apt-get udpate
sudo apt-get udgrade
Run Code Online (Sandbox Code Playgroud)

运行这个脚本,抛出以下错误:

me@host $ ./update.sh
Updating system...
E: Invalid operation udpate
E: Invalid operation udgrade
Run Code Online (Sandbox Code Playgroud)

这是 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
Run Code Online (Sandbox Code Playgroud)

根据需要直接从 shell 运行命令:

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
[...]
Run Code Online (Sandbox Code Playgroud)

这是为什么?任何的想法?

Ham*_*ava 5

udpate并且udgrade错了!

尝试这个 :

#!/bin/bash

echo "Updating system..."
sudo apt-get update
sudo apt-get upgrade
Run Code Online (Sandbox Code Playgroud)