0Pricing
Linux Command Line Mastery · レッスン

パッケージ管理(Debian/Ubuntu):`apt`、`dpkg`

`apt`と`dpkg`を使って、Debian系システムのソフトウェアパッケージを管理する方法を学びます。

「パッケージ管理(Debian/Ubuntu):`apt`、`dpkg`」はCoddyKit上の無料Linux Command Line Masteryレッスンです。 これはレッスン2/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはLinux Command Line Mastery学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Linux Command Line Masteryコースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

Intro to Package Management

Welcome to package management! On Linux, software comes in packages. These are archives containing program files, documentation, and metadata.

A package manager is a tool that automates the installation, upgrade, configuration, and removal of software. It handles dependencies, ensuring all necessary components are installed.

`dpkg`: The Core Tool

On Debian-based systems (like Ubuntu), the fundamental tool for managing packages is dpkg. It's a low-level tool that directly interacts with .deb files (Debian package files).

  • dpkg installs, removes, and manages individual .deb packages.
  • It does NOT automatically handle dependencies. If a package needs others, you must install them yourself.

Installing with `dpkg`

To install a .deb file you've downloaded, you use the -i (or --install) option with dpkg.

Remember, if the package has dependencies, dpkg will warn you and the installation might fail or be incomplete until those dependencies are met.

sudo dpkg -i /path/to/your-package.deb

Listing `dpkg` Packages

You can query dpkg to see information about installed packages. The -l (or --list) option shows all installed packages.

You can pipe its output to grep to search for specific packages.

dpkg -l | grep firefox

`apt`: The Smarter Manager

While dpkg handles individual .deb files, apt (Advanced Package Tool) is the user-friendly, high-level front-end. It works with repositories (servers holding many packages).

apt automatically handles dependencies, fetches packages from repositories, and simplifies system-wide updates.

Syncing with `apt update`

Before installing or upgrading, you should always run apt update. This command downloads the latest package information from the configured repositories.

It does NOT install new software or update existing ones, it only updates the list of what's available.

sudo apt update

Installing Apps with `apt install`

To install new software from the repositories, use apt install followed by the package name. apt will resolve and install all necessary dependencies.

You'll be prompted to confirm the installation before it proceeds.

sudo apt install htop

Upgrading Your System

To upgrade all installed packages to their latest available versions (based on your updated package lists), use apt upgrade.

This is crucial for security updates and new features. It's a good practice to run apt update before apt upgrade.

sudo apt upgrade

Removing Packages

When you no longer need a package, you can remove it using apt remove or apt purge.

  • apt remove package_name: Deletes the package but keeps its configuration files.
  • apt purge package_name: Deletes the package AND its configuration files, for a cleaner uninstall.
sudo apt remove libreoffice-writer

Package Management Quiz

You've learned about the two main package management tools on Debian-based systems. Let's test your understanding!

Summary: `apt` & `dpkg`

Great job! You've learned about Debian's powerful package management system:

  • dpkg: The low-level tool for individual .deb files, without dependency resolution.
  • apt: The high-level, user-friendly tool for managing packages from repositories, handling dependencies automatically.

Key apt commands include update, install, upgrade, remove, and purge.

よくある質問

「パッケージ管理(Debian/Ubuntu):`apt`、`dpkg`」レッスンは無料ですか?

はい。「パッケージ管理(Debian/Ubuntu):`apt`、`dpkg`」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Linux Command Line Masteryコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Linux Command Line Masteryコースには全4レッスンが含まれています。

「パッケージ管理(Debian/Ubuntu):`apt`、`dpkg`」で何を学びますか?

`apt`と`dpkg`を使って、Debian系システムのソフトウェアパッケージを管理する方法を学びます。 ブラウザで直接実行するハンズオンコードでLinux Command Line Masteryを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

Linux Command Line Masteryを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのLinux Command Line Masteryは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン2/4です。

「パッケージ管理(Debian/Ubuntu):`apt`、`dpkg`」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このLinux Command Line Masteryレッスンでコードを書いて実行できますか?

はい。すべてのLinux Command Line Masteryレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. アーカイブと圧縮:`tar`、`gzip`、`bzip2`
  2. パッケージ管理(Debian/Ubuntu):`apt`、`dpkg`
  3. パッケージ管理(CentOS/Fedora):`yum`、`dnf`、`rpm`
  4. ソースからのビルド:configure、make、make install
← Linux Command Line Masteryに戻る