How to fix E: The update command takes no arguments in APT

APTBEGINNERMEDIUMUpdated Dec 29, 2025· 250 views

The apt update command doesn't accept any arguments. This error occurs when you accidentally pass package names, file paths, or other parameters to apt update, which is a package index refresh command.

Quick fix

Fixes E: The update command takes no arguments

# WRONG - produces the error
apt update python3
apt-get update /etc/apt/sources.list

# CORRECT - apt update takes no arguments
sudo apt update
sudo apt-get update
  1. Run apt update without arguments
  2. If installing packages, use separate commands
  3. Fix scripts with proper escaping
  4. Verify package sources if update fails
apt — error
# WRONG - produces the error
apt update python3
apt-get update /etc/apt/sources.list
# CORRECT - apt update takes no arguments
sudo apt update
sudo apt-get update
E: The update command takes no arguments

What this error means

The `apt update` (or `apt-get update`) command is used to refresh the package index from configured software repositories. Unlike `apt install` or `apt upgrade`, the update command doesn't operate on packages themselves—it only synchronizes your local package list with remote repositories. When you pass arguments to `apt update`, it rejects them because the command is designed to update the entire index without package-specific targets. This commonly happens when users confuse apt update with apt install or when copy-pasting commands that mix different apt operations.

Typical symptoms

  • Running apt update with additional arguments produces the error message
  • Package installation appears to fail silently or with cryptic error
  • Command completes but nothing seems to have updated
  • Confusion about whether packages were installed

Common causes

  1. Passing package names to apt update (e.g., apt update python3)
  2. Attempting to pass file paths to apt update
  3. Copy-pasting command chains incorrectly without proper separators
  4. Confusing apt update with apt install syntax
  5. Incorrect escaping or special characters in bash scripts

How to fix "E: The update command takes no arguments"

1Run apt update without arguments

The simplest fix is to remove any arguments from the apt update command:

bash
# WRONG - produces the error
apt update python3
apt-get update /etc/apt/sources.list

# CORRECT - apt update takes no arguments
sudo apt update
sudo apt-get update

The command will refresh all configured package sources and update your local package cache.

2If installing packages, use separate commands

If you need to update and then install packages, use two separate commands with proper chaining:

bash
# WRONG - mixes update with install
sudo apt update python3

# CORRECT - use && to chain commands properly
sudo apt update && sudo apt install python3

# Or run them separately
sudo apt update
sudo apt install python3

The && operator ensures the second command only runs if the first succeeds. Never use other special characters like $$ instead of &&.

3Fix scripts with proper escaping

If you're using apt update in a shell script, ensure proper escaping and shebang:

bash
#!/bin/bash
# Ensure shebang is present at the very top

# Properly quote arguments if any
apt update

# Chain multiple apt commands correctly
apt update && apt upgrade -y && apt install -y package-name

Common script issues:
- Missing #!/bin/bash shebang at the start
- Incorrectly escaped quotes in command chains
- Mixing tabs and spaces (YAML files especially)
- Hidden characters from copy-paste

4Verify package sources if update fails

After running apt update correctly, verify your package sources are configured:

bash
# List all configured sources
cat /etc/apt/sources.list

# List sources in separate files
ls /etc/apt/sources.list.d/

# Check for syntax errors in sources
apt-get check

If you see network errors or missing sources, you may need to:
- Add Ubuntu universe/multiverse repos: sudo apt-add-repository universe
- Update your sources.list file if it's misconfigured

Advanced notes

Understanding apt's command structure helps avoid this error. The apt command has three main categories:

1. Index operations: apt update (no arguments)
2. Package operations: apt install, apt remove, apt upgrade (take package names)
3. System operations: apt clean, apt autoclean, apt autoremove (no package arguments)

In shell scripts, always verify command chaining syntax. The && operator passes the exit status, while ;" runs commands unconditionally. For example: - apt update && apt install pkg - only installs if update succeeds - apt update ; apt install pkg` - installs regardless of update status

Docker users frequently encounter this when running apt commands in RUN instructions. Each RUN layer should be a complete, valid command sequence:

dockerfile
# BAD - update and install in one layer but wrong syntax
RUN apt update python3

# GOOD - properly chain update and install
RUN apt update && apt install -y python3

Frequently asked questions

What does "E: The update command takes no arguments" mean?
The apt update (or apt-get update) command is used to refresh the package index from configured software repositories. Unlike apt install or apt upgrade, the update command doesn't operate on packages themselves—it only synchronizes your local package list with remote repositories. When you pass arguments to apt update, it rejects them because the command is designed to update the entire index without package-specific targets.
How do I fix "E: The update command takes no arguments"?
The apt update command doesn't accept any arguments. This error occurs when you accidentally pass package names, file paths, or other parameters to apt update, which is a package index refresh command.
What causes "E: The update command takes no arguments"?
Passing package names to apt update (e.g., apt update python3) Attempting to pass file paths to apt update Copy-pasting command chains incorrectly without proper separators
Is the "E: The update command takes no arguments" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading