microsoft / microsoft/winget-cli

WinGet not installing the actual package when it has a dependency, and tries to install the dependency itself even though it is already present

Open
#4,679 17 comments 18 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Command-Upgrade Dependencies Issue-Bug
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Brief description of your issue

So I'm trying to update the package yt-dlp.

I type out the command winget upgrade yt-dlp.yt-dlp. WinGet will indicate that the package has a dependency on Gyan.FFmeg. That's alright, I already have it and I have the latest version too. The first thing winget does is download FFmpeg again and installs it, and after it does that, it "forgets" that its supposed to update yt-dlp in the first place and what's worse is that it messes up the environment variables, making me unable to access ffmpeg itself.

So at the time of writing, the latest version of Gyan.FFmpeg is 7.0.1 and for yt-dlp.yt-dlp, it is 2024.07.25. I was trying to upgrade from version 2024.05.27. This is how the output looked like:

Found yt-dlp [yt-dlp.yt-dlp] Version 2024.07.25
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
This package requires the following dependencies:
  - Packages
      Gyan.FFmpeg
(1/1) Found FFmpeg [Gyan.FFmpeg] Version 7.0.1
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://github.com/GyanD/codexffmpeg/releases/download/7.0.1/ffmpeg-7.0.1-full_build.zip
  ██████████████████████████████   162 MB /  162 MB
Successfully verified installer hash
Extracting archive...
Successfully extracted archive

C:\Users\(username)>ffmpeg
'ffmpeg' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\(username)>yt-dlp --version
2024.05.27

So the only way to go about installing this manually is by first removing yt-dlp and installing it again like:

Found yt-dlp [yt-dlp.yt-dlp]
Starting package uninstall...
Successfully uninstalled

C:\Users\(username)>winget install yt-dlp
Found yt-dlp [yt-dlp.yt-dlp] Version 2024.07.25
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
This package requires the following dependencies:
  - Packages
      Gyan.FFmpeg
(1/1) Found FFmpeg [Gyan.FFmpeg] Version 7.0.1
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Successfully verified installer hash
Extracting archive...
Successfully extracted archive
Starting package install...
Command line alias added: "ffmpeg"
Command line alias added: "ffplay"
Command line alias added: "ffprobe"
Successfully installed

Downloading https://github.com/yt-dlp/yt-dlp/releases/download/2024.07.25/yt-dlp.exe
  ██████████████████████████████  18.2 MB / 18.2 MB
Successfully verified installer hash
Starting package install...
Path environment variable modified; restart your shell to use the new value.
Command line alias added: "yt-dlp"
Successfully installed

So now, after restarting the terminal, yt-dlp now works fine but ffmpeg is still not recognised:

2024.07.25

C:\Users\(username)>ffmpeg
'ffmpeg' is not recognized as an internal or external command,
operable program or batch file. 

So now I try to install FFmpeg again and

Found FFmpeg [Gyan.FFmpeg] Version 7.0.1
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Successfully verified installer hash
Extracting archive...
Successfully extracted archive
Starting package install...
Command line alias added: "ffmpeg"
Command line alias added: "ffplay"
Command line alias added: "ffprobe"
Successfully installed

Restarted terminal and still no ffmpeg in sight:

'ffmpeg' is not recognized as an internal or external command,
operable program or batch file.

So now I remove ffmpeg and install it again:

Found FFmpeg [Gyan.FFmpeg]
Starting package uninstall...
Successfully uninstalled

C:\Users\(username)>winget install ffmpeg
Found FFmpeg [Gyan.FFmpeg] Version 7.0.1
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Successfully verified installer hash
Extracting archive...
Successfully extracted archive
Starting package install...
Path environment variable modified; restart your shell to use the new value.
Command line alias added: "ffmpeg"
Command line alias added: "ffplay"
Command line alias added: "ffprobe"
Successfully installed

FINALLY on restarting I can now use FFmpeg again:

ffmpeg version 7.0.1-full_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 13.2.0 (Rev5, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libxevd --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxeve --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d12va --enable-ffnvcodec --enable-libvpl --enable-nvdec --enable-nvenc --enable-vaapi --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100
Universal media converter
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

All that to just update a package that has a dependency 😬

Steps to reproduce
  • Have both FFmpeg and yt-dlp installed. FFmpeg version does not matter but yt-dlp should not be up to date.
  • Try to update yt-dlp using the command winget upgrade yt-dlp
Expected behavior

I expected it to only update yt-dlp without trying to modify FFmpeg which is already present.

Actual behavior

Winget tries to re-install FFmpeg, messees it up, then I need to remove yt-dlp and install it, then remove FFmpeg and install it, just to get both packages working.

Environment
winget --info
Windows Package Manager v1.8.1911
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19045.4717
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.23.1911.0

Winget Directories
-----------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Diag…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\sett…
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                %USERPROFILE%\Downloads

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
ProxyCommandLineOptions                   Disabled
DefaultProxy                              Disabled

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the upgrade path with winget upgrade yt-dlp on the reported WinGet 1.8.1911 environment, then trace the CLI's dependency handling and portable package/PATH behavior for Gyan.FFmpeg. Done means upgrading yt-dlp without reinstalling an already-present FFmpeg dependency or breaking its command availability.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.