srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/linux/linux-troubleshoot.md
blob: 5983360a3811f26861535e3eefeeafe3c6fc72b5 (plain) (blame)
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
## Useful troubleshooting commands/tools

#### Internet/network:

- ifconfig (install net-tools)
  - Manage interface configurations/parameters
  - Enable/disable a network interface
  - View all available interfaces, IP addresses, hardware addresses
  - Assign an IP address and netmask to a selected interface
- ip
  - Alternate to ifconfig, display network interfaces and configure network devices
  - Interact with layers of TCP/IP protocol (Data link layer and Network layer)
  - Can show and modify kernal routing tables (+/- ARP cache entries)

---

#### Reload a program from tty if gui becomes unresponsive

```bash
$ DISPLAY=:<n> <name of program>
```

Example:

```bash
$ DISPLAY=:0 xterm &
$ DISPLAY=:0 sxhkd &
```

---

#### Fix pacman keyring errors

```bash
$ pacman-key --init && pacman-key --populate archlinuxarm
$ sudo rm /var/lib/pacman/db.lck
```

---

#### Clean package manager's cache (apt/pacman)

apt:

```bash
$ sudo apt-get clean
$ sudo apt-get autoclean
```

pacman:

```bash
$ paccache -r # requires pacman-contrib
$ sudo pacman -Scc
```

---

#### Unlocking a Linux User Account After Too Many Failed Attempts

```bash
$ faillock --user $USER --reset
```

---

#### Find top 10 largest files

```bash
$ find /path/to/dir/ -printf '%s %p\n'| sort -nr | head -10
$ find . -printf '%s %p\n'| sort -nr | head -10
```