Ubuntu - resolve package dependencies

Ubuntu-A solution to package dependencies

When installing a software package, sometimes you may encounter a dependency problem similar to the one shown below, and it cannot be installed normally. The following three methods are provided to solve the dependency problem.

1. You can try to use the following method to deal with the dependency problem, enter the following command immediately after the previous installation command, and then execute the installation command:

sudo apt-get install -f

2. Before installing the software, or when encountering dependency problems, you can try to install build-essential to solve the problem, which aggregates some common dependencies:

sudo apt-get install build-essential

3. Use aptitude instead of apt-get, aptitude is also a package management tool, it is better than apt-get in dealing with dependency issues

Aptitude, like apt-get, is an extremely powerful package management tool in Debian and its derivative systems. Unlike apt-get, aptitude handles dependencies better. For example, when aptitude deletes a package, it will also delete the packages it depends on. In this way, no useless packages will remain in the system, and the whole system will be cleaner. When installing software, it can not only provide ordinary functions like apt, but also provide solutions for installation dependency conflicts.

At the beginning, aptitude will also detect dependency conflicts like apt, and then give a solution. But the difference is that you have three options (y/n/q) for the solution, y means agree, n disagrees, and then continue to give the next solution. q–>Quit, abandoning the installation. If it recommends you not to install at the beginning, you can choose n, and then generally speaking, the second solution will automatically downgrade the software that depends on the installation (if a series of software versions are too high), this time choose Agree that the basic installation can be successful.

Sudo aptitude install 需要安装的软件名

Guess you like

Origin blog.csdn.net/feichangyanse/article/details/129415876