2022-01-16 18:20:39 +00:00
|
|
|
---
|
|
|
|
title: "pacman"
|
|
|
|
tags: [ "Documentation", "distros" ]
|
|
|
|
---
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
Packages are kept in /var/cache/pacman/pkg.
|
|
|
|
|
|
|
|
Delete unused old packages with:
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
sudo pacman -Sc
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
Signatures are handled by the pacman-key, initially set up with:
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
sudo pacman-key --populate archlinux
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
And refreshed with:
|
|
|
|
|
|
|
|
sudo pacman-key --refresh-keys
|
|
|
|
|
|
|
|
If you have usigned keys, you can refresh with:
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
sudo pacman -Sc
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
or
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
sudo pacman -Scc
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
Reset all keys with:
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
sudo rm -r /etc/pacmand.d/gnupg/ && sudo pacman-key --init
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
If you're constantly getting 'everything corrupted, nothing upgraded', try running:
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
sudo pacman -S archlinux-keyring
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
2020-03-13 19:33:04 +00:00
|
|
|
List all orphaned packages:
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
sudo pacman -Qtdq
|
|
|
|
```
|
2023-05-27 17:07:26 +00:00
|
|
|
|
|
|
|
## Cleaning Config Files
|
|
|
|
|
|
|
|
Arch does not overwrite your changes to configuration files.
|
|
|
|
Instead, it updates them by adding the `.pacnew` suffix.
|
|
|
|
|
|
|
|
So when `/etc/pacman.conf` receives an update, this will be placed in `/etc/pacman.conf.pacnew`.
|
|
|
|
These changes must be merge manually.
|
|
|
|
|
|
|
|
Install the `pacdiff` tool to make this easier, from the `pacman-contrib` package, then simply run `sudo pacdiff` to sort through the various mergers.
|
|
|
|
|