我正在尝试 Windows 10 的新 bash 功能,在尝试安装 Postgresql 时遇到了一些问题。我尝试过 apt-get update、apt-get upgrade init-system-helpers、apt-get autoremove,但仍然出现相同的错误。我对命令行还不太熟悉,所以请多多包涵。如能得到任何帮助,我将不胜感激。
bill@ME-PC:/mnt/c/Users/Me$ sudo apt-get install postgresql-common
[sudo] password for bill:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help resolve the situation:
The following packages have unmet dependencies:
postgresql-common : Depends: init-system-helpers (>= 1.18~) but 1.14 is to be installed
E: Unable to correct problems, you have held broken packages.
bill@ME-PC:/mnt/c/Users/Me$
答案1
目前(2017 年 10 月),WSL 运行 Ubuntu 16.04.3 LTS,安装正常。
要检查你正在运行的 Ubuntu 版本,你可以运行以下命令
$ lsb-release -d
如果你有旧版本,你可以使用以下方式升级发行版
do-release-upgrade
$ sudo do-release-upgrade
另外,你可以从计算机上卸载 WSL,然后下载新的Windows 商店中的 Ubuntu您可以在 Windows 中运行以下命令来卸载 WSL
C:\> lxrun /uninstall /full /y
然后重新安装,使用相同的
lxrun
C:\> lxrun /install