# Linux

# 関連ページ
$lsx(.)

# ハッシュの計算方法
```bash
$ echo -n rawdata | sha1sum
```
- echoに「-n」を付けて、改行コードを出力させないようにする
    - http://d.hatena.ne.jp/bowez/20090911/p2

# upstart の initctl restart
- stop/startと挙動が違い、最初にstartされたときの設定を持ち続ける
    - reload-configurationしてもダメ
    - http://upstart.ubuntu.com/cookbook/#restart

# kernel お掃除
- apt-get autoremove で消してみる
    ```bash
    $ sudo apt-get autoremove --purge
    ```
- ↑で消えない場合は、以下の方法を使う
    ```bash
    $ dpkg -l linux-{{image,modules}{,-extra},headers}-"[0-9]*" | awk '/^(pi|i[iUF]|rc)/{ print $2; }' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]' | grep -v <インストールされている kernel の中で最新バージョン> | xargs sudo dpkg -P
    ```
    - 現在起動しているバージョンを除く、全バージョンを purge する dpkg one-liner

# apt 時に出る libvirt-bin 関連のエラー
- 以下のエラーが出た場合は、apt 実行前に `pkill -f libvirtd` してあげる
    ```
    Preparing to unpack .../tzdata_2018i-0ubuntu0.16.04_all.deb ...
    Unpacking tzdata (2018i-0ubuntu0.16.04) over (2018g-0ubuntu0.16.04) ...
    Setting up libvirt-bin (1.3.1-1ubuntu10.24) ...
    Job for libvirt-bin.service failed because the control process exited with error code. See "systemctl status libvirt-bin.service" and "journalctl -xe" for details.
    invoke-rc.d: initscript libvirt-bin, action "restart" failed.
    dpkg: error processing package libvirt-bin (--configure):
     subprocess installed post-installation script returned error exit status 1
    ```
- 参考
    - https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1547208/comments/18
    - libvirtd を落としたからと言って VM が落ちるわけではないのでコマンド実行に躊躇しなくてよい


---

## Page Navigation

- Canonical URL: https://tips.weseek.co.jp/Tips/Linux
- Permalink: https://tips.weseek.co.jp/5fc0ae238b05ce0048ff5a31
- Parent: [Tips](/5e44f1546857420048c06de8.md)
- Children: 2 total
  - [Debian／Ubuntu](/5fc0ae498b05ce0048ff5a3b.md)
  - [［sh］ Tomcatの起動と終了](/5fc0aed08b05ce0048ff5a51.md)
- Total descendants: 2
- Siblings: 49 of 71 total (22 more not shown; see the page list API below for the full listing)
  - [Admin.js](/6505e03558d21abbb3ac8575.md)
  - [Agile](/5fb747a7a1ba4200489a4a89.md)
  - [Amazon Web Services(AWS)](/5fb748c9a1ba4200489a4acc.md)
  - [Angular](/65069da24603e7ff39a6b3d6.md)
  - [Ansible](/6505dfaa58d21abbb3ac837d.md)
  - [Apache2](/65069da24603e7ff39a6b3d5.md)
  - [Base64と仲良くなる](/5e9309f511007300489677f8.md)
  - [BuildKitによりDockerとDocker Composeで外部キャッシュを使った効率的なビルドをする方法](/5e67aea878bd2f0048680af1.md)
  - [CSS](/5fb74873a1ba4200489a4abb.md)
  - [Cocos-creator](/5fb74b6aa1ba4200489a4b2e.md)
  - [GROWI開発の知見でLINE_bot作ってみた](/5fd1d3fa0899d80049ff9a1c.md)
  - [Git](/5fb748dfa1ba4200489a4ad7.md)
  - [Grails](/65069da24603e7ff39a6b3f0.md)
  - [Hyperledger fabric](/5fcb12a2550066004845743c.md)
  - [Java](/5fb74daba1ba4200489a4ba8.md)
  - [JavaScript](/5fb74e7aa1ba4200489a4bd1.md)
  - [Jenkins](/5fb74feba1ba4200489a4c17.md)
  - [KVM](/5fbdbc17daa51800482d2227.md)
  - [Keycloak](/5fbdbffcdaa51800482d22b3.md)
  - [Kubernetes](/600522a79662740048b34bb5.md)
  - [Let's Encrypt](/65069da24603e7ff39a6b3d8.md)
  - [MongoDB](/5fc0af488b05ce0048ff5a6b.md)
  - [Mutagen](/6505de1458d21abbb3ac7ecd.md)
  - [Node.js](/60a62549a0d804004912d94b.md)
  - [OpenLDAP](/5fcda4862553a0004852b0dd.md)
  - [Prometheus](/5fc0b3058b05ce0048ff5af6.md)
  - [Python](/5fc0b3218b05ce0048ff5b00.md)
  - [RaspberryPiとArduinoで作る360度回転リモートワークカメラ](/5fccce3e3a4fec004844a01b.md)
  - [RaspberryPiとArduinoで作る360度回転リモートワークカメラ_ソフトウェア構築編](/5fdab8ad04dc4f00483b8d20.md)
  - [RaspberryPiとArduinoで作る360度回転リモートワークカメラ_ハードウェア製作編](/5fd7972a5fc9220048844c35.md)
  - [Redmine](/5fcd9bdd2553a0004852b012.md)
  - [Ruby](/5fc0b2588b05ce0048ff5ada.md)
  - [Single Sign On(SSO)](/5e97bf6876311900487c3c55.md)
  - [Slack](/5fc0ae7b8b05ce0048ff5a45.md)
  - [SourceTree](/5fc0ae0c8b05ce0048ff5a2b.md)
  - [StackStorm(st2)](/65069da24603e7ff39a6b3da.md)
  - [Stripe](/5fc0aff58b05ce0048ff5a8d.md)
  - [Tomcat](/5fcda2772553a0004852b0ac.md)
  - [Turborepo](/6505dee958d21abbb3ac80cf.md)
  - [TypeScript](/5fc0a7ac8b05ce0048ff58f4.md)
  - [URLでベーシック認証を突破](/5fc0b2d98b05ce0048ff5af2.md)
  - [Unity](/5fc0ace98b05ce0048ff59f5.md)
  - [VSCode](/5e9b270093fd090048cc8acb.md)
  - [WSL2](/65069da24603e7ff39a6b403.md)
  - [Wordpress](/5fc0af488b05ce0048ff5a6d.md)
  - [XSS](/5fbe723e36ac6300497c2194.md)
  - [brigade](/600523119662740048b34be0.md)
  - [cert-manager](/65069da24603e7ff39a6b3f9.md)
  - [devcontainer](/5fd54b8eedce4f00482fa36d.md)
- Last updated: 2020-11-27T07:43:31.212Z by syunsuke
- Full page listing (all children regardless of count): https://tips.weseek.co.jp/_api/v3/page-listing/children?id=5fc0ae238b05ce0048ff5a31
