So was about to install some packages so I could get programs that I want. And somehow one package got broken, I have no idea how. So now when I try to do sudo apt-get -f install it says broken one affects other packages. If I want to remove it, I have to remove a lot of other packages(I think even apt has to be removed) (and I don't have any programs on Ubuntu that installed myself).

Is it possible to remove only the broken package or reinstall the uninstalled packages just after they were uninstalled? Remember that I don't have internet access on any Linux computer at my home right now. I am using 13.04 Lubuntu version. After doing sudo apt-get check it gives me this:

http://imgur.com/uiZKz39 (sorry for picture)

  • Sorry if this is really hard to understand, I can't tell it in other words – user177761 Dec 11 '13 at 17:09
  • I'm going to look what does sudo apt-get check does – user177761 Dec 11 '13 at 17:47
  • What exactly you tried to install? – Braiam Dec 11 '13 at 18:06
  • Ive tried to install code-blocks (I downloaded every needed dependency from Ubuntu packages) here is a link if you need it: codeblocks.org – user177761 Dec 11 '13 at 18:12
  • What version of Ubuntu you have? Please edit your question and include that information. – Braiam Dec 11 '13 at 18:15

Removing only broken packages was possible through synaptic package manager.

Run the below command on terminal to install and open synaptic,

sudo apt-get install synaptic && sudo synaptic

enter image description here

Right-click on the broken package and then Mark for Complete Removal.After that click apply.

  • when using synaptic package manager it still needs to remove all those packages – user177761 Dec 11 '13 at 17:12
  • all those packages means what? – Avinash Raj Dec 11 '13 at 17:23
  • "the choosen action also affects other packages. The following changes are recuired in order to proceed" and there goes probably all packages on my computer (under "to be removed") – user177761 Dec 11 '13 at 17:24
  • plz upload the screenshot. – Avinash Raj Dec 11 '13 at 17:26
  • Ok, ill just find my USB to transfer the screenshot – user177761 Dec 11 '13 at 17:27

To see the broken packages run the following at terminal,

dpkg -l | grep ^rc | awk '{ print $2 }'

After removing the broken packages to install them again, you may wish a make a list. To make a text file broken_packages.txt containing the list of broken packages at your home directory, use

dpkg -l | grep ^rc | awk '{ print $2 }' > ~/broken_packages.txt

To remove the packages,

sudo apt-get purge $(dpkg -l | grep ^rc | awk '{ print $2 }')

Upto this uninstallation you do not need any internet access. But afterwards if you want to install them again you need to have active internet access.

  • Please tell me is that "-" is a minus or a dash(I'm not sure if I named it correctly) – user177761 Dec 11 '13 at 18:26
  • just copy it. anyway they are same here. – souravc Dec 11 '13 at 18:27
  • Btw, won't this will make me uninstall all the packages that would uninstall with package manager? – user177761 Dec 11 '13 at 18:28
  • what is the output of dpkg -l | grep ^rc | awk '{ print $2 }'? How many are there? – souravc Dec 11 '13 at 18:30
  • there is only one: codeblocks-common – user177761 Dec 11 '13 at 18:33

To search and destroy broken packages you can use aptitude:

sudo apt-get install aptitude
aptitude search '~B'

To remove them:

sudo aptitude remove '~B'
  • Does it come pre-installed with Lubuntu? I don't have internet connection on that computer – user177761 Dec 11 '13 at 17:48

try sudo apt-get update and see if it works

  • It says that it needs internet – user177761 Dec 11 '13 at 17:11
  • use synaptic sudo apt-get install synaptic – Anonymous Mouse Dec 11 '13 at 17:13
  • It says I have already newest version of synaptic – user177761 Dec 11 '13 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy