【Linux】viコマンドでE325: ATTENTIONエラーの対処方法

Ubuntuでネットワークの設定をするために、ファイルの設定をいじっていた時に出たエラーについての備忘メモです。

エラーの中身
E325: ATTENTION
Found a swap file by the name "/etc/netplan/.01-network-manager-all.yaml.swp"
          owned by: root   dated: Thu Jun 20 14:38:37 2024
         file name: /etc/netplan/01-network-manager-all.yaml
          modified: YES
         user name: root   host name: Test-Ubuntu001
        process ID: 2528 (STILL RUNNING)
While opening file "/etc/netplan/01-network-manager-all.yaml"
             dated: Thu Jun 20 17:10:52 2024
      NEWER than swap file!

(1) Another program may be editing the same file.  If this is the case,
    be careful not to end up with two different instances of the same
    file when making changes.  Quit, or continue with caution.
(2) An edit session for this file crashed.
    If this is the case, use ":recover" or "vim -r /etc/netplan/01-network-mana
er-all.yaml"                                                                   g
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file "/etc/netplan/.01-network-man
ger-all.yaml.swp"                                                              a
    to avoid this message.

Swap file "/etc/netplan/.01-network-manager-all.yaml.swp" already exists!
原因

前回のファイル操作時に保存せずに終了(Ctrl + Cなど)した場合に発生するエラーとなります。

対処

ls -laでswapファイルを見つけrmで削除します。

cisco@inserthostname-here:/etc/netplan$ 
cisco@inserthostname-here:/etc/netplan$ ls -la
total 32
drwxr-xr-x   2 root root  4096 Jun 20 17:12 .
drwxr-xr-x 146 root root 12288 Jun 20 14:10 ..
-rw-r--r--   1 root root 12288 Jun 20 14:38 .01-network-manager-all.yaml.swp
-rw-r--r--   1 root root  1121 Jun 20 17:10 01-network-manager-all.yaml
cisco@inserthostname-here:/etc/netplan$ 
cisco@inserthostname-here:/etc/netplan$ sudo rm .01-network-manager-all.yaml.swp 
cisco@inserthostname-here:/etc/netplan$ 
cisco@inserthostname-here:/etc/netplan$ ls -la
total 20
drwxr-xr-x   2 root root  4096 Jun 20 17:19 .
drwxr-xr-x 146 root root 12288 Jun 20 14:10 ..
-rw-r--r--   1 root root  1121 Jun 20 17:10 01-network-manager-all.yaml
cisco@inserthostname-here:/etc/netplan$ 
cisco@inserthostname-here:/etc/netplan$ 

上記で対処完了です。

コメント

タイトルとURLをコピーしました