Using apt-get Commands in Ubuntu

A summary for Ubuntu beginners

References: It's FOSSarrow-up-right, ttend.tistory.comarrow-up-right

What is apt-get ?

  • Ubuntu is an operating system derived from Debian Linux

    • Ubuntu's core utilities come from Debian!

  • Debian uses the dpkg packaging system

    • What is a packaging system?

      • One of the methods for installing and maintaining software on a system

      • Using a packaging system means you don't need to receive the source code and build the program yourself!

      • Linux has the Debian family which uses deb packages and the RedHat family (.rpm) which uses rpm packages

        • Debian family

          : Debian, Ubuntu, Linspire, Xandros

        • RedHat family

          : Fedora, CentOS, RHEL, openSUSE, Mandirva

APT (Advanced Package Tool)

  • A command line tool for interacting with the packaging system

    • You can also use the dpkg command, but apt is more user-friendly for handling packages!

  • You can install, upgrade, and clean packages with apt

  • It is a high level tool

High Level & Low Level Tool

Low level package tool

  • Manages the tasks of installing and removing package files

    • ex) dpkg for Debian family, rpm for RedHat family

High level package tool

  • Manages metadata search and dependency resolution tasks

Main Tools of APT

: The main tools of apt are apt-get and apt-cache

apt-get

  • Used to install, upgrade, and clean packages

apt-cache

  • Used to find new packages

Using apt-get commands

Updating packages with apt-get

Command

Result

  • Hit

    • Means there is no change in the package version

  • Ign

    • Means the package was ignored

      • There can be various reasons

        • ex)

          • When it is so up-to-date that there is no need to check for a newer version

          • When an error occurred while searching for the package but it was a minor error so it was ignored

            • In conclusion, it is not an error so no need to worry!

  • Get

    • When there is a new version of the package, apt-get downloads that information

      • The new version information, not the package itself!

Upgrading packages with apt-get

  • Once you have an updated package database through $ sudo apt-get update, you can now upgrade the packages

Command

Upgrade all packages

  • Adding -y at the end means you don't need to separately type y when asked whether to upgrade

Upgrade a specific package

Result

Using apt-cache commands

Searching for packages with apt-cache

  • Useful for finding specific libraries

Command

When you know the exact package name

When searching for packages starting with a specific name

Result

Last updated