upgradeddev

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


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?


Solution

  • 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 -a ddev to find out what's out there and 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

    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

    # Add DDEV’s GPG key to your keyring
    sudo sh -c 'echo ""'
    sudo apt update && sudo apt install -y curl
    sudo install -m 0755 -d /etc/apt/keyrings
    curl -fsSL https://pkg.ddev.com/apt/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/ddev.gpg > /dev/null
    sudo chmod a+r /etc/apt/keyrings/ddev.gpg
    
    # Add DDEV releases to your package repository
    sudo sh -c 'echo ""'
    echo "deb [signed-by=/etc/apt/keyrings/ddev.gpg] https://pkg.ddev.com/apt/ * *" | sudo tee /etc/apt/sources.list.d/ddev.list >/dev/null
    
    # Update package information and install DDEV
    sudo sh -c 'echo ""'
    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.

    When using WSL2, 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 an admin PowerShell, choco install -y ddev.