Installs, updates, repositories and the file system

Learning outcomes:

  • Able to install and update a server and needed applications
  • Able to explain how a repo works and why we have them
  • Able to describe what the default configurations and file systems for some basic setups

Would you like to download my PowerPoint to follow along?

  • Permission Review
    • Directory access
      • X for directories will allow us to control who can go inside the directory, R would be to read contents of directory
      • An example of use case might be for things such as hiding directories on websites
    • File permission
      • Owner, Group, World
      • Read, Write, Execute (RWX)
      • chmod using octal (0-7) or +rwx
    • Hidden files (.hiddenFile)
    • What it means when ls -l shows characters at beginning of line
      • Files start with "-"
      • Directories start with d
      • Symbolic links start with l
  • File access Commands
    • Chmod - change file permissions
    • Chown - change file owner/group
    • Chgrp - Regular users can change group membership of a file
  • Repositories
    • What is a Repository (repo)
      • A way to collect and organize software
      • Also known as a way to collect packages
      • Personal Package Archive (PPA)
      • Source of software compatible with your system
    • Why do we have them
      • Easy way to organize software
      • Can split software by version, or kernel, etc.
      • Helps keep you using compatible software
      • Can also host OS updates
    • Some common repos you might see and use
      • Standard and non-standard repositories
        • Standard comes with the machine (should work without issue)
        • Non-standard must be added separately (Who knows?)
      • Ubuntu has some extras/different vocab
        • Universe (community maintained and open source)
        • Multiverse (Restricted by copyright/legal)
        • Main repository - supported programs
        • Restricted - propriety, may include device drivers
    • How to add a repository (needs sudo)
      • CentOS https://wiki.centos.org/AdditionalResources/Repositories
      • OpenSuse - zypper addrepo
      • Mandriva - urpmi.addmedia
      • Debian or Ubuntu - open and edit "/etc/apt/sources.list"
      • Fedora -"/etc/yum.repos.d/"
  • Repository Safety
    • Adding unknown repositories represent a safety risk because they can install things on your system and update/change your OS
    • Equivalent of saying yes please give randomprogram full admin rights
    • Do you trust the person hosting the repo/PPA?
    • How many people have (safely) used this repo/PPA before you?
    • How up to date is this repo/PPA?
    • Can you troubleshoot when something goes wrong?
    • Is this repo/PPA still in testing, or production ready?
  • Patches, updates and upgrades
    • Testing! Oh so much testing must be done!
    • A patch fixes a critical error generally in a specific spot
    • Update gets the latest version but doesn't install (do this first)
    • Upgrade installs newest version
    • Install package-name installs or updates to latest version
    • Server Admins usually test updates and patches before sending them company wide
      • Windows Patch Tuesday disasters
      • Can break your system and be incompatible with programs you have installed
      • Not unheard of for patches/updates to cripple a system
    • There are many resources with examples on how to do installs at the command prompt such as Example 1 Example 2 and Example 3
  • System Files and special files
    • / The directory called “root.” It is the starting point for the file system hierarchy.
      • NOTE: that this is not related to the root, or superuser, account. root tree does not imply physical location parts of the tree can be on different partitions and even separate devices (within the network sort of like onedrive)
    • /bin Binaries and other executable programs
    • /etc System configuration files
    • /home Home directories of users
    • /opt Optional or third party software
    • /tmp Temporary space, typically cleared on reboot
    • /usr User related programs
    • /usr/bin and /usr/sbin (for admins)
    • /var Variable data, web sites (webroot) and log files which can include apt
    • Special Files
      • /dev/null
        • Immediately discards info and returns end of file (EOF)
        • Also known as bit-bucket or blackhole
        • > /dev/null 2>&1 can be used to dump everything to /dev/null not just stout
      • /proc
        • Illusionary filesystem in memory, Kind of like task manager
        • Has some good use cases

Suggested Activities and Discussion Topics:

  • On your own server, Make a bunch of files and folders, then try to create a group, add a user to the system then add the user to your group. Make sure to check the user can login. Now try each of the chmod, chgrp, chown commands
  • On both of your servers, go find the system files and special files and make note of thier location and if they have any differences to the list above, such as name, location, or function.
  • Try creating a script for your server to Backup using tar (Adrianna's video on how to use tar).
  • Go through both of your servers and make notes on What repositories are already on your system, where you found your list of repositories, and why you might want to add a repository to your system
  • Try creating a script to monitor disk activity on your system for all users and another for some users.

Would you like to see some more classes? Click here