Install Windows Terminal using Windows package management software Chocolatey

TL; DR

Execute in PowerShell (Administrator)

 Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient). DownloadString(' https://chocolatey.org/install.ps1 ')) choco install microsoft-windows-terminal

 Windows Terminal for WSL

**Want to see more pieces of reading? ↓**

introduction

For a long time, our development environment has been using * nix/Linux systems, such as macOS or Ubuntu. There is no reason for that. In fact, it is "lazy".

*There is an excellent package management system and its community on nix/Linux. You only need one command to install most software. As far as I know, the reason why many people insist on using arch Linux is AUR.

The following is an example of packet management on macOS:

If you want to install a Nginx+Mariadb+Python 3 development environment, you only need one line of command:

 brew install nginx mariadb python3

Can eliminate the need for

  • Go to the official websites to download the compiled version and install it
  • Self configuring each software
  • Configure PATH variable

A series of unfriendly processes will take hours.

If you have compiled and installed some software by yourself, the process will be more complicated.

Life is short, save yourself time and do something meaningful.

What is package management?

You can make this simple understanding:

For users, package management is like a computer version of the App Store, but the app store is free and open enough.

At the same time, package management is like a reference answer for software installation. Almost all commonly used command line software can be installed through package management. When predecessors have written the answer for you, you can copy it.

A software installation goes through many steps. We use the simple command line software curl as an example:

  • Go to curl's official website to download the latest version of source code
  • Set some parameters to check the dependent environment
  • Install with Makefile

Package management is to help you with this complex process. For you, you only need to execute one line of commands

 brew install curl

The commands HomeBrew executes for you can be seen in the github repository homebrew core.

https://github.com/Homebrew/homebrew-core/blob/master/Formula/curl.rb

Let's take a look at this Ruby code

 class Curl < Formula desc "Get a file from an HTTP,  HTTPS or FTP server" homepage " https://curl.haxx.se/ " #Introduction to App url " https://curl.haxx.se/download/curl-7.68.0.tar.bz2 " sha256 "207f54917dd6a2dc733065ccf18d61bb5bebeaceb5df49cd9445483e8623eeb9" #Where to download source code bottle do cellar :any sha256 "2695c7d41931198debef3736002422c036b36a547e4d6d3098184e90b729f571" => :catalina ...... end #Sha256 of precompiled bottom head do url " https://github.com/curl/curl.git " depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build end keg_only :provided_by_macos depends_on "pkg-config" => :build uses_from_macos "openssl" #Dependent environment def install system "./ buildconf" if build.head? args = %W[ --disable-debug --disable-dependency-tracking ...... ] #Parameters of compilation process system "./ configure", *args system "make", "install" system "make", "install", "-C", "scripts" libexec.install "lib/mk-ca-bundle.pl" end #Compile command test do filename = (testpath/"test.tar.gz") ...... end end

In fact, this is a kind of behavior of "planting trees for the past and enjoying the cool for the future". The community discusses the best way to install apps, and package management helps you carry out this tedious process.

But not only the command line, many GUI software can also be installed through the homebrew case.

For example, you can

 brew cask install atom chrome

Wait to install many apps.

And all apps installed through package management can be updated by package management. You only need one line

 brew cask upgrade

Then you can update all the apps installed through the brew case. Is it like an app store.

Back to Windows

The reason why various "package management" on Windows is not so hot may be that the concept of "package" on Windows is not very clear.

In Linux, the configuration is all files. Open the conf file to modify the configuration and parameters you want; Under Windows, the concept of "registry" is adopted, and the concept of Win may not let users access this "Pandora's Box". Every time the registry is edited and modified, it is a big thing.

Although software like MingW can help you move the GUN ecological chain to Windows, installation and software are still troublesome.

The cmd and PowerShell UI that come with Windows always seem to be back to 1998. There is no excellent shell like zsh or fish, and things like "taking pen and forgetting parameters" often happen.

Basically, the thing we do most on Windows is probably games. After all, we seldom use VS without developing client software. But we have to say that VSCode is really popular.

Microsoft has also begun to embrace the open source community in recent years, as can be seen from the Windows Subsystem for Linux.

But I have to say that Microsoft's own terminal is still too retro, and the use experience is unsatisfactory. Then Microsoft launched a new terminal: Windows Terminal

In Github's official introduction, in addition to manual installation, a third-party installation method is also officially specified: Chocolatey

The installation method is also very satisfactory:

 choco install microsoft-windows-terminal

About Chocolate

Chocolatey is a third-party "package management" software on Windows. It uses the Apache protocol and provides a commercial version (individuals/teams can directly use the community version)

In their own words:

The licensing is very business friendly

Installing Chocolate is also very simple. Execute in administrator PowerShell:

 Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient). DownloadString(' https://chocolatey.org/install.ps1 '))

 Install Choco

Then you can install many software including Windows Terminal through Choco

For example, you can:

 choco install adb android-sdk android-ndk jdk8 git python3 googlechrome notepadplusplus

Does it save a lot of trouble in the configuration process, and the unified upgrade management in the future is also very convenient.

Chocolatey's community package is very complete. You can go to their Official website page Find the software you want.

Windows Terminal

Why use Windows Terminal? As mentioned earlier, replace the original hard to use terminal.

After a simple experience, I didn't find many problems. At least it's much better than the default Zhongyi Song typeface.

 Windows Terminal for WSL
 Windows Terminal for PowerShell

Maybe I'm not used to the syntax of PowerShell and a large number of error messages. The last thing I used most was with WSL. However, I was happy to find a good package management during the installation process.

label: macOS Package management choco Windows Chocolatey *nix Linux homebrew


There are 2 comments
  1. It is more convenient to install the MS Store with the "Package Manager" that comes with Windows 10
    https://www.microsoft.com/en-us/p/windows-terminal-preview/9n0dx20hk701

    1. Well, in principle, this article is about outsourcing management. In addition, many other software cannot be installed with MS Store, which is very troublesome (in addition, MS Store cannot be opened for three days in China

Add a new comment