Linux Basics: Managing Packages with apt
Debian and Ubuntu use apt to find and manage software packages. Start by checking a package’s details before installing it. Use a disposable Debian or Ubuntu VM for practice.
Search and inspect
apt search nano
apt show nanosearch finds matching packages. show displays details for a package, including its description and dependencies. These commands do not install anything.
If Nano cannot be found, run sudo apt update, then try again.
Refresh and install
When you want to install the Nano text editor, run:
sudo apt update
sudo apt install nanoupdate refreshes package information from your configured repositories. It does not upgrade installed software. install installs the named package and any required dependencies.
sudo runs the command with administrator privileges. It may ask for your password; the terminal normally shows no characters while you type. Your account must have permission to use it.
Review the package list and disk-space changes before confirming installation.
Check available updates
apt list --upgradableTo apply available package upgrades, run sudo apt upgrade and review its proposed changes. This updates packages within your configured release; it is not a Debian or Ubuntu release upgrade.
Remove a package
If you installed Nano only for practice and no longer need it:
sudo apt remove nanoCheck the proposed removals before confirming. remove normally leaves package configuration files behind. purge removes those configuration files too, but neither is intended to clean up files in your home directory.
Reference
Acknowledgements
This post was created with assistance from AI.
Linux Basics — lesson 20 of 25. Series index
Previous: Inspecting Network Addresses and Ports · Next: Quoting Text and Matching Filenames