Author: Mislav

  • Linux Tutorial Series – 138 – Disks, partitions and filesystems – how do they relate to each other?

    Here is the video version, if you prefer it:

    Today let’s talk about the thing that bothered me for some time. What is a partition exactly? What is a filesystem, exactly? How do they relate to each other?

    Let’s go top-down, from the biggest to the smallest. First, the hardware – the permanent storage devices. There are many permanent storage devices, but let’s focus on the ones most people use in their computer for permanent storage. They can be either hard drives or solid state drives. Permanent storage device is the physical device your data is stored on. Again, the term also includes USB drives, CDs and DVDs, but let’s focus on hard drives and solid state drives. Let’s call them disks.

    Partitions are subdivisions of the whole disk. A disk can, thus, be divided into multiple partitions. Partitions are defined on a small area of the disk called a partition table. (Ward, 2014)⁠

    Every partition has a filesystem. A filesystem is a hierarchy of files and directories you are accustomed to interacting with. A filesystem resembles a database. A great illustration of this is in the figure below, modeled after (Ward, 2014), page 66.

    If we want to access a file, we first consult the partition table to see which partition we need to access. Then after we access that partition, we consult the filesystem database to find the data we are looking for.

    I think this is important to understand conceptually, as there is a lot of confusion between what is a partition and what is a filesystem. I hope this cleared it up.

    Thank you for reading!

    References

    Ward, B. (2014). How Linux Works: What Every Superuser Should Know (2nd ed.). No Starch Press. Pages 66-67

  • Linux Tutorial Series – 137 – Checkpoint

    Here is the video version, if you prefer it:

    Next up, we will talk about devices at a low-level. More specifically, we will talk about how are devices represented in your Linux system, what are links, what is mounting, what is unmounting and some other things related to devices which are not as important, but warrant a quick read.

    This is not really important for your everyday use, but you will almost guaranteed encounter some device-related things (especially if you are a software developer), so it pays to know these things in those moments. And yes, even if you are a regular user, it pays to know these things. So read on. Don’t lose your enthusiasm – you are still learning the fundamental things.

    Talk soon!

  • Linux Tutorial Series – 136 – Review

    Here is the video version, if you prefer it:

    We talked about compression and package management. Here is a review of the most important things:

    • Use gzip fileName and gunzip fileName for archives ending in gz
    • Use tar cvf archiveName.tar file1 file2 … for creating a tar archive file and use tar xvf archiveName.tar to extract a tar archive
    • To update your package list, run apt-get update (prefixed with sudo)
    • apt-get install packageName to install packages from a package repository or dpgk -i packageFileName to install a package from a file
    • sudo apt --purge remove packageName to remove a package, then sudo apt --purge autoremove to remove its dependencies
    • To upgrade your packages, run apt-get upgrade
    • /etc/apt/sources.list keeps a list of repositories Linux looks into when it is searching for new packages

    I hope you refreshed your memory!

  • Linux Tutorial Series – 135.1 – /etc/apt/sources.list

    /etc/apt/sources.list file contains repositories your operating system searches for when it looks for packages.

    So if some tutorial asks you to modify /etc/apt/sources.list, you are modifying (most likely adding) repositories your operating system looks at when it searches for packages.

    Warning: Adding new unknown repositories can be dangerous, because you don’t know what the packages in these repositories contain. Keep this in mind.

    Thank you for reading!

  • Linux Tutorial Series – 135 – Other package operations

    Here is the video version, if you prefer it:

    Besides installing, removing and upgrading packages, there are a lot of things you can do with them – you can list installed packages, determine whether a package was installed, display information about an installed package and find which package installed a file. (Shotts, 2019)⁠ I have never used these functionalities so far, so I will not talk about them. A quick Google search or a look at the reference can give you the answers to these queries, if you ever need to use them.

    Thank you for reading!

    References

    Shotts, W. (2019). The Linux Command Line, Fifth Internet Edition. Retrieved from http://linuxcommand.org/tlcl.php. Pages 202-203

  • Linux Tutorial Series – 134 – Upgrading a package

    Here is the video version, if you prefer it:

    Upgrading your packages means installing newer versions of them. You do so by running: (Shotts, 2019)⁠

    apt-get upgrade

    You do need to prefix it with sudo.

    Hope you learned something useful!

    References

    Shotts, W. (2019). The Linux Command Line, Fifth Internet Edition. Retrieved from http://linuxcommand.org/tlcl.php. Pages 201-202

  • Linux Tutorial Series – 133 – Removing a package

    Here is the video version, if you prefer it:

    Here is how you can remove packages from your computer: (“How can you completely remove a package?,” n.d.)⁠

    sudo apt --purge remove packageName

    Then after that, to remove the dependencies that were just used by that package and aren’t used by any other package anymore:

    sudo apt --purge autoremove

    There may be some configuration files left over, either in the .config directory in your home folder or as a standalone hidden file (which means its filename starts with a .). You have to delete those manually.

    Hope you learned something useful!

    References

    How can you completely remove a package? (n.d.). Retrieved February 11, 2020, from https://askubuntu.com/questions/151941/how-can-you-completely-remove-a-package

  • Linux Tutorial Series – 132 – Installing a package

    Here is the video version, if you prefer it:

    There are two ways to install a package. (Shotts, 2019)⁠ One of them is from a repository:

    apt-get install packageName

    The other is from a file:

    dpgk -i packageFileName

    Hope you learned something useful!

    References

    Shotts, W. (2019). The Linux Command Line, Fifth Internet Edition. Retrieved from http://linuxcommand.org/tlcl.php. Pages 199-200

  • Linux Tutorial Series – 131 – Finding a package

    Here is the video version, if you prefer it:

    To preface this: I personally always use Google to find the packages I need. Either I look for the package name on the distribution website or I am looking for specific packages I need to install for some purpose. I never used the commands that follow so far, but they are useful to know about.

    To find a package you want to install, you can use the following command: (Shotts, 2019)⁠

    apt-cache search query

    An example:

    mislav@mislavovo-racunalo:~/Linux_folder$ apt-cache search zip

    advancecomp - collection of recompression utilities

    node-almond - minimal AMD API implementation for use in optimized browser builds

    amanda-client - Advanced Maryland Automatic Network Disk Archiver (Client)

    amanda-server - Advanced Maryland Automatic Network Disk Archiver (Server)

    You get a list of packages related to your search query.

    You can also use

    apt search query

    for the same purpose.

    Hope you learned something useful!

    References

    Shotts, W. (2019). The Linux Command Line, Fifth Internet Edition. Retrieved from http://linuxcommand.org/tlcl.php. Page 199

  • Linux Tutorial Series – 130 – Updating your package list

    Here is the video version, if you prefer it:

    Before we go into how to install packages and related operations, let’s first establish a rule, if you will: Always run sudo apt-get update before doing any of the operations we will cover (besides removing a package).

    Why is it so? Your operating system has a list of packages. Before installing any packages, it is a good idea to tell the operating system: “OK, operating system. Please check if there are more recent versions of packages available or if there are any new packages available.” (“What does ‘sudo apt-get update’ do?,” n.d.)⁠ You do so with sudo apt-get update. You need superuser permissions to run this command, hence the sudo.

    Again, remember to run this command before any other package manipulation related actions besides removing a package.

    Hope you learned something useful!

    References

    What does “sudo apt-get update” do? (n.d.). Retrieved February 11, 2020, from https://askubuntu.com/questions/222348/what-does-sudo-apt-get-update-do