From Installing to Setting Up Ubuntu 24.04


From Installing to Setting Up Ubuntu 24.04

Creating Installation Media (USB) and Installing

For Mac users:

Download Ubuntu from https://jp.ubuntu.com/download.

Write the downloaded ISO file to a USB drive.

Terminal window
sudo dd if=~/Downloads/ubuntu-24.04-desktop-amd64.iso of=/dev/disk4 status=progress

Check the target disk (e.g., of=/dev/disk4) using diskutil list.

Then install Ubuntu using the created USB drive.

https://higmasan.com/ubuntu/ubuntu24-04/install-ubuntu-24-04-lts/#toc5

Changing Home Directory Folder Names to English

Having folders like “ダウンロード” or “デスクトップ” in Japanese can be inconvenient. Revert them to English.

Terminal window
LC_ALL=C xdg-user-dirs-update --force

Use the following command to check current settings.

Terminal window
cat .config/user-dirs.dirs

Delete the Japanese-named folders.

Terminal window
rm -rf デスクトップ ダウンロード テンプレート 公開 ドキュメント ミュージック ピクチャ ビデオ

If you’re using a GUI, after reboot and login, a window may pop up asking, “Do you want to update the standard folders to match the current language?”. Check “Don’t show this again” and select “Keep old names”.

https://zenn.dev/tasiten/articles/7727537e2e975e

Switching Between Japanese and English Input

To switch between Japanese and English using Ctrl+Space:

Go to “Settings” → “Keyboard”, and add input sources for Japanese (Mozc) and English (US).

Scroll down to “Keyboard Shortcuts” → “View and Customize Shortcuts” → under “Typing”, set “Switch to Next Input Source” to Ctrl+Space.

https://qiita.com/Ryo99_1001/items/e505674d4eee7d5a60b9

Installing SSH

SSH is essential.

Terminal window
sudo apt install openssh-server

It should start automatically after installation. If not, enable it manually.

Terminal window
sudo systemctl start ssh
sudo systemctl enable ssh

Edit /etc/ssh/sshd.conf as needed.

/etc/ssh/sshd.conf
PermitRootLogin no
PubkeyAuthentication yes
PermitEmptyPasswords no
PasswordAuthentication yes
Terminal window
sudo systemctl restart sshd

https://higmasan.com/ubuntu/ubuntu24-04/enabling-ssh-connections-to-ubuntu-24-04/

sInstalling Samba

Using scp works, but mounting with Samba is more convenient.

Terminal window
sudo apt install samba

Config File

Add the following to /etc/samba/smb.conf:

/etc/samba/smb.conf
[global]
unix extensions = no
wide links = yes
[<mount name>]
path = /home/<user name>
browsable = yes
read only = no
guest ok = no
valid users = <user name>
force user = <user name>

Replace <user name> with your actual username, and <mount name> with any display name you like.

Set smbpasswd

Add an SMB password for your user.

Terminal window
# sudo smbpasswd -a <user name>

Mounting HDD

Easier to do it via GUI.

Go to “Utilities” → “Disks”.

apt-clone

If you’re managing multiple (compute) servers, using apt-clone makes replicating environments easier.

On the source server

Terminal window
sudo apt update & upgrade
sudo apt install apt-clone
sudo apt-clone clone ~/hoge

Transfer the generated hoge.apt-clone.tar.gz to the destination server using scp.

On the destination server

Terminal window
sudo apt update & upgrade
sudo apt install apt-clone
sudo apt-clone restore ~/hoge.apt-clone.tar.gz

https://marumalog.hatenablog.jp/entry/2018/11/09/204219


Author

me

Fumito Iriya

Scientist (Ph.D.), Programer, Web Developer, Guitarist, Photographer

more...