Linux исправить ошибки пакетов

Package system is broken. How to fix it?

I just recently bought an arduino and requires gcc-avr/avrdude to compile the software. I installed avr for another microprocessor component a while ago but is obviously an outdated version (gcc version 3.3 20030512 (prerelease)) so I went ahead to update these but it didn’t work. (Please note that before hand I also broke my aptdaemon through an incomplete wine installation (couldn’t get passed font installation agreement) but I fixed that via a re-installation then accepting the agreement.) I am trying to update these by running bingo’s build script but the dependencies it requires cannot be installed due to avr. terminal reports

Reading package lists. Done Building dependency tree Reading state information. Done build-essential is already the newest version. libncurses5-dev is already the newest version. libncurses5-dev set to manually installed. libusb-0.1-4 is already the newest version. libx11-dev is already the newest version. You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: arduino-core : Depends: gcc-avr but it is not going to be installed avr-libc : Depends: gcc-avr (>= 1:4.3.4) but it is not going to be installed Depends: binutils-avr (>= 2.20) but it is not going to be installed binutils-dev : Depends: binutils (= 2.21.0.20110327-2ubuntu3) but 2.21.0.20110327-2ubuntu2 is to be installed libcwidget-dev : Depends: libcwidget3 (= 0.5.16-3ubuntu2) but it is not going to be installed Depends: libsigc++-2.0-dev but it is not going to be installed Depends: libncursesw5-dev but it is not going to be installed libmpfr-dev : Depends: libgmp3-dev (>= 4.2.dfsg-1) but it is not going to be installed python-dev : Depends: python (= 2.7.1-0ubuntu5.1) but 2.7.1-0ubuntu5 is to be installed Depends: python2.7-dev (>= 2.7.1-1~) but it is not going to be installed tk8.4-dev : Depends: tk8.4 (= 8.4.19-4) but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). 
(Reading database . 163021 files and directories currently installed.) Unpacking binutils-avr (from . /binutils-avr_2.20.1-1ubuntu2_i386.deb) . dpkg: error processing /var/cache/apt/archives/binutils-avr_2.20.1-1ubuntu2_i386.deb (--unpack): trying to overwrite '/usr/bin/avr-size', which is also in package avr-binutils 2.13.90.030512-2 dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Unpacking gcc-avr (from . /gcc-avr_1%3a4.3.5-1_i386.deb) . dpkg: error processing /var/cache/apt/archives/gcc-avr_1%3a4.3.5-1_i386.deb (--unpack): trying to overwrite '/usr/bin/avr-g++', which is also in package avr-gcc-c++ 3.2.90.20030512-2 dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Errors were encountered while processing: /var/cache/apt/archives/binutils-avr_2.20.1-1ubuntu2_i386.deb /var/cache/apt/archives/gcc-avr_1%3a4.3.5-1_i386.deb E: Sub-process /usr/bin/dpkg returned an error code (1) 
The following packages have unmet dependencies: arduino-core: Depends: gcc-avr but it is not installed avr-libc: Depends: gcc-avr (>= 1:4.3.4) but it is not installed Depends: binutils-avr (>= 2.20) but it is not installed 

which then tells me to try running apt-get -f install which just results the same as last time. So how can I fix my system, I really need the new avr, please 🙂 BTW, my system is Ubuntu 11.04

Читайте также:  Драйвер ядра virtualbox linux vboxdrv установить

Источник

Use apt-get to fix missing and broken packages

Package managers in Linux are the most useful programs that are used to add additional capabilities in a system. They can be used for installing, removing, updating, and upgrading the packages, also featuring the dependency resolution capabilities. However, like any other program, things can also go wrong with these package managers. Sometimes, while updating or installing a third-party program, installation goes wrong and results in errors that require you to install the missing dependencies and broken packages. This error may also occur because of improper package management, incorrect installation of packages, and installation of unnecessary packages. Whatever the reason may be, the problem is that you receive an error and left with a condition where you cannot add a new package nor update or delete the existing packages until you fix the problem.

In this article, we will learn how to fix the missing dependencies and broken packages using the apt-get command. Note that, we have run the commands and procedure mentioned in this article on a Debian 10 system. The same procedure can be followed in Ubuntu and older Debian versions.

We will use the command-line Terminal for trying the solutions and fixing the problem. To open the Terminal application in Debian, hit the super key on the keyboard and search for it using the search bar that appears. When the search result appears, click on the Terminal icon to open it.

Using apt-get to fix missing and broken packages

Apt-get is a Terminal based package management tool used for installing, upgrading, and removing packages. Along with these features, it also has flags that can be used for fixing missing dependencies and broken packages.

Use the “fix-missing” option with “apt-get update” to run the updates and ensure the packages are up to date and there is no new version available for the packages.

Once you are done with the update, execute the below command in order to force the package manager to find any missing dependencies or broken packages and install them.

Читайте также:  Linux работа с iptables

Another approach to solving the broken package issue via apt-get is to edit the “/etc/apt/sources/list” file and adding sites with newer versions of packages available. Then running the “apt-get update” command to update the repository list.

If the above method does not fix the issue of broken dependencies and broken packages and still you are receiving the error, then try the following methods.

Other methods

In this method, we will use the “apt-get autoremove” and the “dpkg” in order to fix missing dependencies and broken packages.

1. Update the repository index by executing the below command in Terminal:

2. Next, execute the below command to clean out the local repository:

3. Execute the below command to remove all the unnecessary packages that are no longer needed:

The above command will display the unmet dependencies or broken package’s name.

4. Then try executing the below command in Terminal to force remove the broken package:

Method 2:

In the following method, we will use the “dpkg—configure” command in order to fix missing dependencies and broken packages.

Dpkg is a package management tool that can be used to install, remove and manage packages. Similar to apt-get, it can also help to fix broken packages and missing dependencies. If you receive some errors while installing or updating the packages, try the following solution with dpkg:

1. Execute the below command in the Terminal to reconfigure all the partially installed packages.

If the above command does not work, like in our case and you see similar results displaying the erroneous package, then try removing the package.

2. Execute the below command in Terminal in order to remove the erroneous package.

3. Then use the below command to clean out the local repository:

After trying any one of the above solutions, run the update command to ensure the dependencies are resolved and broken packages are fixed or removed.

Fixing the dependency and broken packages errors and then returning the system to the normal state may take hours. Sometimes it gets so complicated that when you finally fix it, you feel so lucky. We have presented some solutions regarding this error, so please give them a try. If you know some of the possible solutions we did not mention, please let us know in the comments.

About the author

Karim Buzdar

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.

Читайте также:  Настройка l2tp сервер linux

Источник

How to Fix Broken Packages in Ubuntu

Linux packages are compressed archives containing programs and files necessary to run them. The package distribution system is designed to be robust and simplify the application installation process.

However, a bad internet connection or misconfigured third-party installers can corrupt packages and cause problems on your system.

This article will show you how to troubleshoot and fix broken packages on Ubuntu using the available APT and DPKG tools.

How to fix broken packages in Ubuntu

Check for Updates

Start troubleshooting by rebuilding the list of dependencies. The —fix-missing option tells APT to ignore missing packages. The option ensures the update process is performed without APT returning an error.

sudo apt update --fix-missing

The --fix-missing option tells APT to ignore the missing packages

Force APT to Correct Missing Dependencies or Broken Packages

Missing package dependencies are a common reason for package-related errors.

1. Use apt install with the -f flag to tell APT to locate the missing packages and install them.

APT lists the missing packages on your system.

The apt install tells APT to locate the missing packages and install them

2. Press ENTER to start the installation.

Note: If troubleshooting has led to Ubuntu needing to be reinstalled, please refer to our reinstallation guide How to Reinstall Ubuntu.

Force Reconfigure or Remove Broken Packages with DPKG

Broken packages may cause package manager configuration problems.

1. Reconfigure DPKG, the base package management system, with the following command:

2. Check if DPKG marked some packages as needing a reinstall.

3. If the command above returns a list of one or more packages, try removing the packages by typing:

sudo dpkg --purge --force-all [package-name]

The example below shows how to remove the corrupted vlc-plugin-base package.

Remove the corrupted vlc-plugin-base package

Warning: The dpkg —purge —force-all command removes a package even if the removal causes further dependency issues. Use the command with care.

4. After you finish troubleshooting, run the following command to clean up the system:

5. Then update the repositories again:

Resolve DPKG Lock Issue

The DPKG lock error appears when trying to install a package while another process is using DPKG.

The DPKG lock error appears when trying to install a package while another process is using DPKG

However, sometimes the error occurs even if no other processes are using the package management system.

1. To fix the problem, remove the lock file manually:

sudo rm /var/lib/apt/lists/lock

2. Also, remove the lock in cache:

sudo rm /var/cache/apt/archives/lock

Deleting the lock enables you to use APT and DPKG again.

The article provided common ways of resolving problems caused by broken packages on Ubuntu.

For more information related to package management on Ubuntu, read:

Источник

Оцените статью
Adblock
detector