ubuntu bash._如何将Windows Bash Shell更新到Ubuntu 16.04

ubuntu bash.

ubuntu bash.

Starting with the Windows 10 Creators Update, anyone who installs the Bash environment will get Ubuntu 16.04 (Xenial). But, if you’ve previously installed Bash in the Anniversary Update, you’ll be stuck with Ubuntu 14.04 (Trusty) until you manually upgrade.

Windows 10 Creators Update开始,安装Bash环境的任何人都将获得Ubuntu 16.04(Xenial) 。 但是,如果您以前在周年更新中安装了Bash ,则手动升级之前,您将一直受Ubuntu 14.04(Trusty)的困扰。

Ubuntu 16.04 contains more modern, up-to-date software packages. Ubuntu 14.04 was originally released in April, 2014, while Ubuntu 16.04 was released in April, 2016.

Ubuntu 16.04包含更现代的最新软件包。 Ubuntu 14.04最初于2014年4月发布,而Ubuntu 16.04则于2016年4月发布。

Update: Starting with the Fall Creators Update, Linux distributions are now delivered via the Store. If you previously installed the Ubuntu Bash environment, just open the Microsoft Store, search for “Ubuntu”, and install it to get the latest version.

更新:从Fall Creators Update开始,现在通过商店提供Linux发行版。 如果您以前安装过Ubuntu Bash环境,则只需打开Microsoft Store,搜索“ Ubuntu”,然后安装它以获取最新版本。

如何检查您拥有的Ubuntu版本 (How to Check Which Version of Ubuntu You Have)

If you’re not sure which version of Ubuntu is being used in your current Bash environment, open a Bash window and run the following command:

如果不确定当前的Bash环境中正在使用哪个版本的Ubuntu,请打开一个Bash窗口并运行以下命令:

lsb_release -a

It’ll show you whether you’re running Ubuntu 14.04 or Ubuntu 16.04. If you’re running Ubuntu 14.04 and want to upgrade, read on. But ensure you have the Creators Update installed: You can’t upgrade to Ubuntu 16.04 LTS without upgrading to the Creators Update first.

它将显示您正在运行Ubuntu 14.04还是Ubuntu 16.04。 如果您正在运行Ubuntu 14.04,并且想要升级,请继续阅读。 但是请确保已安装了Creators Update:如果不先升级到Creators Update,就无法升级到Ubuntu 16.04 LTS。

选项一:使用lxrun卸载并重新安装Bash (Option One: Uninstall and Reinstall Bash With lxrun)

If you don’t care about any customizations you’ve made to your bash environment (or you’re prepared to customize it again), you don’t have to worry about performing an Ubuntu upgrade. You can simply remove your current Ubuntu image and then tell Windows to reinstall a new Ubuntu image. This is the fastest way to upgrade your Bash environment.

如果您不关心对bash环境进行的任何自定义(或准备再次自定义它),则不必担心执行Ubuntu升级。 您可以简单地删除当前的Ubuntu映像,然后告诉Windows重新安装新的Ubuntu映像。 这是升级Bash环境的最快方法。

To do this, first open a Command Prompt window by right-clicking the Start button or pressing Windows+X on your keyboard and selecting “Command Prompt”. Run the following command to uninstall the Bash shell. This will keep your Linux user account’s files and preferences, but will erase the system files, including any installed programs and system-level settings changes.

为此,首先通过右键单击“开始”按钮或按键盘上的Windows + X并选择“命令提示符”,打开“命令提示符”窗口。 运行以下命令来卸载Bash shell。 这将保留您Linux用户帐户的文件和首选项,但会删除系统文件,包括所有已安装的程序和系统级设置更改。

lxrun /uninstall

Type y to continue and Windows will uninstall the Ubuntu 14.04 Bash environment.

键入y继续,Windows将卸载Ubuntu 14.04 Bash环境。

Your Bash system files are now removed. To reinstall Bash—which will give you Ubuntu 16.04 instead of Ubuntu 14.04—run the following command:

您的Bash系统文件现在已删除。 要重新安装Bash(它将为您提供Ubuntu 16.04而不是Ubuntu 14.04),请运行以下命令:

lxrun /install

Type y to continue and Windows will install the Ubuntu 16.04 Bash environment. Windows will automatically suggest you use the same username you used previously. You’ll be asked to enter a password after.

键入y继续,Windows将安装Ubuntu 16.04 Bash环境。 Windows会自动建议您使用以前使用的相同用户名。 之后,系统会要求您输入密码。

When it’s done, run the lsb_release -a command once again and you’ll see you’re now using Ubuntu 16.04. You have access to the newer software available in Ubuntu 16.04’s package repositories.

完成后,再次运行lsb_release -a命令,您将看到您正在使用Ubuntu 16.04。 您可以访问Ubuntu 16.04的软件包存储库中提供的较新软件。

选项二:使用do-release-upgrade升级Ubuntu (Option Two: Upgrade Ubuntu With do-release-upgrade)

If you’ve customized your Bash environment and installed software, you may not want to completely erase everything. In this case, you can perform an upgrade command from within the Bash shell. This will upgrade Ubuntu from version 14.04 to 16.04, just like you’d upgrade a full Ubuntu environment to a new release. However, this will take longer than simply removing and reinstalling the Bash files.

如果您已自定义Bash环境并安装了软件,则可能不想完全擦除所有内容。 在这种情况下,您可以在Bash Shell中执行升级命令。 这会将Ubuntu从14.04版本升级到16.04,就像您将完整的Ubuntu环境升级到新版本一样。 但是,这将比简单地删除并重新安装Bash文件花费更多的时间。

To do this, open the Bash shell and run the following command:

为此,请打开Bash shell并运行以下命令:

sudo do-release-upgrade

This is the process officially recommended by Microsoft.

这是Microsoft官方推荐的过程。

翻译自: https://www.howtogeek.com/278152/how-to-update-the-windows-bash-shell/

ubuntu bash.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值