0

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 Lubuntu 13.04.

Results of sudo apt-get check :

enter image description here

karel
  • 114,770
  • Sorry if this is really hard to understand, I can't tell it in other words –  Dec 11 '13 at 17:09
  • I'm going to look what does sudo apt-get check does –  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: http://www.codeblocks.org/ –  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
  • Updated. Well, if nothing helps I could just freshly install 13.10 Lubuntu, but I still want to know if it's possible to remove only that package –  Dec 11 '13 at 18:21
  • @souravc please respond to me on that suggestion –  Dec 11 '13 at 18:30
  • I think you need to download this packages: http://pastebin.com/ThKxHQKK and try to install them. Otherwise, you should use sourav answer http://askubuntu.com/a/389337/169736 – Braiam Dec 11 '13 at 18:45
  • It should be ok, but I get this: Reading package lists... Done Building dependency tree
    Reading state information... Done Building data structures... Done Building data structures... Done This package is uninstallable Breaks existing package 'codeblocks-dbg' dependency codeblocks (= 12.11-2). oops, I think I've put them in a folder where are all of my other packages. going to try again
    –  Dec 11 '13 at 19:08
  • @Braiam You gave me bad architecture, mine isn't amd :( –  Dec 11 '13 at 19:14
  • Ups, just replace amd64 with i386, should be the good one – Braiam Dec 11 '13 at 19:17
  • Downloading again right now, if this won't work, this will be it for today. But if it works, what should I mark as answer? –  Dec 11 '13 at 19:26
  • For that you should rewrite your question or ask a new one. – Braiam Dec 11 '13 at 19:27

4 Answers4

3

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.

Avinash Raj
  • 78,556
1

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.

sourav c.
  • 44,715
  • Please tell me is that "-" is a minus or a dash(I'm not sure if I named it correctly) –  Dec 11 '13 at 18:26
  • just copy it. anyway they are same here. – sourav c. Dec 11 '13 at 18:27
  • Btw, won't this will make me uninstall all the packages that would uninstall with package manager? –  Dec 11 '13 at 18:28
  • what is the output of dpkg -l | grep ^rc | awk '{ print $2 }'? How many are there? – sourav c. Dec 11 '13 at 18:30
  • there is only one: codeblocks-common –  Dec 11 '13 at 18:33
  • what if you try sudo apt-get purge codeblocks-common in terminal? – sourav c. Dec 11 '13 at 18:34
  • Its says: edve98@Edvino-PC:~$ sudo apt-get purge codeblocks-common [sudo] password for edve98: Reading package lists... Done Building dependency tree
    Reading state information... Done You might want to run 'apt-get -f install' to correct these:
    –  Dec 11 '13 at 18:40
  • The following packages have unmet dependencies: codeblocks-contrib-dbg : Depends: codeblocks-contrib (= 12.11-2) but it is not installable codeblocks-dbg : Depends: codeblocks (= 12.11-2) but it is not installable libesd0 : Depends: esound-common (= 0.2.41-11) but it is not installable Conflicts: libesd-alsa0 but 0.2.41-6ubuntu1 is to be installed libgcc1 : Depends: gcc-4.8-base (= 4.8.2-1ubuntu2) but it is not installable libstdc++6 : Depends: gcc-4.8-base (= 4.8.2-1ubuntu2) but it is not installable libwxgtk2.8-0-ansi : Depends: libgconf2-4 (>= 2.13.5) but it isnot installable –  Dec 11 '13 at 18:41
  • Depends: libjpeg62 but it is not installable Depends: liborbit2 (>= 1:2.14.8) but it is not installable Depends: libtiff4 but it is not installable Depends: libwxbase2.8-0-ansi (>= 2.8.9.2) but it is not installable E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). –  Dec 11 '13 at 18:42
  • That's pretty long, I hope it helped a bit –  Dec 11 '13 at 18:43
  • ok! have you tried sudo apt-get -f install – sourav c. Dec 11 '13 at 18:45
  • yes, it said that I will delete a lot of other packages (like apt, and I think this is not normal) so I didn't type "Yes, do as I say!" –  Dec 11 '13 at 18:46
  • I guess I will try your option after downloading the packages and installing them that Braian provided –  Dec 11 '13 at 18:52
  • ok go ahead and also can look at this answer – sourav c. Dec 11 '13 at 18:56
0

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'
Braiam
  • 67,791
  • 32
  • 179
  • 269
  • Does it come pre-installed with Lubuntu? I don't have internet connection on that computer –  Dec 11 '13 at 17:48
-2

try sudo apt-get update and see if it works