I broke aptitude and apt-get. How to reinstall or fix them?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
niisiis
Level 1
Level 1
Posts: 2
Joined: Sat Aug 24, 2013 1:16 pm

I broke aptitude and apt-get. How to reinstall or fix them?

Post by niisiis »

Yesterday, I accidentally removed all of my repositories from enabled list in package manager. Actually I wanted to use the filter function. After that the package manager didn't start any more. I tried to fix the problem using my own mind, but I'm afraid I only made it worse. When I try to use aptitude it gives me "Segmentation fault" error and apt-get doesn't respond as usual as well. Can somebody help me? What should I do?

I have linux mint 15 64-bit using Cinnamon.
User avatar
xenopeek
Level 24
Level 24
Posts: 24973
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: I broke aptitude and apt-get. How to reinstall or fix th

Post by xenopeek »

niisiis wrote:I accidentally removed all of my repositories from enabled list in package manager
If I understood you correctly; you used Synaptic Package Manager and from its menu selected Settings > Repositories and there cleared the tick box for each enabled repository? I did that also, and indeed it gives some strange behavior. I restored normal function by opening Software Sources from the menu (just type in your menu to find it) and clicking the "Restore the default settings" button at the bottom of the first screen. Should probably work for you also (though it won't restore any PPAs or other repositories you added I think, but it will at least restore all the default Linux Mint and Ubuntu repositories).
Image
niisiis
Level 1
Level 1
Posts: 2
Joined: Sat Aug 24, 2013 1:16 pm

Re: I broke aptitude and apt-get. How to reinstall or fix th

Post by niisiis »

That would have been really useful yesterday, but I'm afraid I have broken my configuration with many commands I read from google-ing different topics. Currently aptitude gives segmentation fault error. Synaptic package manager's and software manager's GUIs don't open up no more.
leekohlbradley
Level 1
Level 1
Posts: 5
Joined: Mon Aug 26, 2013 10:53 pm

Re: I broke aptitude and apt-get. How to reinstall or fix th

Post by leekohlbradley »

Yup, seems this is easy to do because I've managed the same thing! No package-related command or program of any kind will run, apt, deb or whatever. I'm getting segmentation errors and if I try to open synaptics it shows a large number of

Code: Select all

(synaptic:2787): Gtk-WARNING **: GtkNotebook 0xe344a0 is mapped but visible child GtkLabel 0x11722b0 is not mapped
Hope there's a solution! Thanks
User avatar
z1p101
Level 1
Level 1
Posts: 31
Joined: Tue Jul 24, 2012 7:29 pm

Re: I broke aptitude and apt-get. How to reinstall or fix th

Post by z1p101 »

Yea, it's really easy to do, one click and it's all over. The file official-package-repositories.list found in /etc/apt/sources.list.d gets corrupted or encrypted or something? What I did to fix it was copied the file off my live cd and used it to replace the bad one on my system.

Here is the content of official-package-repositories.list for Mint 15 if you want to remove the bad one and replace it.

Code: Select all

# Do not edit this file manually, use Software Sources instead.

deb http://packages.linuxmint.com olivia main upstream import  #id:linuxmint_main

deb http://archive.ubuntu.com/ubuntu raring main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu raring-updates main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ raring-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ raring partner
Just replace the file and apt should run again. My other repos were still intact but I don't know your situation.

Good luck.
Post Reply

Return to “Newbie Questions”