4

Yesterday I trying to install a package with apt-get but I regret of installing this package, but every time I want to install a new package the apt-get trying to install that package again !

How I can cancel hold packages in apt-get ?

αғsнιη
  • 35,660
MajAfy
  • 143
  • 1
  • 1
  • 4

2 Answers2

9

You may not have removed the package correctly, or apt-get got interrupted while removing the package. First, I would suggest running the following to process pending operations:

apt-get -f install

Once this is done, use autoremove to make sure there is no garbage in the way:

apt-get autoremove

Then, remove your package completely:

apt-get remove --purge [package name]
John WH Smith
  • 2,018
  • 14
  • 21
  • I had to manually removed all directories refering to the offending package in /var/lib/dpkg/info/, before your solution, to make it work. – Bludwarf Feb 25 '22 at 11:10
0

I manually removed it from folder list. I checked the path where they are about to be installed. On my part,

it's located in /etc/apt/souces.list.d/PACKAGE_NAME

I was trying to install spotify running Jessie from raspberry pi. Then 'sudo apt-get update ' was successful again.