
私はインストールしましtree
た
sudo apt-get install tree
すると、突然ターミナルがアップデートし始めましたgrub
。先週、 をインストールしたtree
ところ、同様のことが起こりました。しかし、その夜遅くにPCを再起動すると、
Grub _
そして変化しなかった。
結局、OS を再インストールしました (私は WattOS を使用しており、先週の火曜日に新しい PC にインストールしたばかりなので、大した問題ではありませんでした。すべてを再度セットアップするのに 5 時間かかっただけです)。
Grub は、前回見たのとぼんやり覚えているいくつかのエラーとともにインストールされました (読みやすくするために、投稿の最後に含めました)。
私はグーグルで調べました:
- なぜツリーはGRUBを更新するのですか?
- grub がアップグレード/更新されたのはなぜですか?
しかし、私は運がありませんでした。おそらく何かを見逃しているのではないかと思います。
誰か説明できますか:
- なぜこんなことが起きたのか
- これは何か問題があることを意味しますか
- それを修正するために何かできることがあるかどうか。
すべてを再インストールするのは避けたいです (明らかな理由により!)
ありがとう。
インストール中にエラーが発生しましたtree
:
sudo apt-get install tree
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
gimp-data libamd2 libbabl-0.1-0 libcamd2 libccolamd2 libcholmod3 libgegl-0.4-0 libgegl-common libgexiv2-2 libgimp2.0 libhpmud0 libimagequant0
libmetis5 libqt5designer5 libqt5help5 libqt5sql5 libqt5sql5-sqlite libqt5test5 libsane-hpaio libumfpack5 printer-driver-hpcups
printer-driver-postscript-hp python3-dbus.mainloop.pyqt5 python3-notify2 python3- olefile python3-pexpect python3-pil python3-ptyprocess
python3-pyqt5 python3-pyqt5.sip python3-renderpm python3-reportlab python3-reportlab- accel vlc-plugin-samba xsane xsane-common
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
tree
0 upgraded, 1 newly installed, 0 to remove and 174 not upgraded.
1 not fully installed or removed.
Need to get 49.6 kB of archives.
After this operation, 118 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main amd64 tree amd64 1.8.0-1+b1 [49.6 kB]
Fetched 49.6 kB in 0s (110 kB/s)
Selecting previously unselected package tree.
(Reading database ... 123032 files and directories currently installed.)
Preparing to unpack .../tree_1.8.0-1+b1_amd64.deb ...
Unpacking tree (1.8.0-1+b1) ...
Setting up grub-pc (2.06-3~deb11u6) ...
Installing for i386-pc platform.
grub-install: warning: File system `ext2' doesn't support embedding.
grub-install: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
Installation finished. No error reported.
Generating grub configuration file ...
Found background: /usr/share/wattOS/splash.png
Found background image: /usr/share/wattOS/splash.png
Found linux image: /boot/vmlinuz-5.10.0-19-amd64
Found initrd image: /boot/initrd.img-5.10.0-19-amd64
Warning: os-prober will be executed to detect other bootable partitions. Its output will be used to detect bootable binaries on them and create new boot entries. Found Debian GNU/Linux 11 (bullseye) on /dev/mmcblk0p2 done Setting up tree (1.8.0-1+b1) ...
Processing triggers for man-db (2.9.4-2) ...
アップデート
誤って再起動してしまい、PCが再びハングアップしてしまいました。その後、ハードドライブにWattOSのみのOSとして再インストールしたところ、すべて正常に動作しました。@eyoung100の回答を見て、
sudo apt upgrade
エラーなしで実行されました。
それから私は走った
sudo apt autoremove
途中で前回と同じ画面が表示されました:
The grub-pc package is being upgraded. This menu allows you to select which devices you'd like grub-install to be automatically run for, if any.
Running grub-install automatically is recommended in most situations, to prevent the installed GRUB core image from getting out of sync with
GRUB modules or grub.cfg.
If you're unsure which drive is designated as boot drive by your BIOS, it is often a good idea to install GRUB to all of them.
Note: it is possible to install GRUB to partition boot records as well, and some appropriate partitions are offered here. However, this forces GRUB to use the blocklist mechanism, which makes it less reliable, and therefore is not recommended.
前回はエラーが発生したため、「OK」を選択しませんでした。
その後別の端末で試してみたところ
sudo apt upgrade
それはこう答えた
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 39623 (apt)
それは驚くことではありません。
Ctrl + C と Ctrl + X でそのシェルを閉じようとしましたが、どちらも役に立ちませんでした。ウィンドウを閉じることはできましたが、心配です。
詳細情報の要求
- の結果
sudo dmidecode -s bios-version
は
8GET38WW (1.15 )
- の結果
sudo dmidecode -t 0 | grep UEFI
何もないです。(サポートされていないということだと思います)。
- の結果
cpuid | less
は
bash: cpuid: command not found
私が言えるのは、これは Lenovo Thinkpad L520 であり、再生品であり、CPU は変更していないということです (前の所有者については知りません)。
- の結果
sudo parted --list
は
Model: ATA ADATA SU630 (scsi)
Disk /dev/sda: 240GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 231GB 231GB primary ext4 boot
2 231GB 240GB 9449MB primary linux-swap(v1)
fstype
またはについては何も表示されませんgpt
。
前述したように、消去されたディスクにインストールしようとしました。
お時間をいただきありがとうございました!
答え1
エラーの絞り込み
心配する前に注意すべきことがたくさんあると思いますgrub
- 少なくとも 26 個のパッケージを削除する必要があります。
- 174 個のパッケージをアップグレードする必要があります。
- oldfred のコメントが示唆しているように、Grub には少しの調査と修正が必要です。
2 度修正する必要がないように、小さなステップ (1 と 2) を省く必要がありますgrub
。このような回答は、次の 2 つの理由から私が好んで行うものです。
- Linux での再起動は Windows での再起動とは大きく異なるということを、新しい Linux ユーザーに理解していただくことができます。
- 新しい Linux ユーザーとして、私がここで行っているように、OP が知識を伝えてくれることを願っています。
まずは小さなことから
出力スニペットを見ただけで、パッケージマネージャがAPTであることがわかります。これは、高度なパッケージングツール必要な場合は、 を試してくださいmam apt
。
apt update && apt autoremove
- 上記の 26 in 1 を削除する必要があります。apt upgrade
- 2 に記載されている 174 個のパッケージをダウンロードしてインストールする必要があります ( が含まれる場合がありますgrub
)。インターネット接続によっては、時間がかかる場合があります。
注記:質問者が貼り付けたのと同じエラーでアップグレードが中止される可能性があります。それは予想できますが、174パッケージセットを可能な限りアップグレードしたいのです。アップグレードが中止された場合は、 象 その後、ステップ2を繰り返します
そして今、部屋の中の象
オールドフレッドは確かに年寄りだが、彼の言うことは正しい。
grub-install: warning: File system `ext2' doesn't support embedding.
grub-install: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
インストールの種類を確実に判断するには、grub
特に順序は関係ありませんが、いくつかのことが必要です。
- BIOS/UEFI バージョン:
sudo dmidecode -s bios-version
- UEFI はオン/サポートされていますか:
sudo dmidecode -t 0 | grep UEFI
- あなたのCPU:
cpuid | less
- パーティション リストとテーブル タイプ:
sudo parted --list
を動作させるにはgrub-efi-amd64
、ESP/EFI パーティション タイプが FAT32 で、CPU が 64 ビットである必要があります。箇条書き 3 は、次のように Google などで検索できます。ファミリ X モデル Y CPU 64 ビット、ここで X と Y はファミリ行とモデル行の整数です。箇条書き 4 には、EFI パーティション、の出力fstype: fat32
、およびテーブル タイプが含まれている必要がありますgpt
。箇条書き 2 には「サポートされています」が含まれている必要があります。
先ほど引用したエラーから判断すると、インストーラーが としてフォーマットしたルート パーティションに grub ブート コードを埋め込もうとしたのだと思いますext2
。OP がインストールにディスク全体を使用した場合は、grub
ディスク全体を使用して再インストールする必要があります。このオプションは、EFI かどうかに関係なく機能します。EFI パーティションが存在する場合は、grub
そこにのみ再インストールする必要があります。上記の 4 つの箇条書きの出力を質問に追加してください。適切なコマンドを使用してこの回答を更新します。
アップデート
OPが提供したアップデートに基づいてdmidecode
、parted
これが適切なgrubアーキテクチャであると自信を持って言えますgrub-pc
。OPはインストールのみを選択しました。ワットOSマシン上で、grub
HDD 全体のブート セクターに次のコードを安全に埋め込むことができます。
sudo grub-install /dev/sda && sudo update-grub
sudo reboot
再起動後、次の手順に従ってください。再度アップグレードする必要があるapt update && apt-upgrade
場合はgrub
、アップグレードごとに上記のコマンドを発行してください(約15年間のさまざまなLinuxディストリビューションで、アップグレードしたのはgrub
10回未満だと思います。アップグレードするのはあまり一般的ではないパッケージです。私の意見では)。
ノート: コマンドでパーティション番号を省略することでgrub-install
、ディスク全体を埋め込むことが許容されることを grub に伝えます。
失敗した場合update-grub
(これらを順番に発行します):
sudo grub-install /dev/sda
sudo grub-mkconfig -o /boot/grub/grub.cfg
sudo reboot