# Ubuntu
Links: [[Linux]]
### Update package repository
```bash
sudo apt update # Update repository
sudo apt upgrade -y # Optionally upgrade all packages
```
### [Create admin user from command line](https://askubuntu.com/a/70238)
The following steps are for Ubuntu 12.04 and later:
```bash
# Create a new user philip and add to group sudo
sudo adduser philip --ingroup sudo
# Test the new user account
su - philip
# Verify superuser privileges
sudo ls -la /root
# Switch back to original acccount
exit
```
### [Set password for a user](https://www.cyberciti.biz/faq/change-a-user-password-in-ubuntu-linux-using-passwd/)
```bash
# Set a password for username max
sudo passwd max
```
### [Change hostname](https://phoenixnap.com/kb/ubuntu-20-04-change-hostname)
```bash
# Change the 'pretty' hostname which is presented only to the user,
# not another computer on the network (usually what you want)
hostnamectl set-hostname <new_hostname> --pretty
# (Optional) hange the actual hostname
hostnamectl set-hostname <new_hostname>
# View hostname info
hostnamectl
```
- To take effect on the [[zsh]] shell, you'll need to `exit` and `ssh` back in again.