Day 4 - Installing software, exploring the file structure
INTRO
As a sysadmin, one of your key tasks is to install new software as required. You’ll also need to be very familiar with the layout of the standard directories in a Linux system.
You’ll be getting practice in both of these areas in today’s session.
YOUR TASKS TODAY
- Install a new application from the online repositories
- Become familiar with some of the standard directories
- Look at the format and content of some configuration files.
If you’ve used a smartphone “app store ” or “market”, then you’ll immediately understand the normal installation of Linux software from the standard repositories. As long as we know what the name or description of a package (=app) is, then we can search for it:
apt search "midnight commander"
This will show a range of matching “packages”, and we can then install them with apt install
command. So to install package mc
(Midnight Commander) on Ubuntu:
sudo apt install mc
(Unless you’re already logged in as the root
user you need to use sudo
before the installation commands - because an ordinary user is not permitted to install software that could impact a whole server).
Now that you have mc
installed, start it by simply typing mc
and pressing Enter.
This isn’t a “classic” Unix application, but once you get over the retro interface you should find navigation fairly easy, so go looking for these directories:
/root
/home
/sbin
/etc
/var/log
…and use the links in the Resources section below to begin to understand how these are used. You can also read the official manual on this hierarchy by typing man hier
.
Most key configuration files are kept under /etc
and subdirectories of that. These files, and the logs under /var/log
are almost invariably simple text files. In the coming days you’ll be spending a lot of time with these - but for now simply use F3 to look into their contents.
Some interesting files to look at are: /etc/passwd
, /etc/ssh/sshd_config
and /var/log/auth.log
Use F3 again to exit from viewing a file.
F10 will exit mc
, although you may need to use your mouse to select it.
(On an Apple Mac in Terminal, you may need to use ESC+3 to get F3 and ESC+0 for F10)
Now use apt search
to search for and install some more packages: Try searching for “hangman”. You will probably find that an old text-based version is included in a package called bsdgames
. Install and play a couple of rounds…
Posting your progress
- Post your progress, comments and questions to the forum.
EXTENSION
- Use
mc
to view/etc/apt/sources.list.d/ubuntu.sources
where the actual locations of the repositories are specified. Often these will be “mirror” sites that are closer to your server than the main Ubuntu servers. - Read Repositories - CommandLine for more of the gory details.
RESOURCES
- Difference Between apt and apt-get Explained
- DNF vs APT: Similarities and Differences Analyzed!
- Ubuntu Server Guide - Package Management
- Midnight Commander vs Ranger
- Linux directory system explained
Some rights reserved. Check the license terms here