diff --git a/dvc/utils/__init__.py b/dvc/utils/__init__.py
index cc5e3bd78..82b2b8306 100644
--- a/dvc/utils/__init__.py
+++ b/dvc/utils/__init__.py
@@ -272,45 +272,22 @@ def fix_env(env=None):
     #
     # where
     #
-    #     PYENV_BIN_PATH - might not start with $PYENV_ROOT if we are running
-    #         `system` version of the command, see pyenv-exec source code.
+    #     PYENV_BIN_PATH - starts with $PYENV_ROOT, see pyenv-exec source code.
     #     bin_path - might not start with $PYENV_ROOT as it runs realpath on
-    #         it, but always has `libexec` part in it, see pyenv source code.
+    #         it, see pyenv source code.
     #     plugin_bin - might contain more than 1 entry, which start with
     #         $PYENV_ROOT, see pyenv source code.
     #
-    # Also, we know that whenever pyenv is running, it exports these env vars:
-    #
-    #     PYENV_DIR
-    #     PYENV_HOOK_PATH
-    #     PYENV_VERSION
-    #     PYENV_ROOT
-    #
     # So having this, we can make a rightful assumption about what parts of the
     # PATH we need to remove in order to get the original PATH.
-    path = env.get("PATH", "")
-    parts = path.split(":")
-    bin_path = parts[1] if len(parts) > 2 else ""
-    pyenv_dir = env.get("PYENV_DIR")
-    pyenv_hook_path = env.get("PYENV_HOOK_PATH")
-    pyenv_version = env.get("PYENV_VERSION")
+    path = env.get("PATH")
     pyenv_root = env.get("PYENV_ROOT")
-
-    env_matches = all([pyenv_dir, pyenv_hook_path, pyenv_version, pyenv_root])
-
-    bin_path_matches = os.path.basename(bin_path) == "libexec"
-
-    # NOTE: we don't support pyenv-win
-    if os.name != "nt" and env_matches and bin_path_matches:
+    if path and pyenv_root and path.startswith(pyenv_root):
         # removing PYENV_BIN_PATH and bin_path
-        parts = parts[2:]
-
-        if parts:
-            # removing plugin_bin from the left
-            plugin_bin = os.path.join(pyenv_root, "plugins")
-            while parts[0].startswith(plugin_bin):
-                del parts[0]
-
+        parts = path.split(":")[2:]
+        # removing plugin_bin from the left
+        while pyenv_root in parts[0]:
+            del parts[0]
         env["PATH"] = ":".join(parts)
 
     return env
diff --git a/dvc/version.py b/dvc/version.py
index a700a5dd3..50f268672 100644
--- a/dvc/version.py
+++ b/dvc/version.py
@@ -7,7 +7,7 @@ import os
 import subprocess
 
 
-_BASE_VERSION = "0.61.1"
+_BASE_VERSION = "0.61.0"
 
 
 def _generate_version(base_version):
diff --git a/scripts/build_posix.sh b/scripts/build_posix.sh
index b61a408f8..84ad522b8 100755
--- a/scripts/build_posix.sh
+++ b/scripts/build_posix.sh
@@ -18,6 +18,14 @@ BIN_DIR=$BUILD_DIR/$INSTALL_DIR/bin
 DESC='Data Version Control - datasets, models, and experiments versioning for ML or data science projects'
 LIB_DIR=$BUILD_DIR/$INSTALL_DIR/lib
 
+if [[ "$(uname)" == 'Linux' ]]; then
+	CMPLT_DIR=etc/bash_completion.d
+	FPM_PACKAGE_DIRS="usr etc"
+else
+	CMPLT_DIR=usr/local/etc/bash_completion.d
+	FPM_PACKAGE_DIRS="usr"
+fi
+
 print_error()
 {
 	echo -e "\e[31m$1\e[0m"
@@ -51,7 +59,8 @@ fpm_build()
 	    $FPM_FLAGS \
 	    -n dvc \
 	    -v $VERSION \
-	    -C $BUILD_DIR usr
+	    -C $BUILD_DIR \
+	    $FPM_PACKAGE_DIRS
 }
 
 cleanup()
@@ -106,6 +115,9 @@ build_dvc()
 		popd
 		$BIN_DIR/dvc --help
 	fi
+
+	mkdir -p $BUILD_DIR/$CMPLT_DIR
+	cp scripts/completion/dvc.bash $BUILD_DIR/$CMPLT_DIR/dvc
 }
 
 cleanup

Make completion scripts part of the debian package
**Step 1**
I installed dvc on my Ubuntu 16.04 machine with the following commands:

```
sudo wget https://dvc.org/deb/dvc.list -O /etc/apt/sources.list.d/dvc.list
sudo apt-get update
sudo apt-get install dvc
```

**Step 2**
To enable bash completion I downloaded completion script to /etc/bash_completion.d directory as described in https://dvc.org/doc/user-guide/autocomplete

It would be nice if completion script would be automatically installed with Debian package so step 2 wouldn't be required.
diff --git a/tests/unit/utils/test_utils.py b/tests/unit/utils/test_utils.py
index 5678994d4..01ccd6df5 100644
--- a/tests/unit/utils/test_utils.py
+++ b/tests/unit/utils/test_utils.py
@@ -1,5 +1,3 @@
-import os
-
 import pytest
 
 from dvc.utils import to_chunks, fix_env
@@ -32,15 +30,11 @@ def test_to_chunks_num_chunks(num_chunks, expected_chunks):
     assert result == expected_chunks
 
 
-@pytest.mark.skipif(os.name == "nt", reason="pyenv-win is not supported")
 @pytest.mark.parametrize(
     "path, orig",
     [
         (
-            (
-                "/pyenv/bin:/pyenv/libexec:/pyenv/plugins/plugin:"
-                "/orig/path1:/orig/path2"
-            ),
+            "/pyenv/bin:/pyenv/libexec:/pyenv/hook:/orig/path1:/orig/path2",
             "/orig/path1:/orig/path2",
         ),
         (
@@ -48,10 +42,7 @@ def test_to_chunks_num_chunks(num_chunks, expected_chunks):
             "/orig/path1:/orig/path2",
         ),
         (
-            (
-                "/pyenv/bin:/some/libexec:/pyenv/plugins/plugin:"
-                "/orig/path1:/orig/path2"
-            ),
+            "/pyenv/bin:/some/libexec:/pyenv/hook:/orig/path1:/orig/path2",
             "/orig/path1:/orig/path2",
         ),
         ("/orig/path1:/orig/path2", "/orig/path1:/orig/path2"),
@@ -62,11 +53,5 @@ def test_to_chunks_num_chunks(num_chunks, expected_chunks):
     ],
 )
 def test_fix_env_pyenv(path, orig):
-    env = {
-        "PATH": path,
-        "PYENV_ROOT": "/pyenv",
-        "PYENV_VERSION": "3.7.2",
-        "PYENV_DIR": "/some/dir",
-        "PYENV_HOOK_PATH": "/some/hook/path",
-    }
+    env = {"PATH": path, "PYENV_ROOT": "/pyenv"}
     assert fix_env(env)["PATH"] == orig

pip install -e .[all]
parse_log_pytest
pytest
pytest pytest-timeout pytest-cov pytest-xdist pytest-mock flaky mock xmltodict awscli google-compute-engine Pygments collective.checkdocs flake8 psutil flake8-docstrings pydocstyle jaraco.windows mock-ssh-server moto rangehttpserver
apt-get update apt-get install -y gcc
3.7
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
aliyun-python-sdk-core==2.16.0
aliyun-python-sdk-core-v3==2.13.33
aliyun-python-sdk-kms==2.16.5
appdirs==1.4.4
asciimatics==1.14.0
atpublic==3.1.2
attrs @ file:///croot/attrs_1668696182826/work
autocommand==2.2.2
awscli==1.31.13
azure-common==1.1.28
azure-storage-blob==2.1.0
azure-storage-common==2.1.0
bcrypt==4.2.1
boto==2.49.0
boto3==1.9.115
botocore==1.12.253
cachetools==4.2.4
certifi @ file:///croot/certifi_1671487769961/work/certifi
cffi==1.15.1
charset-normalizer==3.4.1
collective.checkdocs==0.2
colorama==0.4.4
configobj==5.0.9
configparser==5.3.0
coverage==7.2.7
crcmod==1.7
cryptography==44.0.2
distro==1.9.0
docutils==0.15.2
-e git+https://github.com/iterative/dvc.git@8787ac03808fcf38dcac01f7a57f82f216b28e12#egg=dvc
execnet==2.0.2
flake8==5.0.4
flake8-docstrings==1.7.0
flaky==3.8.1
flit_core @ file:///opt/conda/conda-bld/flit-core_1644941570762/work/source/flit_core
flufl.lock==7.1.1
funcy==2.0
future==1.0.0
gitdb==4.0.12
GitPython==3.1.44
google-api-core==2.10.2
google-auth==1.35.0
google-cloud-core==1.7.3
google-cloud-storage==1.19.0
google-compute-engine==2.8.13
google-crc32c==1.5.0
google-resumable-media==2.7.2
googleapis-common-protos==1.69.2
grandalf==0.6
humanize==4.6.0
idna==3.10
importlib-metadata==4.2.0
importlib-resources==5.12.0
inflect==6.0.5
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
jaraco.classes==3.2.3
jaraco.collections==4.2.0
jaraco.context==4.3.0
jaraco.functools==3.7.0
jaraco.structures==2.1.0
jaraco.text==3.11.1
jaraco.ui==2.3.0
jaraco.windows==5.7.0
Jinja2==3.1.6
jmespath==0.10.0
jsonpath-ng==1.7.0
MarkupSafe==2.1.5
mccabe==0.7.0
mock==5.2.0
mock-ssh-server==0.9.1
more-itertools==9.1.0
moto==4.2.14
nanotime==0.5.2
networkx==2.6.3
numpy==1.21.6
oss2==2.6.1
packaging @ file:///croot/packaging_1671697413597/work
paramiko==3.5.1
path==16.6.0
pathspec==0.11.2
Pillow==9.5.0
pluggy @ file:///tmp/build/80754af9/pluggy_1648042572264/work
ply==3.11
protobuf==4.24.4
psutil==7.0.0
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pyarrow==0.14.0
pyasn1==0.5.1
pyasn1-modules==0.3.0
pycodestyle==2.9.1
pycparser==2.21
pycryptodome==3.22.0
pydantic==1.10.21
pydocstyle==6.3.0
pyfiglet==0.8.post1
pyflakes==2.5.0
Pygments==2.17.2
PyNaCl==1.5.0
pyparsing==3.1.4
pytest==7.1.2
pytest-cov==4.1.0
pytest-mock==3.11.1
pytest-timeout==2.3.1
pytest-xdist==3.5.0
python-dateutil==2.9.0.post0
PyYAML==6.0.1
rangehttpserver==1.4.0
requests==2.31.0
responses==0.23.3
rsa==4.7.2
ruamel.yaml==0.18.10
ruamel.yaml.clib==0.2.8
s3transfer==0.2.1
schema==0.7.7
shortuuid==1.0.13
six==1.17.0
smmap==5.0.2
snowballstemmer==2.2.0
tomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work
tqdm==4.67.1
treelib==1.7.1
types-PyYAML==6.0.12.12
typing_extensions @ file:///croot/typing_extensions_1669924550328/work
urllib3==1.25.11
wcwidth==0.2.13
Werkzeug==2.2.3
xmltodict==0.14.2
zipp @ file:///croot/zipp_1672387121353/work

name: dvc
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=22.1.0=py37h06a4308_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - flit-core=3.6.0=pyhd3eb1b0_0
  - importlib_metadata=4.11.3=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=22.0=py37h06a4308_0
  - pip=22.3.1=py37h06a4308_0
  - pluggy=1.0.0=py37h06a4308_1
  - py=1.11.0=pyhd3eb1b0_0
  - pytest=7.1.2=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tomli=2.0.1=py37h06a4308_0
  - typing_extensions=4.4.0=py37h06a4308_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.11.0=py37h06a4308_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - aliyun-python-sdk-core==2.16.0
      - aliyun-python-sdk-core-v3==2.13.33
      - aliyun-python-sdk-kms==2.16.5
      - appdirs==1.4.4
      - asciimatics==1.14.0
      - atpublic==3.1.2
      - autocommand==2.2.2
      - awscli==1.31.13
      - azure-common==1.1.28
      - azure-storage-blob==2.1.0
      - azure-storage-common==2.1.0
      - bcrypt==4.2.1
      - boto==2.49.0
      - boto3==1.9.115
      - botocore==1.12.253
      - cachetools==4.2.4
      - cffi==1.15.1
      - charset-normalizer==3.4.1
      - collective-checkdocs==0.2
      - colorama==0.4.4
      - configobj==5.0.9
      - configparser==5.3.0
      - coverage==7.2.7
      - crcmod==1.7
      - cryptography==44.0.2
      - distro==1.9.0
      - docutils==0.15.2
      - dvc==0.61.1
      - execnet==2.0.2
      - flake8==5.0.4
      - flake8-docstrings==1.7.0
      - flaky==3.8.1
      - flufl-lock==7.1.1
      - funcy==2.0
      - future==1.0.0
      - gitdb==4.0.12
      - gitpython==3.1.44
      - google-api-core==2.10.2
      - google-auth==1.35.0
      - google-cloud-core==1.7.3
      - google-cloud-storage==1.19.0
      - google-compute-engine==2.8.13
      - google-crc32c==1.5.0
      - google-resumable-media==2.7.2
      - googleapis-common-protos==1.69.2
      - grandalf==0.6
      - humanize==4.6.0
      - idna==3.10
      - importlib-metadata==4.2.0
      - importlib-resources==5.12.0
      - inflect==6.0.5
      - jaraco-classes==3.2.3
      - jaraco-collections==4.2.0
      - jaraco-context==4.3.0
      - jaraco-functools==3.7.0
      - jaraco-structures==2.1.0
      - jaraco-text==3.11.1
      - jaraco-ui==2.3.0
      - jaraco-windows==5.7.0
      - jinja2==3.1.6
      - jmespath==0.10.0
      - jsonpath-ng==1.7.0
      - markupsafe==2.1.5
      - mccabe==0.7.0
      - mock==5.2.0
      - mock-ssh-server==0.9.1
      - more-itertools==9.1.0
      - moto==4.2.14
      - nanotime==0.5.2
      - networkx==2.6.3
      - numpy==1.21.6
      - oss2==2.6.1
      - paramiko==3.5.1
      - path==16.6.0
      - pathspec==0.11.2
      - pillow==9.5.0
      - ply==3.11
      - protobuf==4.24.4
      - psutil==7.0.0
      - pyarrow==0.14.0
      - pyasn1==0.5.1
      - pyasn1-modules==0.3.0
      - pycodestyle==2.9.1
      - pycparser==2.21
      - pycryptodome==3.22.0
      - pydantic==1.10.21
      - pydocstyle==6.3.0
      - pyfiglet==0.8.post1
      - pyflakes==2.5.0
      - pygments==2.17.2
      - pynacl==1.5.0
      - pyparsing==3.1.4
      - pytest-cov==4.1.0
      - pytest-mock==3.11.1
      - pytest-timeout==2.3.1
      - pytest-xdist==3.5.0
      - python-dateutil==2.9.0.post0
      - pyyaml==6.0.1
      - rangehttpserver==1.4.0
      - requests==2.31.0
      - responses==0.23.3
      - rsa==4.7.2
      - ruamel-yaml==0.18.10
      - ruamel-yaml-clib==0.2.8
      - s3transfer==0.2.1
      - schema==0.7.7
      - shortuuid==1.0.13
      - six==1.17.0
      - smmap==5.0.2
      - snowballstemmer==2.2.0
      - tqdm==4.67.1
      - treelib==1.7.1
      - types-pyyaml==6.0.12.12
      - urllib3==1.25.11
      - wcwidth==0.2.13
      - werkzeug==2.2.3
      - xmltodict==0.14.2
prefix: /opt/conda/envs/dvc

tests/unit/utils/test_utils.py::test_fix_env_pyenv[/pyenv/bin:/pyenv/libexec:/pyenv/hook:/orig/path1:/orig/path2-/orig/path1:/orig/path2] tests/unit/utils/test_utils.py::test_fix_env_pyenv[/pyenv/bin:/pyenv/libexec:/orig/path1:/orig/path2-/orig/path1:/orig/path2] tests/unit/utils/test_utils.py::test_fix_env_pyenv[/pyenv/bin:/some/libexec:/pyenv/hook:/orig/path1:/orig/path2-/orig/path1:/orig/path2]
tests/unit/utils/test_utils.py::test_to_chunks_chunk_size[1-expected_chunks0] tests/unit/utils/test_utils.py::test_to_chunks_chunk_size[2-expected_chunks1] tests/unit/utils/test_utils.py::test_to_chunks_chunk_size[3-expected_chunks2] tests/unit/utils/test_utils.py::test_to_chunks_should_raise[1-2] tests/unit/utils/test_utils.py::test_to_chunks_should_raise[None-None] tests/unit/utils/test_utils.py::test_to_chunks_num_chunks[4-expected_chunks0] tests/unit/utils/test_utils.py::test_to_chunks_num_chunks[3-expected_chunks1] tests/unit/utils/test_utils.py::test_to_chunks_num_chunks[2-expected_chunks2] tests/unit/utils/test_utils.py::test_fix_env_pyenv[/orig/path1:/orig/path2-/orig/path1:/orig/path2] tests/unit/utils/test_utils.py::test_fix_env_pyenv[/orig/path1:/orig/path2:/pyenv/bin:/pyenv/libexec-/orig/path1:/orig/path2:/pyenv/bin:/pyenv/libexec]
dvc/utils/__init__.py dvc/version.py scripts/build_posix.sh
dvc/utils/__init__.py dvc/version.py scripts/build_posix.sh