「インストール - BleachBit」の版間の差分

提供: MochiuWiki : SUSE, EC, PCB

 
(同じ利用者による、間の1版が非表示)
27行目: 27行目:
  sudo dnf install gtk3 python3-chardet python3-gobject gettext
  sudo dnf install gtk3 python3-chardet python3-gobject gettext
   
   
  # SUSE
  # SUSE 16
  # 例: <u>Python 3.11を使用する場合</u>
sudo zypper install python3-chardet python3-gobject gettext
  # SUSE 15 (例: <u>Python 3.11を使用する場合</u>)
  sudo zypper install python311-chardet python311-gobject gettext
  sudo zypper install python311-chardet python311-gobject gettext
   
   
57行目: 59行目:
<br>
<br>
コマンドを入力することが面倒な場合は、以下のようにシェルスクリプトを作成して実行するとよい。<br>
コマンドを入力することが面倒な場合は、以下のようにシェルスクリプトを作成して実行するとよい。<br>
<br>
<syntaxhighlight lang="sh">
  # bleachbit.sh
  # bleachbit.sh
   
   
  #!/bin/bash
  #!/usr/bin/env sh
   
   
  python3 ./bleachbit.py
  python3 ./bleachbit.py
</syntaxhighlight>
<br>
<br>
<syntaxhighlight lang="sh">
  # bleachbit_as_root.sh
  # bleachbit_as_root.sh
   
   
  #!/bin/bash
  #!/usr/bin/env sh
   
   
  xdg-su -c ./bleachbit.py
  xdg-su -c ./bleachbit.py
</syntaxhighlight>
<br>
<br>


150行目: 157行目:


== エラー関連 ==
== エラー関連 ==
==== 起動しない ====
==== グラフィカルモードで起動しない ====
GUI.pyファイルにおいて、from gi.repository import AppIndicator3 as AppIndicator の直前に、gi.require_version('AppIndicator3', '0.1') という行を追加する。<br>
GUI.pyファイルにおいて、from gi.repository import AppIndicator3 as AppIndicator の直前に、gi.require_version('AppIndicator3', '0.1') という行を追加する。<br>
また、例外処理を except ImportError: から except (ValueError, ImportError): に変更する。<br>
また、例外処理を except ImportError: から except (ValueError, ImportError): に変更する。<br>

2026年6月30日 (火) 01:43時点における最新版

概要

BleachBitは、高速で安全なシステムクリーナである。
削除したい項目にチェックを入力するだけで、キャッシュ、ログ、Cookie、最近使用したファイルのリストなどの不要なファイルを削除できる。


BleachBitのインストール

パッケージ管理システムからインストール

パッケージ管理システムを使用してインストールする場合は、以下のコマンドを実行する。

# RHEL
sudo dnf install bleachbit

# SUSE
sudo zypper install bleachbit

# Manjaro ARM
sudo pacman -S --needed bleachbit

# Mobian
sudo apt install bleachbit


ソースコードからインストール

※注意
BleachBit 5.0以降、Python 3.8以降が必要なことに注意する。

まず、依存関係のライブラリをインストールする。

# RHEL
sudo dnf install gtk3 python3-chardet python3-gobject gettext

# SUSE 16
sudo zypper install python3-chardet python3-gobject gettext

# SUSE 15 (例: Python 3.11を使用する場合)
sudo zypper install python311-chardet python311-gobject gettext

# Manjaro ARM
sudo pacman -S --needed gtk3 python3-chardet python3-gobject gettext

# Mobian
sudo apt install libgtk-3-0 python3-chardet python3-gi gettext


次に、BleachBitの公式Webサイトから、ソースコードをダウンロードする。
ダウンロードしたファイルを解凍する。

tar xf bleachbit-<バージョン>.tar.gz
cd bleachbit-<バージョン>


または、Gitを使用してソースコードをダウンロードする。

git clone https://github.com/bleachbit/bleachbit.git
cd bleachbit


マルチ言語を使用する場合は、以下のコマンドを実行する。

make -C po local


BleachBitを起動するには、以下のコマンドを実行する。

# 一般ユーザとして実行
python3 ./bleachbit.py

# スーパーユーザとして実行
xdg-su -c ./bleachbit.py


コマンドを入力することが面倒な場合は、以下のようにシェルスクリプトを作成して実行するとよい。

 # bleachbit.sh
 
 #!/usr/bin/env sh
 
 python3 ./bleachbit.py


 # bleachbit_as_root.sh
 
 #!/usr/bin/env sh
 
 xdg-su -c ./bleachbit.py


デスクトップエントリファイルの作成

以下の例では、一般ユーザ向けおよびスーパユーザ向けの2つのデスクトップエントリファイルを作成している。

まず、BleachBitの起動スクリプトを、BleachBitのインストールディレクトリに作成する。

 # BleachBit.sh
 
 #!/usr/bin/env sh
 
 appname="bleachbit.py"
 
 # new dirname procedure
 # use -f to make the readlink path absolute
 dirname="$(dirname -- "$(readlink -f -- "${0}")" )"
 
 if [ "$dirname" = "." ]; then
    dirname="$PWD/$dirname"
 fi
 
 cd $dirname
 
 # 環境変数を設定
 export PATH="${dirname}:$PATH"
 export LD_LIBRARY_PATH="${dirname}:$LD_LIBRARY_PATH"
 
 # BleachBitの実行
 "$dirname/$appname" "$@"


次に、デスクトップエントリファイルを作成する。

 # BleachBit.desktop (一般ユーザ向け)
 
 #!/usr/bin/env xdg-open
 [Desktop Entry]
 Version=1.1
 Type=Application
 Name=BleachBit x.x.x
 GenericName=BleachBit
 Comment=Free space and maintain privacy
 Exec=/<BleachBitのインストールディレクトリ>/StartBleachBit.sh %F
 Icon=/<BleachBitのアイコンが存在するディレクトリ>/BleachBit.png
 Terminal=false
 Categories=Utility;
 Keywords=cache;clean;free;performance;privacy;
 StartupNotify=true
 X-DBUS-ServiceName=
 X-DBUS-StartupType=
 X-GNOME-UsesNotifications=true
 X-KDE-SubstituteUID=false
 X-KDE-Username=
 X-SuSE-translate=false


 # BleachBit_as_Root.desktop (スーパユーザ向け)
 
 #!/usr/bin/env xdg-open
 [Desktop Entry]
 Version=1.1
 Type=Application
 Name=BleachBit x.x.x as Root
 GenericName=BleachBit
 Comment=Free space and maintain privacy
 Exec=xdg-su -c /<BleachBitのインストールディレクトリ>/StartBleachBit.sh %F
 Icon=/<BleachBitのアイコンが存在するディレクトリ>/BleachBit.png
 Terminal=false
 Categories=Utility;
 Keywords=cache;clean;free;performance;privacy;
 StartupNotify=true
 X-DBUS-ServiceName=
 X-DBUS-StartupType=
 X-GNOME-UsesNotifications=true
 X-KDE-SubstituteUID=false
 X-KDE-Username=
 X-SuSE-translate=true



エラー関連

グラフィカルモードで起動しない

GUI.pyファイルにおいて、from gi.repository import AppIndicator3 as AppIndicator の直前に、gi.require_version('AppIndicator3', '0.1') という行を追加する。
また、例外処理を except ImportError: から except (ValueError, ImportError): に変更する。

これにより、バージョンが見つからない場合も適切に次の処理に進めるようになる。

GUI.pyファイルを修正する。

 # 修正前
 
 if sys.platform == 'linux':
    try:
       # Ubuntu: sudo apt install gir1.2-ayatanaappindicator3-0.1
       gi.require_version('AyatanaAppIndicator3', '0.1')  # throws ValueError
       from gi.repository import AyatanaAppIndicator3 as AppIndicator
    except (ValueError, ImportError):
       try:
          from gi.repository import AppIndicator3 as AppIndicator
       except ImportError:
          try:
             from gi.repository import AppIndicator
          except ImportError:
             APP_INDICATOR_FOUND = False


 # 修正後
 
 if sys.platform == 'linux':
    try:
       # Ubuntu: sudo apt install gir1.2-ayatanaappindicator3-0.1
       gi.require_version('AyatanaAppIndicator3', '0.1')  # throws ValueError
       from gi.repository import AyatanaAppIndicator3 as AppIndicator
    except (ValueError, ImportError):
       try:
          # Specify version before importing to avoid PyGI warning
          gi.require_version('AppIndicator3', '0.1')
          from gi.repository import AppIndicator3 as AppIndicator
       except (ValueError, ImportError):
          try:
             from gi.repository import AppIndicator
          except ImportError:
             APP_INDICATOR_FOUND = False