Skip to content

Commit dfccd94

Browse files
Update package manager troubleshooting commands (#1347)
* Update package manager troubleshooting commands Added command to clean APT repository metadata. * Tweak flags & description of new apt list rm command * Add new apt list rm command & apt clean description to Ubuntu article This matches the previous commits' additions to the Pop!_OS article. * Fix punctuation order for mid-sentence parenthetical at end of sentence --------- Co-authored-by: Jacob Kauffmann <jacob@system76.com>
1 parent 17305d5 commit dfccd94

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

content/package-manager-pop.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ If your system complains about a failed upgrade, package manager conflicts, brok
2424

2525
```bash
2626
sudo apt clean
27+
sudo rm -r /var/lib/apt/lists/*
2728
sudo apt update
2829
sudo dpkg --configure -a
2930
sudo apt install -f
@@ -33,12 +34,13 @@ sudo apt autoremove --purge
3334

3435
### What Do These Do?
3536

36-
- `apt clean` - The `clean` command clears out the local repository of retrieved package files.
37+
- `apt clean` - The `clean` command clears out the local repository of retrieved package files (including older versions) from `/var/cache/apt/archives/`.
38+
- `sudo rm -r /var/lib/apt/lists/*` - This command clears all locally cached apt repository metadata (package lists and index files). This forces apt to fully re-fetch and rebuild its database of available packages on the next `apt update`.
3739
- `apt update` - the `update` option fetches indexes from all configured sources. These indexes are used by other apt options to determine which packages can be upgraded or installed.
3840
- `dpkg --configure -a` - The `--configure -a` command configures any unpacked but not yet configured packages.
3941
- `apt install -f` - The `-f` option attempts to correct broken dependencies
4042
- `apt full-upgrade` - In addition to downloading and installing package updates, `full-upgrade` downgrades or removes dependencies as necessary when upgrading packages.
41-
- `apt autoremove --purge` - Running this command with no specified package will remove any packages that were previously dependencies for other installed packages but are no longer required (either because the dependent package was removed, or because the package was updated to no longer depend on certain packages.)
43+
- `apt autoremove --purge` - Running this command with no specified package will remove any packages that were previously dependencies for other installed packages but are no longer required (either because the dependent package was removed, or because the package was updated to no longer depend on certain packages).
4244

4345
### Fix Individual Packages
4446

content/package-manager-ubuntu.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ If your system complains about a failed upgrade, package manager conflicts, brok
2424

2525
```bash
2626
sudo apt clean
27+
sudo rm -r /var/lib/apt/lists/*
2728
sudo apt update
2829
sudo dpkg --configure -a
2930
sudo apt install -f
@@ -33,12 +34,13 @@ sudo apt autoremove --purge
3334

3435
## What Do These Do?
3536

36-
- `apt clean` - The `clean` command clears out the local repository of retrieved package files.
37+
- `apt clean` - The `clean` command clears out the local repository of retrieved package files (including older versions) from `/var/cache/apt/archives/`.
38+
- `sudo rm -r /var/lib/apt/lists/*` - This command clears all locally cached apt repository metadata (package lists and index files). This forces apt to fully re-fetch and rebuild its database of available packages on the next `apt update`.
3739
- `apt update` - the `update` option fetches indexes from all configured sources. These indexes are used by other apt options to determine which packages can be upgraded or installed.
3840
- `dpkg --configure -a` - The `--configure -a` command configures any unpacked but not yet configured packages.
3941
- `apt install -f` - The `-f` option attempts to correct broken dependencies
4042
- `apt dist-upgrade` - In addition to downloading and installing package updates, `dist-upgrade` downgrades or removes dependencies as necessary when upgrading packages. Dist-upgrade also has a conflict resolution system that will prioritize upgrading more important packages if needed.
41-
- `apt autoremove --purge` - Running this command with no specified package will remove any packages that were previously dependencies for other installed packages but are no longer required (either because the dependent package was removed, or because the package was updated to no longer depend on certain packages.)
43+
- `apt autoremove --purge` - Running this command with no specified package will remove any packages that were previously dependencies for other installed packages but are no longer required (either because the dependent package was removed, or because the package was updated to no longer depend on certain packages).
4244

4345
### Fix Individual Packages
4446

0 commit comments

Comments
 (0)