Ubuntu Commands

Table of Contents

Misc. Ubuntu commands.

Remove Pre-installed

If you don’t know what they are …

1
apt purge cloud-* snapd whoopsie* unattended-upgrades ubuntu-advantage-tools

If not using LVM, LXC/LXD

1
apt purge lvm2 lxd lxcfs

If completely rely on journald.

1
apt purge rsyslog libestr0 libfastjson4

Get Version

1
lsb_release -r

Change Timezone

1
dpkg-reconfigure tzdata

systemd-resolver

Ubuntu/Systemd use systemd-resolver for dns lookup and /etc/resolve.conf no longer show the actual upstream dns. Use following to check and change.

Show DNS Settings

1
resolvectl

Change DNS

1
2
resolvectl dns <interface> <dns1> <dns2> ...
resolvectl dns enp0s2 8.8.8.8 8.8.4.4 1.1.1.1

Change Search Domain

1
2
resolvectl domain <interface> <domain>
resolvectl domain enp0s2 johnsiu.com

Disable CPU mitigations

Do this at your own risk.

/etc/default/grub

1
GRUB_CMDLINE_LINUX_DEFAULT="noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off mitigations=off"

Update GRUB

1
2
3
update-grub
grub-install <boot disk>
grub-install /dev/sda

Update Initramfs

This is needed if module used during boot is changed.

1
update-initramfs -u

Ubuntu Release Upgrade

1
2
apt install update-manager-core
do-release-upgrade -d
John Siu
Minimize the Effort, Maximize the Effect!
comments powered by Disqus