DDEV(Linux/WSL2)已升级,但我仍然看到旧版本。

huangapple go评论62阅读模式
英文:

DDEV (Linux/WSL2) I upgraded but I still see the old version

问题

我的当前 DDEV 安装在 WSL2 Ubuntu 20.04 LTS 上的版本是 v1.16.7。由于我计划开始使用 Drupal 10,所以我需要升级 - 例如,到1.21.4版本。因此,我按照文档中指示的命令进行了升级,但我得到了"ddev 已经是最新版本 (1.21.4)"的消息,没有安装任何新的内容,我仍然保持在v1.16.7版本。我尝试了完整的"curl"命令和所有正常的更新命令,但每次都告诉我一切都正常,ddev 已经是最新版本...然后我仍然有之前的相同版本。我想避免卸载所有内容,这似乎是一个激进的解决方案。关于发生了什么事情,有什么想法吗?

英文:

My current DDEV installation on WSL2 Ubuntu 20.04 LTS is v1.16.7. Since I plan to start using Drupal 10, I need to upgrade -- for example, to 1.21.4. So I issued the commands to upgrade as indicated in the documentation and I get "ddev is already the newest version (1.21.4)", and nothing new is installed, and I still end up having v1.16.7. I tried the full "curl" command and all the normal update commands, but every time it tells me all is well, ddev is already the newest version ... and then I still have the same version as before. I'd like to avoid uninstalling everything, which seems like a drastic solution. Any ideas about what's going on?

答案1

得分: 4

你安装了多个版本的DDEV,需要整理一下。在Linux(WSL2)上,你的$PATH确定了它查找可执行二进制文件的位置。你可以使用echo $PATH查看顺序,也可以使用which ddev来查找它正在使用的版本。(一旦你理解了这一点,你不必做或理解以下内容,但如果需要更多详细信息,可以继续阅读。)

在WSL2上,你可能会有以下版本:

  • /home/linuxbrew/.linuxbrew/bin/ddev(如果你使用homebrew安装)。这可能不在你的$PATH中;有时人们无法正确添加到$PATH中。
  • /usr/local/bin/ddev(如果你使用install_ddev.sh安装)。/usr/local/bin几乎总是在Linux系统的$PATH中。
  • /usr/bin/ddev(如果你使用新的apt install ddev技术安装,这是推荐的方法)。

这三个版本都可以正常工作并得到支持,但我建议你使用新的apt安装方法。

因此,你可以执行以下操作:

brew uninstall ddev
sudo rm -f /home/linuxbrew/.linuxbrew/ddev /usr/local/bin/ddev

这将删除其他版本。

然后,按照文档中的Linux说明操作,并执行以下命令:

curl -fsSL https://apt.fury.io/drud/gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/ddev.gpg > /dev/null
echo "deb [signed-by=/etc/apt/trusted.gpg.d/ddev.gpg] https://apt.fury.io/drud/ * *" | sudo tee /etc/apt/sources.list.d/ddev.list
sudo apt update && sudo apt install -y ddev

这将在/usr/bin/ddev中安装DDEV,它肯定会出现在你的$PATH中。

在WSL2上使用DDEV v1.21.4时,你还需要在Windows侧安装DDEV,以防万一你使用非*.ddev.site主机名,并且DDEV需要在Windows侧更新hosts文件。因此,在管理员PowerShell中,执行choco install -y ddev

英文:

You have more than one version of DDEV installed, and you'll have to sort it out. On Linux (WSL2) your $PATH determines where it looks for executable binaries. You can echo $PATH to see what the order is, and you can which ddev to find out which one it's using. (You don't have to do or understand the below once you understand that, but you can continue for more detail.)

On WSL2 you're likely to have

  • /home/linuxbrew/.linuxbrew/bin/ddev (If you installed with homebrew). That may or may not be in your $PATH; sometimes people don't get it into their $PATH properly.
  • /usr/local/bin/ddev (If you installed with install_ddev.sh). /usr/local/bin is almost always in the $PATH of a Linux system.
  • /usr/bin/ddev (If you installed with the newer apt install ddev technique, which is recommended).

All three of these work fine and are supported, but I recommend that you go with the newer apt install technique.

So you can do this:

brew uninstall ddev
sudo rm -f /home/linuxbrew/.linuxbrew/ddev /usr/local/bin/ddev

That will remove the other ones.

Then follow the Linux instructions in the docs and

curl -fsSL https://apt.fury.io/drud/gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/ddev.gpg > /dev/null
echo "deb [signed-by=/etc/apt/trusted.gpg.d/ddev.gpg] https://apt.fury.io/drud/ * *" | sudo tee /etc/apt/sources.list.d/ddev.list
sudo apt update && sudo apt install -y ddev

That should get you the ddev in /usr/bin/ddev which will certainly be in your $PATH.

On WSL2 with DDEV v1.21.4, you'll want to install DDEV on the Windows side as well, just for the odd case where you use a non-*.ddev.site hostname, and DDEV needs to update the hosts file on the Windows side. So in admin PowerShell, choco install -y ddev.

huangapple
  • 本文由 发表于 2023年1月9日 00:53:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/75049664.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定