Ubuntu のメモ
#tech #deprecated
ホームディレクトリを英語にする
日本語になってるフォルダの中身を空にしてから
LANG=C xdg-user-dirs-gtk-update
「Don't ask me this again」にチェックをいれて一応再起動
apt のサブコマンド
https://qiita.com/SUZUKI_Masaya/items/1fd9489e631c78e5b007
apt full-upgrade と apt-get dist-upgrade
https://askubuntu.com/questions/770135/apt-full-upgrade-versus-apt-get-dist-upgrade
同じらしい
これらはパッケージの更新や削除も行うため保留になっているものをインストールできる
add-apt-repository がない
sudo apt install software-properties-common で入る
リポジトリの一覧を確認する
https://askubuntu.com/questions/148932/how-can-i-get-a-list-of-all-repositories-and-ppas-from-the-command-line-into-an
そういうコマンドはないらしい
/etc/apt/sources.list と /etc/apt/sources.list.d をスクリプトで処理するしかない
追加したリポジトリを削除する
sudo add-apt-repository -r repository
apt remove と apt remove --purge と apt purge
apt purge は apt remove --purge のエイリアス
apt purge は /etc の設定ファイルも消してくれる
インストールされているものの一覧
https://askubuntu.com/questions/17823/how-to-list-all-installed-packages
apt list --installed や apt-mark showmanual などがあるが自分が入れたものだけを表示するのは難しいようだ
新しいLTSに更新する
https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes#Upgrading_from_Ubuntu_16.04_LTS_or_17.10
https://qiita.com/TsutomuNakamura/items/bbd712e3afe5f4bacfac
Prompt=normal で sudo do-release-upgrade を実行すれば更新できるが、普通は Prompt=lts でよい
パッケージ
gdebi
debの依存関係を解決してくれる
インストールした際のdebを残しておけば、アンインストールする際依存関係ごと消してくれる
sshuttle
https://github.com/apenwarr/sshuttle
sshuttle -r hostname 0/0 のようにしてsshを使ってvpnができる
hostname には ~/.ssh/config に書いてあるものも指定できる
texlive-full
巨大だが比較的軽量なDockerfileもある
https://hub.docker.com/r/paperist/alpine-texlive-ja/
gnuplot
いくつかあるが gnuplot で全部入りのが入る
grub-efi-amd64-signed, shim-signed
grub-install: error: cannot find EFI directory.
と出ることがある
これはUbuntuでは /boot/efi が起動時にマウントないためで、
code:sh
$ sudo mount /boot/efi
$ sudo apt upgrade
のようにマウントしてからであればうまくいく