Although apt-get is a very intelligent package manager, there will inevitably be some problems, so this page collects the most common errors and solutions.
Problem one
Terminal appears:
E: The subprocess /usr/bin/dpkg returned an error code (1).
Solution, terminal execution:
cd /var/lib/dpkg
sudo mv info info.bak
Sudo mkdir information
Sudo dpkg-configuration -a
Sudo apt-get installation
sudo mv/var/lib/dpkg/info/*/var/lib/dpkg/info . bak
sudo rm -rf /var/lib/dpkg/info
sudo mv/var/lib/dpkg/info . bak/var/lib/dpkg/info
Question 2
When using apt-get command to install software, the terminal prompts:
E: Unable to get the lock/var/lib/dpkg/lock-open (11:resources are temporarily unavailable).
E: Unable to lock the management directory (/var/lib/dpkg/). Is it occupied by another process?
The solution is as follows:
Method one
Please open the package manager (such as apt-get or
Aptitude) is running. If you don't know which program it is, please turn it off first, and open the terminal to check the programs related to apt-get, the numbers before sudo kill. Or you can restart your computer.
Method 2
Open the terminal and execute the following commands in turn:
sudo RM/var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
sudo rm /var/lib/apt/lists/lock
Note: Method 2 is applicable when method 1 is invalid.
Question 3
Use apt-get to refresh the source, and the terminal appears:
E: Some index files failed to download. They are ignored or replaced by old ones.
The solution is as follows:
Method one
Check the error message in detail. If it is caused by PPA source, please delete the invalid PPA source.
Method 2
If it is because the official default source has been modified, you can restore the default source to the Deepin default source.
Method 3
There may be something wrong with the server. Please wait a moment, and then refresh the local source list again. If it still doesn't work, try terminal execution:
sudo RM/var/lib/apt/lists/partial/*
Sudo apt-get update
Question 4
Use apt-get to refresh the source code, and the terminal prompts:
W: GPG error: dapper Release: the following signature cannot be verified because there is no public key: no _ pubkey06ea41de4f6c1e86.
Solution, terminal execution:
gpg-key server subkeys.pgp.net-recv 4f6c 1e 86
gpg-export-armor 4f6c 1e 86 | sudo apt-key add-
Note: If other public keys are missing, just change the two digits 4F6C 1E86 in the command to the last eight digits in NO _ pubkey06EA41de4f6c1E86!
If it is a PPA source, execute:
sudo apt-key adv-recv-keys-key server keyserver.ubuntu.com
Question 5
Use apt-get to install the software, and the terminal prompts:
E: dpkg interrupt. You must manually run sudo DPKG- configuration -a to solve this problem.
Solution, according to the prompt. Terminal execution:
Sudo dpkg-configuration -a
If it still doesn't work, execute:
sudo rm /var/lib/dpkg/updates/*
Sudo apt-get update
Sudo apt-get upgrade
Question 6
Terminal prompt:
E: The problem cannot be corrected. You have damaged packaging.
This problem is generally a dependency problem. Try to execute on the terminal:
Sudo apt-get installation
If it is invalid, execute:
Sudo dpkg-configuration -a
Or the software package causing the dependency problem can be deleted according to the complete prompt of the terminal, and the terminal executes:
Sudoapt-getremovxxx # # xxx is the name of the package that caused the dependency problem.
Then, the terminal performs:
Sudo apt-get update
Question 7
Terminal appears:
E: there is a problem with the part without Package: header, e: mergelist/var/lib/apt/lists/archive.canonical.com _ dists _ maverick _ partner _ binary-i386 _ packages.
E: Unable to parse or open the package list or status file. '
Solution, terminal execution:
sudo RM-RF/var/lib/apt/lists/*-VF
Sudo apt-get update
Question 8
Why can't I install multiple softwares at the same time?
The primary reason is Linux.
Deepin is managed by DPKG package, and the software is installed by DPKG (except source code compilation software). The software under Linux has the particularity of software dependence. If multiple softwares are installed at the same time, DPKG cannot safely record the dependent packages and main programs of the softwares.
If two or more DPKG package management are running at the same time, the management directory will not be locked, and there will be problems with software dependency, so software can only be installed one by one.
Note: Linux Deepin uses DPKG package management, so this article only applies to Linux distributions managed by DPKG package.
Question 9
Degraded software package
In some cases, we need a lower version of the software instead of the latest version, and the package manager has upgraded to the latest version for us. At this time we need to downgrade a software package. Let's demote Firefox
For example, explain how to downgrade a software package.
In Linux Deepin 12.06, Firefox has been upgraded to16.0.x.
Version, we need a lower version to achieve compatibility with some extensions.
First, we can use the following command to see which versions of Firefox are available in the software warehouse:
Apt-cache Madison Firefox
The output results are as follows:
Firefox |15.0.1+build1-0 Ubuntu 0.12.04.1|/Ubuntu/precision-security/maini386 software package.
Firefox |15.0.1+build1-0 Ubuntu 0.12.04.1|/Ubuntu/precise-updates/maini386 software package.
Firefox |11.0+build1-0 Ubuntu 4 |/Ubuntu/precision/maini386 package.
Firefox | 1 1.0+build 1-0 Ubuntu 4 |/Ubuntu/precise/main Sources
Firefox | 15 . 0 . 1+build 1-0 Ubuntu 0 . 12 . 04 . 1 |/Ubuntu/precise-security/main Sources
Firefox | 15 . 0 . 1+build 1-0 Ubuntu 0 . 12 . 04 . 1 |/Ubuntu/precise-updates/main Sources
Suppose we want to reduce to version 1 1.0, then we need to do the following:
Sudo apt-get installs Firefox =11.0+build1-0 Ubuntu 4.
Can be reduced to this version. The format of this command is:
Sudo apt-get installation pkg = version
Where pkg is the name of the software package to be downgraded and version is the version of the software package to be downgraded.
At this point, we also need to prevent the package manager from upgrading the package:
sudo echo " Firefox hold " | sudo dpkg-set-selections
At this point, the degradation process of the software package is completed.
Question 10
When the terminal installs wine software or other software, it may appear:
Package settings-TTF-mscorefonts-installer-xxxx-setting the confirmation screen.
Just press the TAB key to select the button, then press enter to type, and use
& lt No> Select the screen and select
Question eleven
Add ppa to report errors. This section is implemented as follows:
Sudo add -apt- repository ppa:×××××
The error message is as follows:
Backtracking (last call):
File "/usr/bin/add-apt-repository", line 160, located at
Sp = Software Properties (Option = Option)
The file "/usr/lib/python3/dist-
Package/Software Properties/Software Properties. py ",line 96, in init
self.reload_sourceslist()
The file "/usr/lib/python3/dist-
Packages/softwareproperties/softwareproperties.py ",line 584, in reload_sourceslist.
self . distro . get _ sources(self . sources list)
The file "/usr/lib/python3/dist-packages/apt sources/distro.py" in get_sources, line 87.
Throws a NoDistroTemplateException ("Error: Not Found"
Apt sources. distro.nodistrotemplate exception: Error: Distribution template not found.
Terminal execution "
sudo gedit/usr/share/python-apt/templates/linuxdeepin . info
increase
Suite: quantal
Warehouse type: deb
BaseURI: /deepin/
Macheli: packages.linuxdeepin.com.
mirrors file-amd64:Linux deepin . mirrors
mirrors file-i386:Linux deepin . mirrors
Description: Linux Deepin12.12' quantum'
Component: main
Component Description: Official Support
Compdescriptionlong: open source software supported by Deepin.
Component: not free
Component Description: Restricted Software
CompDescriptionLong: Software restricted by copyright or legal issues.
Then, the terminal performs:
sudo add-apt-repository PPA:realender/xxxxx
Sudo apt-get update
Sudo apt-get installation xxxx
Question 12
Error in refreshing source by terminal:
W: Unable to download bzip2, hash checksum does not match.
This may be caused by network problems, and the downloaded data is incomplete or wrong.
Run the following command to get the file address of the list of software packages to be downloaded for the update:
sudo apt-get update-print-uri & gt; apt-get-urls.txt
Download the above list file with Firefox's downloadthemall plug-in. (Open the above txt file with Firefox and download it in batches) Pay attention to the location where the file is saved, such as /home/ your user name /pool.
Rename the mask: fill in "* Curl */* Name *". *ext* "(without quotation marks).