私のDebianのインストールが破損しています。 PATHで「sh」が見つかりません。

私のDebianのインストールが破損しています。 PATHで「sh」が見つかりません。

私はカスタムビルドを実行していますDebian buster/sid。間違って実行すると多くの問題が発生しているようですapt-get dist-upgrade(これがまさにその理由のようです)。したがって、Desktop Manager \ Desktop Environmentはまったくロードされず、コマンドラインシェルのみが表示されます。

適性とapt-getとdpkgが破損しています。

aptアップデート、aptitudeアップデート、apt-getアップデートが失敗して実行しようとすると多くのエラーが発生しますが、私の/etc/apt/sources.listは問題ないようです。

deb http://ftp.ie.debian.org/debian unstable main contrib non-free
deb-src http://ftp.ie.debian.org/debian unstable main contrib non-free
deb http://ftp.ie.debian.org/debian experimental main contrib non-free
deb-src http:// ftp.ie.debian.org/debian experimental main contrib non free
deb https://dl.winehq.org/wine-builds/debian sid main
deb https://dl.winehq.org/wine-builds/ubuntu sid main

このエラーは、次の更新時に発生します。

Err:2 http://ftp.ie.debian.org/debian unstable InRelease
Couldn't execute /usr/bin/apt-key to check /var/lib/apt/lists/partial/ftp.ie.debian.org_debian_dists_experimental_InRelease

そして

E: Problem executing scripts APT::Update::Post-Invoke-Success '/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/gdbus call --system --dest org.freedesktop.PackageKit --object-path /org/freedesktop/PackageKit --timeout 4 --method org.freedesktop.PackageKit.StateHasChanged cache-update > /dev/null; /bin/echo > /dev/null'

E: Sub-process returned an error code

aptitude Upgrade、apt Upgrade、または apt-get Upgrade が破損した dpkg によって破損しているようです。

dpkg では、次のエラーが発生します。

dpkg: warning: 'sh' not found in PATH or not executable
dpkg: error: 1 expected

しかし、戻ってきますが、echo $PATHこれは好きです。

/home/ferg/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games

頑張れば手にsh入れる

The program 'sh' is currently not installed. To run 'sh' please ask your administrator to install the package 'dash'

試してみるとsudo apt-get install dash

それは私に言うdash is already the newest version (0.5.8-2.6)

続けると

E: Sub-process /usr/sbin/dpkg-preconfigure --apt || true returned an error code (100)
E: Failure running script /usr/sbin/dpkg/preconfigure --apt || true

私が実行しsudo nano /etc/apt/apt.conf.d/70debconf、その行をコメントアウトするとDPkg::Pre-Install-Pkgs {"/usr/sbian/dpkg-preconfigure --apt || true";};

すると適性は失敗する

dpkg: warning: 'sh' not found in PATH or not executable
dpkg: error: 1 expected

したがって、shが私のPATHにないため、dpkg(およびaptitude、apt-get、apt)が破損しているため、システムを復元するために必要なパッケージを再インストールできません。しかし、すべての正しいディレクトリが私のパスにあります。私はこれをshで修正すると、dpkgとaptitudeが再び機能すると仮定していますが、shに何が問題なのか疑問に思います。

助けてくれてありがとう。


修正する:

ls -l /bin/bash

返品

-rwxr-xr-x 1 root root 1099016 May 15  2017 /bin/bash

ls -l /bin/sh返品

lrwxrwxrwx 1 root root 4 Jun 28  2017 /bin/sh -> dash

ls -l /bin/dash返品

ls: cannot access 'bin/dash': No such file or directory

それでは、/bin/shが何とか削除された/bin/dashにリダイレクトされると思いますか?

sudo apt-get install --reinstall dash失敗:

1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.    
E: Internal Error, No file name for dash:amd64

上記のエラーが原因で実行がsudo ln -sf bash /bin/sh失敗します。sudo apt-get install --reinstall dash

この問題とそのバリエーションをGoogleで検索中に、ユーザーのPATHと権限に関連する多くの解決策が見つかりました/etc/sudoers /root/.bashrc。ほとんどの場合、ユーザーはパス(通常は欠落しているパスまたはディレクトリ)を正しく定義することで問題を解決できます。上記のように、私のPATHには、通常どおり実行するかルートとして実行するかにかかわらず、関連するすべてのディレクトリが含まれているようです。一部のユーザーには権限または独自の問題があります。また、さまざまなコマンドとコマンドをrootとして実行してみましたが、これは私の問題が異なることを意味します。/root/.profile/etc/profile/sbin/usr/sbinecho $PATHsudo echo $PATHsudoaptitude aptapt-getdpkgsudo -i

ベストアンサー1

あなたは噛まれた不快なミスdashこれにより/bin/sh削除が発生しました。この問題は解決されたので、他の質問が要求されapt update解決されapt full-upgradeました(/bin/shpointingに戻った後、bashこれに対するあなたのコメントは明確ではありませんでした)。

おすすめ記事