-
Notifications
You must be signed in to change notification settings - Fork 14
/
packageManagerTroubleshootingProcedure-ubuntu.txt
377 lines (290 loc) · 12.3 KB
/
packageManagerTroubleshootingProcedure-ubuntu.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
||<tablestyle="float:right; font-size: 0.9em; width:15%; background:#F1F1ED; margin: 0 0 1em 1em;" style="padding:0.5em;"><<TableOfContents(2)>>||
This guide will help gather information that would be useful when creating a single, new question at
* https://answers.launchpad.net/ubuntu/+source/apt/+addquestion
Please only create a NEW question at https://answers.launchpad.net/ubuntu if you do not have an open question about this issue yet. If you already have an open question at https://answers.launchpad.net/ubuntu
then please add the Terminal output below to the thread which was previously opened.
In order to gather essential troubleshooting information about your apt-get or aptitude or synaptic package manager in Ubuntu, please follow this procedure.
= Step 1 First install a supported version of Ubuntu =
'''The only supported releases of Ubuntu are the ones that are NOT End of Life (EOL) in the following table:'''
https://wiki.ubuntu.com/Releases
= Step 2 Switch to "Main Server" using Software Sources =
First switch from the regional server (US, UK, Swiss, etc...) to the "Main Server" using the Software Sources window
You can open up the Software Sources window by running the Update Manager. If you are using the Gnome Classic desktop it can be found in the menu (System > Administration > Update Manager). If you are Using Unity click the top icon in the dash and search for "update manager". In the update manager click on the Settings button at the lower-left corner of the window, and entering your password if prompted to do so.
See here for details and a screenshot of the main tab of the Software Sources window:
https://help.ubuntu.com/community/Repositories/Ubuntu#Download_Server
'''If you are unable to start "Update Manager" or unable to access Software Sources or Ubuntu Software Center, please skip step 1 and step 2 and proceed to step 3.'''
= Step 3 Disable all PPA repositories =
Open "Ubuntu Software Center"
- Edit Menu
--- Select "Software Sources...", enter your password
----- Select tab "Other Software"
From the "Other Software" tab, disable all PPA repositories, leaving only the official Ubuntu repositories active. Enabling too many PPA repositories (which are non-official) can cause your package manager to become unstable. If you do decide to re-enable such a PPA repository, I strongly suggest only enabling ONE PPA repository at a time for stability reasons, not several at the same time.
= Step 4 Close all open programs =
VERY IMPORTANT! Please make sure to close all open programs, including all package managers like Synaptic, Update Manager, Software Center, Add/remove programs, etc ... No other package manager should be running while running the commands below.
= Step 5 Enable unlimited scrolling in Terminal =
Open a [[https://help.ubuntu.com/community/UsingTheTerminal#Starting%20a%20Terminal | Command-line / Terminal console]]
'''In the Ubuntu [[https://help.ubuntu.com/community/UsingTheTerminal#Starting%20a%20Terminal | Terminal console]] , make sure that unlimited scrolling is enabled:
* click on Edit > Profiles > "Default" profile > Scrolling. Choose "Unlimited" as scrolling option. Click Close and Close again.'''
If you are using the Gnome interface, open [[https://help.ubuntu.com/community/UsingTheTerminal#Starting%20a%20Terminal | the Terminal console]] via "Applications->Accessories->Terminal"
If you are using the Unity interface, the easiest way to open the Terminal is to use the 'search' function on the dash.
Or you can click on the 'More Apps' button, click on the 'See more results' by the installed section, and find it in that list of applications.
A third way, available after you click on the 'More Apps' button, is to go to the search bar, and see that the far right end of it says 'All Applications'. You then click on that, and you'll see the full list. Then you can go to Accessories > Terminal after that.
So the methods in Unity are:
Press CTRL-ALT-T key combination.
Dash > Search for Terminal
Dash > More Apps > 'See More Results' > Terminal
Dash > More Apps > Accessories > Terminal
= Step 6 List of Terminal commands to execute and send to Launchpad Answers forum =
Please copy-paste the following commands one line at a time from the https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure
website using Chromium or Firefox into the Linux Terminal.
Tip: If you have a wheel mouse or 3 button mouse you do not need to type commands into the Terminal. Highlight each command on the page using the mouse. Move your cursor anywhere in the Terminal and press the wheel or middle button. Automatic Copy and paste! No spelling mistakes! No Typos! No other errors!
{{{
ubuntu-support-status
}}}
{{{
cat /etc/dpkg/dpkg.cfg.d/multiarch
}}}
{{{
dpkg --print-foreign-architectures
}}}
{{{
sudo grep -R roxy /etc/apt/*
}}}
{{{
grep roxy /etc/environment
}}}
{{{
echo $http_proxy
}}}
{{{
echo $ftp_proxy
}}}
{{{
grep roxy /etc/bash.bashrc
}}}
{{{
grep roxy ~/.bashrc
}}}
{{{
cat /etc/apt/apt.conf
}}}
{{{
sudo fuser -vvv /var/lib/dpkg/lock
}}}
{{{
sudo fuser -vvv /var/cache/apt/archives/lock
}}}
{{{
cat /etc/lsb-release
}}}
{{{
uname -a
}}}
{{{
sudo rm /var/lib/apt/lists/lock
}}}
{{{
sudo rm /var/cache/apt/archives/lock
}}}
{{{
sudo rm /var/lib/dpkg/lock
}}}
{{{
sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
}}}
{{{
sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
}}}
{{{
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status || sudo cp /var/backups/apt.extended_states.0 /var/lib/dpkg/status
}}}
{{{
sudo mv /var/lib/dpkg/available /var/lib/dpkg/available-bad
}}}
{{{
sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
}}}
{{{
sudo rm -rf /var/lib/dpkg/updates/*
}}}
{{{
sudo rm -rf /var/lib/apt/lists
}}}
{{{
sudo rm /var/cache/apt/*.bin
}}}
{{{
sudo mkdir /var/lib/apt/lists
}}}
{{{
sudo mkdir /var/lib/apt/lists/partial
}}}
{{{
LANG=C;sudo apt-get clean
}}}
{{{
LANG=C;sudo apt-get autoclean
}}}
{{{
sudo dpkg --configure -a
}}}
{{{
sudo dpkg --clear-avail
}}}
{{{
LANG=C;sudo apt-get -f install
}}}
{{{
LANG=C;sudo apt-get --fix-missing install
}}}
{{{
LANG=C;sudo apt-get --purge autoremove
}}}
{{{
LANG=C;sudo apt-get --fix-missing update -o APT::Cache-Limit=100000000
}}}
{{{
LANG=C;sudo apt-get update -o APT::Cache-Limit=100000000 && sudo apt-get dist-upgrade
}}}
{{{
find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;
}}}
{{{
sudo dpkg --audit
}}}
= Step 7 Please send us the Terminal output =
Please do NOT attempt to send any attachment(s). Please copy/paste the full terminal output of the previous list of diagnostic commands at this location:
https://answers.launchpad.net/ubuntu/+source/apt/+addquestion
Please only create a NEW question at https://answers.launchpad.net/ubuntu if you do not have an open question about this issue yet. If you already have an open question at https://answers.launchpad.net/ubuntu
then please add the Terminal output below to the thread which was previously opened.
The troubleshooters at Launchpad need to see the full Terminal output from running the previous list of diagnostic commands.
= Step 8 Error occurs while trying to remove or upgrade a specific software package =
If a package manager error occurs while trying to remove or upgrade a specific software package, please try the following workaround procedures:
http://askubuntu.com/questions/91543/apt-get-update-fails-to-fetch-files-temporary-failure-resolving-error
http://aziest.wordpress.com/2011/01/24/how-to-increase-your-apt-cache-limit/
http://www.cyberciti.biz/tips/troubleshooting-debian-ubuntu-package-upgrades-removals.html
http://www.ubuntugeek.com/package-installation-error-and-solution.html
The troubleshooters at Launchpad need to see the full Terminal output from running the above command.
If the previous apt-get update command returned any "404 Not Found" errors for certain Launchpad PPA's, then please open Software Sources via dash or System Settings and unmark/deactivate those failed Launchpad PPA's in Software Sources.
= Step 9 =
If you are using the 64-bit edition of Ubuntu and if you are still encountering issues when trying to install certain Ubuntu packages, I suggest executing the following commands:
{{{
sudo dpkg --add-architecture i386
}}}
{{{
sudo apt-get update
}}}
= Step 10 Ubuntu Software Center fails to open =
If the Ubuntu Software Center fails to open, then please execute these Terminal commands:
{{{
sudo rm /usr/lib/python*/dist-packages/__pycache__/*pyc
}}}
{{{
sudo apt-get install --reinstall python3-gi
}}}
{{{
sudo apt-get purge software-center gnome-software
}}}
{{{
rm -rf ~/.cache/software-center
}}}
{{{
rm -rf ~/.config/software-center
}}}
{{{
rm -rf ~/.cache/update-manager-core
}}}
{{{
rm ~/.local/share/gnome-software/*
}}}
{{{
sudo rm /var/lib/apt-xapian-index/cataloged_times.p
}}}
{{{
sudo rm /var/lib/apt-xapian-index/values
}}}
{{{
sudo update-apt-xapian-index --verbose --force
}}}
{{{
sudo update-apt-xapian-index --force
}}}
{{{
sudo apt-get update
}}}
{{{
sudo apt-get dist-upgrade
}}}
{{{
sudo apt-get install software-center gnome-software
}}}
{{{
sudo dpkg-reconfigure software-center --force
}}}
{{{
sudo update-software-center
}}}
{{{
sudo apt-get install --reinstall software-center gnome-software
}}}
Then reboot and retest.
Sources:
https://bugs.launchpad.net/ubuntu/+source/software-center/?field.searchtext=&orderby=-importance&field.status%3Alist=CONFIRMED&field.status%3Alist=TRIAGED&assignee_option=any&field.assignee=&field.bug_reporter=&field.bug_commenter=&field.subscriber=&field.tag=&field.tags_combinator=ANY&field.status_upstream-empty-marker=1&field.upstream_target=&field.has_cve.used=&field.omit_dupes.used=&field.omit_dupes=on&field.affects_me.used=&field.has_patch.used=&field.has_branches.used=&field.has_branches=on&field.has_no_branches.used=&field.has_no_branches=on&field.has_blueprints.used=&field.has_blueprints=on&field.has_no_blueprints.used=&field.has_no_blueprints=on&search=Search
http://ubuntuforums.org/showthread.php?t=2033381
http://askubuntu.com/questions/69034/software-center-will-not-open
https://answers.launchpad.net/ubuntu/+source/software-center/+question/219728
https://answers.launchpad.net/ubuntu/+source/update-manager/+question/213929
https://askubuntu.com/questions/853705/gnome-software-centre-crashes-in-ubuntu-16-04
= Step 11 You are using a proxy server to connect to the Internet =
If you are using a proxy server, please make sure the following changes have been made in Ubuntu:
1) put the following configuration lines in the '''/etc/bash.bashrc''' file:
{{{
export http_proxy=http://<username>:<password>@<proxy>:<port>/
}}}
{{{
export https_proxy=https://<username>:<password>@<proxy>:<port>/
}}}
{{{
export ftp_proxy=ftp://<username>:<password>@<proxy>:<port>/
}}}
but REPLACING the values for username, password, proxy and port number, of course.
You can edit the '''/etc/bash.bashrc''' file using this command:
{{{
gksudo gedit /etc/bash.bashrc
}}}
2) put the following configuration lines in the '''/etc/environment''' file:
{{{
http_proxy=http://<username>:<password>@<proxy>:<port>/
}}}
{{{
https_proxy=https://<username>:<password>@<proxy>:<port>/
}}}
{{{
ftp_proxy=ftp://<username>:<password>@<proxy>:<port>/
}}}
but REPLACING the values for username, password, proxy and port number, of course.
You can edit the '''/etc/environment''' file using this command:
{{{
gksudo gedit /etc/environment
}}}
3) put the following configuration lines in a new '''/etc/apt/apt.conf.d/80proxy''' file:
{{{
Acquire::http::proxy "http://<username>:<password>@<proxy>:<port>/";
}}}
{{{
Acquire::ftp::proxy "ftp://<username>:<password>@<proxy>:<port>/";
}}}
{{{
Acquire::https::proxy "https://<username>:<password>@<proxy>:<port>/";
}}}
but REPLACING the values for username, password, proxy and port number, of course.
You can edit the '''/etc/apt/apt.conf.d/80proxy''' file using this command:
{{{
gksudo gedit /etc/apt/apt.conf.d/80proxy
}}}
= More documentation about the apt-get package manager =
http://www.binarytides.com/apt-get-tutorial-package-management-ubuntu-commandline/
http://www.tecmint.com/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management/
http://www.tuxarena.com/intro/ubuntu001.php
= More documentation about the AppGrid Lightweight Software Center Alternative to Ubuntu Software Center, Available for Ubuntu 13.04 Raring =
http://www.noobslab.com/2013/08/appgrid-lightweight-software-center.html