0

im using ubuntu 14.04 and last time i have problems of upgrading the system. i was searching for a solution and found this one: sudo apt-get -y purge

i was using it and in the end it says that i cannot delete any old kernels because it depends on linux-image-3.13.0-93-generic. So, i understood i have to install that linux-image-3.13.0-93-generic. But the problem is that i dont have enough space for that. It's quite stupid because i have almost 500GB left on computer and still i cant use them for system memory? its quite absord that i have a lot of memory on my computer and im stuck because of a low memory of this system and because all kernels are depends one another so i cant even delete them

anyone can help me?

thanks.

  • So you want a solution for low memory in your system. Right? Or want to know the proper way to upgrade to ubuntu 15.04 from 14.04? – Animesh Patra Aug 22 '16 at 06:49
  • I want a solution for low memory in my system. i cant continue with that low memory, it will happen again and again so i have to fix it – user494556 Aug 22 '16 at 06:53
  • This is what it says when im trying to delete any old kernel:

    You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: linux-headers-3.13.0-88-generic : Depends: linux-headers-3.13.0-88 but it is not going to be installed linux-image-extra-3.13.0-93-generic : Depends: linux-image-3.13.0-93-generic but it is not going to be installed linux-image-generic : Depends: linux-image-3.13.0-93-generic but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

    – user494556 Aug 22 '16 at 07:01
  • any solutions???? im really freaking out from this stupid problem. quite disappointed that this really good system failed because of this minor and stupid problem that has no solutions (at least not 1 milion solution i tried by searching in web) – user494556 Aug 22 '16 at 07:18

1 Answers1

0

This answer is copied from this article.

As you can see in the error message, some packages have unmet dependencies. That means there are some mixing in third-party dependencies. APT package manager is easy to use for installing, removing etc but while mixing with third-party dependencies, apt-get sometimes gives this kind of error that you're getting.

Please follow the steps:

Take a backup of configuration files like:

/etc/apt/sources.list

Now remove the corrupt package database first:

sudo apt-get clean

or

sudo apt-get autoclean

Now please run this:

sudo apt-get -f install

This is most basic command to fix dependencies issues.

Now run:

sudo dpkg --configure -a

then,

sudo apt-get -f install

See the output, if its like this: 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.then it means it failed.

Now run this:

sudo apt-get -u dist-upgrade

If it shows any held packages then you have to eliminate it by this command:

sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade

Again see the output. If it's like this:

0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.

That means it failed again.

Now you have to delete the held packages one by one by running dist-upgrade each time. Use --dry-run and be aware of each incidents.

sudo apt-get remove --dry-run package-name

If not any luck then you have to find and remove the dependencies by yourself.

Disable PPA's:

Open Software Center > Edit > Software Sources and click on Other Software. You will see that each PPA have two lines, one for the compiled packages and one for the source, Uncheck both lines to disable a PPA.

Purge:

It means downgrading the packages in the selected PPA to the version in the official Ubuntu repositories and disabling that PPA. Run this command:

sudo apt-get install ppa-purge

If the above fails then run this:

mkdir ppa-purge && cd ppa-purge && wget http://mirror.pnl.gov/ubuntu/pool/universe/p/ppa-purge/ppa-purge_0.2.8+bzr56_all.deb && wget http://mirror.pnl.gov/ubuntu//pool/main/a/aptitude/aptitude_0.6.6-1ubuntu1_i386.deb && sudo dpkg -i ./*.deb

Use PPA Purge:

sudo ppa-purge ppa:someppa/ppa

Remove:

Run the commands:

sudo apt-get autoremove --purge package-name
sudo add-apt-repository --remove ppa:someppa/ppa
sudo apt-get autoclean

After that try again.

Read the original article and your concept will be much more clear.

Another method:

Show all installed packages with "linux-" and contains a number.(edit as your requirement):

dpkg -l linux-* | awk '/^ii/{ print $2 }' | grep -e [0-9]

Now specify the name of packages that you want to purge:

sudo apt-get -y purge  linux-headers-3.13.0-24  linux-headers-3.13.0-24-generic  linux-headers-3.13.0-29  linux-headers-3.13.0-29-generic  linux-image-3.13.0-24-generic  linux-image-3.13.0-29-generic  linux-image-extra-3.13.0-24-generic  linux-image-extra-3.13.0-29-generic

Alternative command:

dpkg -l 'linux-*' | sed  '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]*  [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge

This is the advanced command, which removes all kernel except the latest one.

  • None of this worked for me. I tried all, but the same error is showed again and again. This linux-image-extra-3.13.0-93-generic makes all the problems and i dont know how to delete it because i tried almost everything and nothing helped. More than that, I see that my computer starts running slow and stuck. I can't watch tv on internet anymore (because it sucks) and i can't play online games (because of disconnecting), so I'm really disappointed from this stupid problem. One last question: Can i change the whole system? I mean can I install ubuntu 16.04 instead of this broken system? – user494556 Aug 22 '16 at 18:30
  • Yes you can. But as your packages are in bad form you may get error message at first. Check the dpkg status first:
    `dpkg --status linux-image-3.13.0-93-generic` 
    
    `dpkg --status linux-image-extra-3.13.0-93-generic` 
    
    

    this will show some error like packages are not installed properly. Make a backup first:

    sudo cp `/var/lib/dpkg/status /var/lib/dpkg/status.backup` 
    
    

    Open the file: /var/lib/dpkg/status and delete only the broken packages nothing else.

    Now run sudo apt-get upgrade

    – Animesh Patra Aug 23 '16 at 04:17
  • 1
    Thank you!! it took me some time to understand how to edit this file as a root (admin), but after i succeeded and i edited it just as you said it all worked just fine. My problem was fixed. Thank you very much! – user494556 Aug 24 '16 at 21:08
  • Good to know that I was able to help you with something. It would be better if you accept the answer and vote so that other users having same problem can find this thread easily. You may now close the question. – Animesh Patra Aug 25 '16 at 03:47