How can i prevent a specific package to be installed?
I have already read the following pages:
- Need to prevent a package from being installed
- https://www.tecmint.com/disable-lock-blacklist-package-updates-ubuntu-debian-apt/
- https://unix.stackexchange.com/questions/459162/how-to-mark-a-package-to-prevent-from-being-installed
According to the first and third links, I placed preferences (which did not exist) in /etc/apt/ with content:
Package: *name*
Pin: origin ""
Pin-Priority: -1
but i doesn't work.
Do new versions of Ubuntu work differently?
I have already tried rebooting and updating.
This is the apt-cache policy *name*
output:
*name*:
Installed: (none)
Candidate: 7.0-2.1
Version table:
7.0-2.1 500
500 http://it.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
This is the apt-cache policy
output:
Package files:
100 /var/lib/dpkg/status
release a=now
500 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu focal/main i386 Packages
release v=20.04,o=LP-PPA-yannubuntu-boot-repair,a=focal,n=focal,l=Boot-Repair,c=main,b=i386
origin ppa.launchpad.net
500 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu focal/main amd64 Packages
release v=20.04,o=LP-PPA-yannubuntu-boot-repair,a=focal,n=focal,l=Boot-Repair,c=main,b=amd64
origin ppa.launchpad.net
500 https://packages.microsoft.com/repos/ms-teams stable/main amd64 Packages
release o=ms-teams stable,a=stable,n=stable,l=ms-teams stable,c=main,b=amd64
origin packages.microsoft.com
500 http://ppa.launchpad.net/kgilmer/speed-ricer/ubuntu focal/main i386 Packages
release v=20.04,o=LP-PPA-kgilmer-speed-ricer,a=focal,n=focal,l=Speed Ricer,c=main,b=i386
origin ppa.launchpad.net
500 http://ppa.launchpad.net/kgilmer/speed-ricer/ubuntu focal/main amd64 Packages
release v=20.04,o=LP-PPA-kgilmer-speed-ricer,a=focal,n=focal,l=Speed Ricer,c=main,b=amd64
origin ppa.launchpad.net
500 http://security.ubuntu.com/ubuntu focal-security/multiverse i386 Packages
release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=multiverse,b=i386
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages
release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=multiverse,b=amd64
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu focal-security/universe i386 Packages
release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=universe,b=i386
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages
release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=universe,b=amd64
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu focal-security/restricted i386 Packages
release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=restricted,b=i386
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages
release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=restricted,b=amd64
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu focal-security/main i386 Packages
release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=main,b=i386
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=main,b=amd64
origin security.ubuntu.com
100 http://it.archive.ubuntu.com/ubuntu focal-backports/universe i386 Packages
release v=20.04,o=Ubuntu,a=focal-backports,n=focal,l=Ubuntu,c=universe,b=i386
origin it.archive.ubuntu.com
100 http://it.archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages
release v=20.04,o=Ubuntu,a=focal-backports,n=focal,l=Ubuntu,c=universe,b=amd64
origin it.archive.ubuntu.com
500 http://it.archive.ubuntu.com/ubuntu focal-updates/multiverse i386 Packages
release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=multiverse,b=i386
origin it.archive.ubuntu.com
500 http://it.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages
release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=multiverse,b=amd64
origin it.archive.ubuntu.com
500 http://it.archive.ubuntu.com/ubuntu focal-updates/universe i386 Packages
release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=universe,b=i386
origin it.archive.ubuntu.com
500 http://it.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages
release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=universe,b=amd64
origin it.archive.ubuntu.com
500 http://it.archive.ubuntu.com/ubuntu focal-updates/restricted i386 Packages
release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=restricted,b=i386
origin it.archive.ubuntu.com
500 http://it.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages
release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=restricted,b=amd64
origin it.archive.ubuntu.com
500 http://it.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages
release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=main,b=i386
origin it.archive.ubuntu.com
500 http://it.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=main,b=amd64
origin it.archive.ubuntu.com
500 http://it.archive.ubuntu.com/ubuntu focal/multiverse i386 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=multiverse,b=i386
origin it.archive.ubuntu.com
500 http://it.archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=multiverse,b=amd64
origin it.archive.ubuntu.com
500 http://it.archive.ubuntu.com/ubuntu focal/universe i386 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=universe,b=i386
origin it.archive.ubuntu.com
500 http://it.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=universe,b=amd64
origin it.archive.ubuntu.com
500 http://it.archive.ubuntu.com/ubuntu focal/restricted i386 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=restricted,b=i386
origin it.archive.ubuntu.com
500 http://it.archive.ubuntu.com/ubuntu focal/restricted amd64 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=restricted,b=amd64
origin it.archive.ubuntu.com
500 http://it.archive.ubuntu.com/ubuntu focal/main i386 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=main,b=i386
origin it.archive.ubuntu.com
500 http://it.archive.ubuntu.com/ubuntu focal/main amd64 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=main,b=amd64
origin it.archive.ubuntu.com
Pinned packages:
/etc/apt/preferences
, what output did you get forapt-cache policy name
? I suspect theorigin
isn't correct. – muru Mar 03 '21 at 07:58apt-cache policy
to see theo=...
value for the corresponding repository. – muru Mar 03 '21 at 08:08