Raspberry Pi wants to use aptitude to solve the dependency package problem, but what should I do if a dependency package error occurs when installing aptitude using apt-get?

The road is hindered and long, and the line is coming. Keep your head down and work hard, if you don't talk, you will be a blockbuster! Come on, Sao Nian!

1 Problem description

  I follow this tutorial: to replace domestic raspberry pie image source , replacing the Raspberry Pi mirror source for domestic Tsinghua source after use , the emergence of dependencies wrong question, specifically the following error message: sudo apt-get install aptitude

pi@raspberrypi:~ $ sudo apt-get install aptitude
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 aptitude : Depends: libapt-pkg5.0 (>= 1.1) but it is not going to be installed
            Recommends: libparse-debianchangelog-perl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

  When this error occurred, I also searched for a long time, and went to the forum to post for help (forum portal: Raspberry Pi replaced Tsinghua source, installation of aptitude reported an error ), but I did not get a useful answer.

2 Cause of the problem

  After unremittingly searching for the reason, I finally found some clues in an article, the article link: Raspberry Pi failed to give up! The relevant information screenshots are as follows:
Insert picture description here
  Seeing this, I suddenly thought that I myself was a method of changing the source on Baidu on the Internet, and I used it directly, regardless of which version it was. Okay, then the reason should be this.

3 problem solving

  First I use the command: to check the current Raspberry Pi system version, the specific information is as follows, the code name of this version is " buster " lsb_release -a

pi@raspberrypi:~ $ lsb_release -a
No LSB modules are available.
Distributor ID:	Raspbian
Description:	Raspbian GNU/Linux 10 (buster)
Release:	10
Codename:	buster

  Then I went to look at the address of the mirror source, the version code used is " stretch ", as follows

deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi

Insert picture description here

  So, I went to the corresponding file, changed it to , and I was done ✌️✌️✌️! stretch buster

  After modification, remember to execute the following command to update the software source list!

sudo apt-get update
sudo apt-get upgrade

  At this time, there should be many things that need to be updated, just wait slowly, the domestic mirror source network speed is still quite good;

  After the update is complete, you can install it again , using the following command: aptitude

sudo apt-get install aptitude

  You're done ✌️✌️✌️, I finally solved this damn problem, I hope it helps you!

4 summary

  1. When using a domestic mirror source, be sure to match the version number. If my system is version A, if I give him a mirror source of version B, then he will update the software source list, and there may be problems. Because the version does not match!
  2. Remember to remember! ! !

If the content of the article is wrong, please comment / private message a lot of advice, thank you! If you think the content of the article is not bad, remember to click three links (like, bookmark, leave a message), your support is my greatest encouragement, thank you!

Guess you like

Origin blog.csdn.net/Fighting_Boom/article/details/106879019