Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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: (sorry for picture)

share|improve this question
Sorry if this is really hard to understand, I can't tell it in other words – edve98 Dec 11 '13 at 17:09
I'm going to look what does sudo apt-get check does – edve98 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: – edve98 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.

share|improve this answer
when using synaptic package manager it still needs to remove all those packages – edve98 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") – edve98 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 – edve98 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.

share|improve this answer
Please tell me is that "-" is a minus or a dash(I'm not sure if I named it correctly) – edve98 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? – edve98 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 – edve98 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'
share|improve this answer
Does it come pre-installed with Lubuntu? I don't have internet connection on that computer – edve98 Dec 11 '13 at 17:48

try sudo apt-get update and see if it works

share|improve this answer
It says that it needs internet – edve98 Dec 11 '13 at 17:11
use synaptic sudo apt-get install synaptic – Im'juz ChanYun Dec 11 '13 at 17:13
It says I have already newest version of synaptic – edve98 Dec 11 '13 at 17:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.