iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🐧

WSL Development Environment: Installing Essential Packages on Debian

に公開

Introduction

When building a development environment on WSL (Windows Subsystem for Linux), it is important to install the necessary basic packages.
In this article, I will explain in detail the essential basic packages required for a Debian environment on WSL.

I also provide a script to install these basic packages all at once.
By using this script, you can reduce the time and effort spent on program installation and environment configuration, allowing you to focus more on development.

Key Terms

Here are the key terms used in this article.

  • WSL (Windows Subsystem for Linux):
    A platform that allows you to run a Linux environment on Windows.

  • APT:
    A tool widely used in Debian-based distributions to manage the installation, updating, and removal of software packages.

1. What is a Package?

1.1 Package Basics

A package bundles software and configuration files together to make their management and distribution more efficient.
Packages allow for automatic dependency resolution and bulk updates.
When you install a specific package, related packages are installed automatically, so you don't need to install everything manually.

1.2 Packages and Package Managers

To manage packages, we use software called a package manager.

A package manager is a tool that simplifies and streamlines software management, such as installing, updating, and removing these packages.

2. Packages to Install

2.1 Package List

I have listed the packages to be installed and the reasons for their selection by category.

Archivers

An archiver is a tool that compresses and stores files and directories into a single file. This makes file management and data distribution easier.

Package Name Description Reason for Selection
zip Creating and extracting ZIP format archive files Essential because it is widely used for extracting files distributed on the web
7zip Creating and extracting 7z format archive files A format characterized by high compression rates, which is effective for data transfer

File Download

These provide the functionality to download files from the internet to your PC.

Package Name Description Reason for Selection
curl Downloading files from the web Used in one-liners for executing web-based installers
wget Downloading files from the web Used when saving files locally

Development Tools

This is a collection of tools used in general programming, such as version control and Make.

Package Name Description Reason for Selection
vim Text editor A powerful and versatile text editor widely used for programming
make Build automation tool A standard build tool
git Version control system The standard tool for code management
gawk Interpreter for the AWK language AWK is widely used in UNIX/Linux scripting

Utilities

Package Name Description Reason for Selection
binutils Binary file manipulation utilities Used for commands provided by the package in scripts
file Identifies the type of a specified file Used for the file command in scripts
tree Displays directory trees Used when creating Zenn entries
man Displays man pages The man command is standard for the OS

2.2 How to Install Packages

The following script is for installing basic packages in bulk.
By using this script, you can install the necessary packages easily and quickly.
Follow the steps below to save and run the script.

  1. Create a script file installscripts.sh.

  2. Save the script
    Copy and paste the following script and save it to the script file.

    installscripts.sh
    #!/usr/bin/env bash
    pkgs="
     zip
     7zip
     curl
     wget
     vim
     make
     git
     gawk
     binutils
     file
     tree
     man
     "
    
     for p in $pkgs; do
       sudo /usr/bin/apt install -y $p
     done
    
    
  3. Execute the script
    Run the installation script with the following command:

    . ./installscripts.sh
    

By following the steps above, you can install basic packages all at once.

Conclusion

In this article, I introduced the essential packages used when building a development environment on Debian on WSL.
Let's build an efficient development environment on WSL by utilizing the tools introduced in this article.

Happy Hacking!

References

Websites

GitHubで編集を提案

Discussion