Skip to content

Chapter 6 of 7

Networking and Package Management

Linux distributions ship with package managers that handle installing, updating, and removing software. On Debian-based systems such as Ubuntu, apt update refreshes the local index of available packages, and apt upgrade applies updates to what is already installed. New software is installed with sudo apt install package, while apt remove uninstalls it and apt autoremove cleans up orphaned dependencies. On RPM-based systems like Fedora, the equivalent tools are dnf (and the older yum); dnf install package adds software and dnf update brings the system up to date.

For network diagnostics and remote access, the CLI provides a rich toolkit. ping host sends ICMP echo requests to verify connectivity, with -c 4 limiting the test to four packets. To log into another machine, ssh user@host opens a secure encrypted shell session; the -p flag selects a non-standard port. For ad-hoc network configuration inspection, ifconfig (legacy) and ip addr (modern) display interface names, IP addresses, and link status.

Downloading files and interacting with web services from the terminal is straightforward. wget URL retrieves a file directly, with -r enabling recursive downloads and -O specifying a custom output filename. curl URL is similar but more flexible, often used to call APIs with flags like -X POST to send data and -O to save the response to a file. When troubleshooting, the which command utility is handy for finding the full path of any executable in your PATH, helping you understand which version of a tool the shell will actually invoke.

All chapters
  1. 1Introduction to the Linux Command Line
  2. 2Navigating and Managing the Filesystem
  3. 3Inspecting and Editing Files
  4. 4Permissions, Searching, and Data Flow
  5. 5Processes, Resources, and Shell Customization
  6. 6Networking and Package Management
  7. 7Archiving, Compression, and Automation

Drill it

Reading is not remembering. These come from the Linux Command Line deck:

Q

What is the Linux command line interface (CLI)?

The Linux CLI is a text-based interface for interacting with the operating system using commands entered via a terminal emulator, allowing users to perform task...

Q

What is a shell in Linux?

A shell is a program that interprets commands entered into the CLI, processes them, and communicates with the kernel; common shells include Bash (Bourne Again S...

Q

How do you open a terminal in Linux?

Use keyboard shortcuts like Ctrl+Alt+T on Ubuntu or search for 'Terminal' in the applications menu; it launches a shell session for command execution.

Q

What does the <code>pwd</code> command do?

The pwd (Print Working Directory) command displays the absolute path of the current working directory, helping users confirm their location in the filesystem.