Bash on Windows various configurations

Source: Internet
Author: User

Tag: Class causes span SOP Targe Doc Ted Update rest

Original article, originally published in Szhshp, the Third Frontier Research Institute, reproduced please specify

Installation

PowerShell Inside execution

    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Restart your computer

Configure Apt-get source File Rename Backup
sudo mv /etc/apt/sources.list /etc/apt/source.list.bak
Edit Source List File
sudo vim /etc/apt/sources.list

Use the following content

(Note that this is only for the Ubuntu16.04 version, you should install the default is this version)

Deb http:Mirrors.aliyun.com/ubuntu/xenial main restricted Universe Multiversedeb http:Mirrors.aliyun.com/ubuntu/xenial-security main restricted Universe Multiversedeb http:Mirrors.aliyun.com/ubuntu/xenial-updates main restricted Universe Multiversedeb http:Mirrors.aliyun.com/ubuntu/xenial-backports Main restricted Universe multiverse# #测试版源deb http:mirrors.aliyun.com/ubuntu/xenial-proposed Main restricted Universe multiverse# source Deb-src http://mirrors.aliyun.com/ubuntu/xenial main restricted universe MULTIVERSEDEB-SRC http:// Mirrors.aliyun.com/ubuntu/xenial-security main restricted Universe multiversedeb-src http://mirrors.aliyun.com/ Ubuntu/xenial-updates main restricted Universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ Xenial-backports main restricted universe Multiverse# #测试版源deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe Multiverse# Canonical Partner and additional Deb http://archive.canonical.com/ubuntu /xenial partnerdeb http://extras.ubuntu.com/ubuntu/xenial main         

Then bash updates:

sudo apt-get updatesudo apt-get upgrade
Zsh

Zsh's installation is a cliché.

Simple installation Read this article directly

Of course, OH-MY-ZSH will be installed together.

Cannot use zsh as default shell

This part is not the same as the setup of the pure Ubuntu system

After installing ZSH, first look at your current shell

echo $SHELL 

It should show

/bin/bash

After all, with a variety of methods to switch unsuccessful, according to the relevant issue, this time should edit this file:

vi ~/.bashrc

At the end of this file, add

bash -c zsh

So we can get into zsh automatically.

Autojump_chpwd:4:nice (5) Failed:operation not permitted

This is a very strange question, according to the related issue, zsh want to adjust the priority of the process, so the error caused

Need to .bashrc add a sentence at the end of the document

unsetopt BG_NICE

Then restart Bash to fix the problem

Feels like it's not that easy to configure.

Reference documents
    • Https://docs.microsoft.com/en-us/windows/wsl/install-win10
    • Https://www.cnblogs.com/gabin/p/6519352.html
    • Https://www.cnblogs.com/seayxu/p/5568830.html
    • https://github.com/Microsoft/WSL/issues/1887

Bash on Windows various configurations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.