How to install a package and force downgrade of all its needed dependencies

6,410

This may not work in your situation, but I ran into the same thing and I was able to solve it by setting the packages in the repository to have a higher installation priority than the currently-installed packages:

cat << EOF > /etc/apt/preferences.d/99tmp
Package: *
Pin: origin ""
Pin-Priority: 1001
EOF

^^ note that I was using a local repository, so you likely need something like "Pin: origin deb.debian.org".

Share:
6,410

Related videos on Youtube

Sogartar
Author by

Sogartar

Updated on September 18, 2022

Comments

  • Sogartar
    Sogartar over 1 year

    Let's say I have a package mypack. It has a ton of dependencies, that have a ton of dependencies themselves. I want to install it in one step where also all its dependencies are automatically downgraded. I have tried

    apt-get --allow-downgrades --allow-change-held-packages install mypack
    

    But it refuses to downgrade some installed packages.

    If some other package or some of its dependencies conflicts with a dependency of mypack it should remove the other package.

    Is there an available solution or I have to write the script myself?

    Update

    I tried installing a specific version but in some cases it does not work.

    apt-get --allow-downgrades --allow-change-held-packages install mypack=1.2.3