I have installed the LAMP Server using the command sudo apt-get install lamp-server^. Thereafter, whenever I open the terminal the following error started to appear:
bash: /home/gaja/.bashrccu: No such file or directory
bash: /home/gaja/.bashrc: line 4: syntax error near unexpected token ('
bash: /home/gaja/.bashrc: line 4: see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)'
I could get rid of this problem using the answer given here.
However, now the problem is that I cannot install any thing using the sudo apt-get command.
I am trying to become root and then re-run the sudo apt-get install lamp-server^ command which gives the following error output:
dpkg: warning: 'tar' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)
Following is the complete output of running the commands:
gaja@gaja-System-Product-Name:~$ sudo su
[sudo] password for gaja:
root@gaja-System-Product-Name:/home/gaja# sudo apt-get install lamp-server^
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libdbi-perl' for task 'lamp-server'
Note, selecting 'perl-modules' for task 'lamp-server'
Note, selecting 'libaprutil1-dbd-sqlite3' for task 'lamp-server'
Note, selecting 'perl' for task 'lamp-server'
Note, selecting 'apache2-bin' for task 'lamp-server'
Note, selecting 'libapache2-mod-php5' for task 'lamp-server'
Note, selecting 'ssl-cert' for task 'lamp-server'
Note, selecting 'mysql-server-5.5' for task 'lamp-server'
Note, selecting 'mysql-client-core-5.5' for task 'lamp-server'
Note, selecting 'libclass-isa-perl' for task 'lamp-server'
Note, selecting 'mysql-server' for task 'lamp-server'
Note, selecting 'libapr1' for task 'lamp-server'
Note, selecting 'php5-readline' for task 'lamp-server'
Note, selecting 'libaprutil1' for task 'lamp-server'
Note, selecting 'libwrap0' for task 'lamp-server'
Note, selecting 'libdbd-mysql-perl' for task 'lamp-server'
Note, selecting 'apache2-mpm-prefork' for task 'lamp-server'
Note, selecting 'libhtml-template-perl' for task 'lamp-server'
Note, selecting 'mysql-client-5.5' for task 'lamp-server'
Note, selecting 'libaio1' for task 'lamp-server'
Note, selecting 'mysql-common' for task 'lamp-server'
Note, selecting 'libmysqlclient18' for task 'lamp-server'
Note, selecting 'mysql-server-core-5.5' for task 'lamp-server'
Note, selecting 'libterm-readkey-perl' for task 'lamp-server'
Note, selecting 'php5-mysql' for task 'lamp-server'
Note, selecting 'apache2-data' for task 'lamp-server'
Note, selecting 'apache2' for task 'lamp-server'
Note, selecting 'php5-common' for task 'lamp-server'
Note, selecting 'php5-cli' for task 'lamp-server'
Note, selecting 'libswitch-perl' for task 'lamp-server'
Note, selecting 'libaprutil1-ldap' for task 'lamp-server'
Note, selecting 'tcpd' for task 'lamp-server'
libaio1 is already the newest version.
libapr1 is already the newest version.
libaprutil1 is already the newest version.
libaprutil1-dbd-sqlite3 is already the newest version.
libaprutil1-ldap is already the newest version.
libclass-isa-perl is already the newest version.
libdbd-mysql-perl is already the newest version.
libdbi-perl is already the newest version.
libhtml-template-perl is already the newest version.
libswitch-perl is already the newest version.
libterm-readkey-perl is already the newest version.
libwrap0 is already the newest version.
perl is already the newest version.
perl-modules is already the newest version.
ssl-cert is already the newest version.
tcpd is already the newest version.
apache2 is already the newest version.
apache2-bin is already the newest version.
apache2-data is already the newest version.
apache2-mpm-prefork is already the newest version.
libapache2-mod-php5 is already the newest version.
libmysqlclient18 is already the newest version.
mysql-client-5.5 is already the newest version.
mysql-client-core-5.5 is already the newest version.
mysql-common is already the newest version.
mysql-server is already the newest version.
mysql-server-5.5 is already the newest version.
mysql-server-core-5.5 is already the newest version.
php5-cli is already the newest version.
php5-common is already the newest version.
php5-mysql is already the newest version.
php5-readline is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 230 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
dpkg: warning: 'tar' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)
root@gaja-System-Product-Name:/home/gaja# sudo apt-get install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
apache2 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 230 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
dpkg: warning: 'tar' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)
root@gaja-System-Product-Name:/home/gaja#
Some of the troubleshooting steps that I have taken on suggestion of other members:
$ ls -l /bin/tar
ls: cannot access /bin/tar: No such file or directory
$ apt-cache policy tar
tar: Installed: 1.26+dfsg-8 Candidate: 1.26+dfsg-8 Version table: *** 1.26+dfsg-8 0 500 in.archive.ubuntu.com/ubuntu saucy/main i386 Packages 100 /var/lib/dpkg/status
I have also tried running the following command after switching to root, but that doesn’t help either:
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
Я установил сервер LAMP с помощью команды sudo apt-get install lamp-server^. После этого всякий раз, когда я открывал терминал, начинала появляться следующая ошибка:
bash: /home/gaja/.bashrccu: No such file or directory
bash: /home/gaja/.bashrc: line 4: syntax error near unexpected token ('
bash: /home/gaja/.bashrc: line 4: see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)'
Я мог избавиться от этой проблемы , используя ответ, приведенный здесь .
Однако теперь проблема в том, что я не могу установить что-либо с помощью команды sudo apt-get.
Я пытаюсь стать root, а затем повторно запустить команду sudo apt-get install lamp-server^, которая выдает следующую ошибку:
dpkg: warning: 'tar' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)
Ниже приведен полный вывод выполнения команд:
gaja@gaja-System-Product-Name:~$ sudo su
[sudo] password for gaja:
root@gaja-System-Product-Name:/home/gaja# sudo apt-get install lamp-server^
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libdbi-perl' for task 'lamp-server'
Note, selecting 'perl-modules' for task 'lamp-server'
Note, selecting 'libaprutil1-dbd-sqlite3' for task 'lamp-server'
Note, selecting 'perl' for task 'lamp-server'
Note, selecting 'apache2-bin' for task 'lamp-server'
Note, selecting 'libapache2-mod-php5' for task 'lamp-server'
Note, selecting 'ssl-cert' for task 'lamp-server'
Note, selecting 'mysql-server-5.5' for task 'lamp-server'
Note, selecting 'mysql-client-core-5.5' for task 'lamp-server'
Note, selecting 'libclass-isa-perl' for task 'lamp-server'
Note, selecting 'mysql-server' for task 'lamp-server'
Note, selecting 'libapr1' for task 'lamp-server'
Note, selecting 'php5-readline' for task 'lamp-server'
Note, selecting 'libaprutil1' for task 'lamp-server'
Note, selecting 'libwrap0' for task 'lamp-server'
Note, selecting 'libdbd-mysql-perl' for task 'lamp-server'
Note, selecting 'apache2-mpm-prefork' for task 'lamp-server'
Note, selecting 'libhtml-template-perl' for task 'lamp-server'
Note, selecting 'mysql-client-5.5' for task 'lamp-server'
Note, selecting 'libaio1' for task 'lamp-server'
Note, selecting 'mysql-common' for task 'lamp-server'
Note, selecting 'libmysqlclient18' for task 'lamp-server'
Note, selecting 'mysql-server-core-5.5' for task 'lamp-server'
Note, selecting 'libterm-readkey-perl' for task 'lamp-server'
Note, selecting 'php5-mysql' for task 'lamp-server'
Note, selecting 'apache2-data' for task 'lamp-server'
Note, selecting 'apache2' for task 'lamp-server'
Note, selecting 'php5-common' for task 'lamp-server'
Note, selecting 'php5-cli' for task 'lamp-server'
Note, selecting 'libswitch-perl' for task 'lamp-server'
Note, selecting 'libaprutil1-ldap' for task 'lamp-server'
Note, selecting 'tcpd' for task 'lamp-server'
libaio1 is already the newest version.
libapr1 is already the newest version.
libaprutil1 is already the newest version.
libaprutil1-dbd-sqlite3 is already the newest version.
libaprutil1-ldap is already the newest version.
libclass-isa-perl is already the newest version.
libdbd-mysql-perl is already the newest version.
libdbi-perl is already the newest version.
libhtml-template-perl is already the newest version.
libswitch-perl is already the newest version.
libterm-readkey-perl is already the newest version.
libwrap0 is already the newest version.
perl is already the newest version.
perl-modules is already the newest version.
ssl-cert is already the newest version.
tcpd is already the newest version.
apache2 is already the newest version.
apache2-bin is already the newest version.
apache2-data is already the newest version.
apache2-mpm-prefork is already the newest version.
libapache2-mod-php5 is already the newest version.
libmysqlclient18 is already the newest version.
mysql-client-5.5 is already the newest version.
mysql-client-core-5.5 is already the newest version.
mysql-common is already the newest version.
mysql-server is already the newest version.
mysql-server-5.5 is already the newest version.
mysql-server-core-5.5 is already the newest version.
php5-cli is already the newest version.
php5-common is already the newest version.
php5-mysql is already the newest version.
php5-readline is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 230 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
dpkg: warning: 'tar' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)
root@gaja-System-Product-Name:/home/gaja# sudo apt-get install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
apache2 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 230 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
dpkg: warning: 'tar' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)
root@gaja-System-Product-Name:/home/gaja#
Некоторые из шагов по устранению неполадок, которые я предпринял по предложению других участников:
$ ls -l /bin/tar
ls: cannot access /bin/tar: No such file or directory
$ apt-cache policy tar
tar: Installed: 1.26+dfsg-8 Candidate: 1.26+dfsg-8 Version table: *** 1.26+dfsg-8 0 500 in.archive.ubuntu.com/ubuntu saucy/main i386 Packages 100 /var/lib/dpkg/status
Я также попытался выполнить следующую команду после переключения на root, но это не либо помогите:
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
задан
13 April 2017 в 15:25
поделиться
4 ответа
Переменная окружения $PATH корня установлена неправильно, поэтому dpkg не может найти tar для извлечения пакетов.
Попробуйте следующее после переключения на root:
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
А затем снова выполните команду apt-get.
ответ дан chaos
13 April 2017 в 15:25
поделиться
Из вашего вопроса и следующих комментариев ясно, что tar установлен, но исполняемый файл /бин/тар отсутствует. Вам необходимо добавить его вручную, так как ваш dpkg не будет работать без tar.
Сначала проверьте, что следующие файлы уже есть,
ls -l /etc/rmt
ls -l /usr/lib/mime/packages/tar
ls -l /usr/sbin/rmt-tar
ls -l /usr/sbin/tarcat
Я не перечислю файлы doc и man. Полный список можно найти здесь.
Вы можете скачать пакет .deb для tar вручную с packages.ubuntu.com. Загрузите точный пакет для вашей архитектуры.
Далее распакуйте файл .deb в системе, где доступен менеджер архивов. Если вы распаковываете файл .deb, то под главной директорией будет каталог с именем bin. Вам нужно скопировать исполняемый файл tar из распакованного каталога bin в каталог /bin/.
Сначала вы можете поместить исполняемый файл tar в свою домашнюю директорию. Затем используйте следующее в терминале, чтобы скопировать его в /bin,
sudo cp tar /bin/
sudo chmod 755 /bin/tar
просто проверьте, что владелец /bin/tar является корневым. и у него должно быть разрешение на выполнение для всех. Вывод ls -l /bin/tar должен выглядеть как,
-rwxr-xr-x 1 root root ...
Это должно работать. возможно, вам понадобится установить -предложенные пакеты , если они еще не установлены.
ответ дан souravc
13 April 2017 в 15:25
поделиться
У меня была аналогичная ошибка при попытке обновить дистрибутив с Debian Squeeze до Wheezy (я знаю, что это Ubuntu Stack Exchange, но мое решение может сработать для вас). Вот команда, которую я выполнил, когда получил ошибку:
sudo apt-get dist-upgrade
Вот часть ошибки:
dpkg: 3 expected programs not found in PATH or not executable.
Я перешел на пользователя root с помощью следующей команды и попробовал еще раз:
su root
apt-get dist-upgrade
И установка прошла без ошибок.
ответ дан thohl
13 April 2017 в 15:25
поделиться
переключиться на root
export PATH=$PATH:/sbin
ответ дан
7 May 2021 в 20:58
поделиться
Другие вопросы по тегам:
Похожие вопросы:
Cannot delete or install anything with apt, on both my own user and the root. Whenever I try I get the following error:
dpkg: warning: 'dpkg-deb' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
I checked the $PATH variable (in root as well my own user) and it contains everything it should contain:
ranran9991@Ran-Mint ~ $ sudo -i
[sudo] password for ranran9991:
Ran-Mint ~ # echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/usr/lib/jvm/java-11-oracle/bin:/usr/lib/jvm/java-11-oracle/db/bin
Output of grep -i path /etc/sudoers:
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
Output of sudo find / -mount -name dpkg-deb -exec ls -ld {} +
ranran9991@Ran-Mint ~ $ sudo find / -mount -name dpkg-deb -exec ls -ld {} +
[sudo] password for ranran9991:
lrwxrwxrwx 1 root root 4 Nov 24 2018 /usr/share/bash-completion/completions/dpkg-deb -> dpkg
-rwxr-xr-x 1 root root 153952 Oct 4 2018 /var/lib/docker/overlay2/8c4b3545f8b2b1fd424a8054dfa0a631959619f0dc34efe9ca5c5e52f0fe7696/diff/usr/bin/dpkg-deb
I am using Cinnamon Mint 18.3.
I am unsure what to do and would love some help.
I keep running lb build, fixing problem after problem and then running it again, and now i’m getting this message:
dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)
P: Begin unmounting filesystems...
P: Saving caches...
Reading package lists... Done
Building dependency tree... Done
I then went to check my path and i see
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
This clearly shows /usr/local/sbin, /usr/sbin, and /sbin.
Any suggestions?
**UPDATE 1**
Followed this guide
http://ubuntuforums.org/showthread.php?t=1449322
every command ran fine but still the same error message after running lb build again.
**UPDATE 2 — Additional Info**
root@kali:~# ls -lA /sbin
(Other files)
-rwxr-xr-x 1 root root 28208 Aug 12 15:00 start-stop-daemon
Problem description
Steps to reproduce
pkg install busybox
Hit:1 https://termux.net stable InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
28 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
busybox is already the newest version (1.30.1-4).
0 upgraded, 0 newly installed, 0 to remove and 28 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
dpkg: warning: 'tar' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /data/data/com.termux/files/usr/bin/dpkg returned an error code (2)
echo $PATH
/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets
Expected behavior
Additional information
I did not expect apt-get -qq upgrade to break everything
/data/data/com.termux/files/usr/bin/busybox tar
BusyBox v1.30.1 (2019-07-28 21:51:06 UTC) multi-call b. inary.
Usage: tar c|x|t [-ZzJjahmvokO] [-f TARFILE] [-C DIR] [-T FILE] [-X FILE] [--exclude PATTERN]... [FILE]...
Create, extract, or list files from a tar file
c Create
x Extract
t List
-f FILE Name of TARFILE ('-' for stdin/out)
-C DIR Change to DIR before operation
-v Verbose
-O Extract to stdout
-m Don't restore mtime
-o Don't restore user:group
-k Don't replace existing files
-Z (De)compress using compress
-z (De)compress using gzip
-J (De)compress using xz
-j (De)compress using bzip2
-a (De)compress using lzma
-h Follow symlinks
-T FILE File with names to include
-X FILE File with glob patterns to exclude
--exclude PATTERN Glob pattern to exclude
cd /data/data/com.termux/files/usr/bin/
ln -s busybox tar
Ok that let me finish the busybox config but now
pkg install wget
Hit:1 https://termux.net stable InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
28 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
pcre
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
bzip2 diffutils dpkg gzip libandroid-support
libbz2 libiconv liblzma pcre2 tar xz-utils
zlib
The following NEW packages will be installed:
bzip2 diffutils gzip libiconv pcre2 tar
xz-utils zlib
The following packages will be upgraded:
dpkg libandroid-support libbz2 liblzma wget
5 upgraded, 8 newly installed, 0 to remove and 23 not upgraded.
Need to get 0 B/2071 kB of archives.
After this operation, 4923 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
E.: This installation run will require temporarily removing the essential package libandroid-
support:aarch64 due to a Conflicts/Pre-Depends loop. This is often bad, but if you really want to do it, activate the APT::Force-LoopBreak option.
E: Internal Error, Could not early remove libandroid-support:aarch64 (2)
Which I assume is the origonal issue
Another apt-get -qq upgrade fixed things though I lost a few of my package selections (grep findutils).
Bad repo? Temp bug?
Bad repo? Temp bug?
Better to do pkg upgrade or apt full-upgrade instead of apt-get -qq upgrade.
Busybox is being deprecated and replaced by coreutils/findutils/etc… standalone packages.
Copy link
Contributor
Author
@xeffyr note that apt-get recoverd the broken state when pkg did not.
If apt-get is going to break things should it be removed?
apt has no quite option and states it is not sutable for scripting, so why would it be less likely to break stuff than apt-get?
What’s the deal with libandroid-support?
Is there a list of things I should install before removing busybox (like tar, to avoid a busted package manager) ?
Was some change made or will apt-get still break things?
There still seem to be issues;
pkg install coreutils
Hit:1 https://termux.net stable InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
16 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
bzip2 diffutils dpkg gzip libandroid-support
libiconv tar xz-utils zlib
The following NEW packages will be installed:
bzip2 diffutils gzip libiconv tar xz-utils
zlib
The following packages will be upgraded:
coreutils dpkg libandroid-support
3 upgraded, 7 newly installed, 0 to remove and. 13 not upgraded.
Need to get 0 B/2168 kB of archives.
After this operation, 4559 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
E: This installation run will require temporarily removing the essential package libandroid-support:aarch64 due to a Conflicts/Pre-Depends loop. This is often bad, but if you really want to do it, activate the APT::Force LoopBreak option.
E: Internal Error, Could not early remove libandroid-support:aarch64 (2)
If apt-get is going to break things should it be removed?
It doesn’t break anything if properly used. There is a big difference between upgrade and full-upgrade (it also has alias dist-upgrade).
apt has no quite option and states it is not sutable for scripting, so why would it be less likely to break stuff than apt-get?
It has, apt can do anything that apt-get does. apt is a replacement for «old» apt-get.
What’s the deal with libandroid-support?
More like issue actually is #3762.
apt-get still break things
If you will do apt upgrade instead of apt full-upgrade (or as recommended pkg upgrade), things most likely will be broken.
Apt isn’t well suitable for rolling-release distributions.
Copy link
Contributor
Author
@xeffyr Is calling apt-get -qq upgrade using it improperly? because that’s all that my script did for years before it suddenly broke.
If apt is not suitable and will most likely break things why is it even installed by default (let alone installable at all)?
As I mentioned apt (like pkg) has no quiet option (show errors only) and will spit out
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
on stderr which is not suitable for scripting.
Copy link
Contributor
Author
@xeffyr I think the bottom line is that apt-get should not attempt to replace BusyBox on upgrade but instead should leave it to dist-upgrade
apt-get should not attempt to replace BusyBox
That’s not possible due to multiple reasons:
-
Busybox has symlink
$PREFIX/bin/envwhich conflicts with packagecoreutils. -
Busybox is getting deprecated and will no longer provide symlinks. But
aptis not working without utilities provided by busybox or coreutils.
So you have no choice. If you want upgrade, a replacement should be done, otherwise package manager will be completely broken.
Yesterday there was a short time when termux.net was in broken state and updates for apt, coreutils and dpkg were not uploaded (they had dependency fixes). You perhaps did upgrade at this time and tar disappeared due to updated busybox.
termux
locked and limited conversation to collaborators
Oct 9, 2021
Источник: http://www.blackmoreops.com/2015/08/15/fixing-dpkg-warning-ldconfig-not-found-in-path-or-not-executable-error-when-installing-packages/
Прошлой ночью я поймал новую ошибку в Kali Linux 2.0 – Kali Sana. Я пробовал установить gimp и всё шло нормально. Но в момент когда началась установка gimp, я получил следующие ошибки:
root@kali:~# apt-get install gimp Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: gimp-data libamd2.3.1 libbabl-0.1-0 libcamd2.3.1 libccolamd2.8.0 libcholmod2.1.2 libcolamd2.8.0 libgegl-0.2-0 libgimp2.0 libopenraw1 libumfpack5.6.2 Suggested packages: gimp-help-en gimp-help gimp-data-extras The following NEW packages will be installed: gimp gimp-data libamd2.3.1 libbabl-0.1-0 libcamd2.3.1 libccolamd2.8.0 libcholmod2.1.2 libcolamd2.8.0 libgegl-0.2-0 libgimp2.0 libopenraw1 libumfpack5.6.2 0 upgraded, 12 newly installed, 0 to remove and 8 not upgraded. Need to get 15.7 MB of archives. After this operation, 70.9 MB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 http://http.kali.org/kali/ sana/main libamd2.3.1 amd64 1:4.2.1-3 [26.3 kB] Get:2 http://http.kali.org/kali/ sana/main libbabl-0.1-0 amd64 0.1.10-2 [97.2 kB] Get:3 http://http.kali.org/kali/ sana/main libcamd2.3.1 amd64 1:4.2.1-3 [24.6 kB] Get:4 http://http.kali.org/kali/ sana/main libccolamd2.8.0 amd64 1:4.2.1-3 [26.0 kB] Get:5 http://http.kali.org/kali/ sana/main libcolamd2.8.0 amd64 1:4.2.1-3 [20.4 kB] Get:6 http://http.kali.org/kali/ sana/main libcholmod2.1.2 amd64 1:4.2.1-3 [288 kB] Get:7 http://http.kali.org/kali/ sana/main libopenraw1 amd64 0.0.9-3.5+b2 [132 kB] Get:8 http://http.kali.org/kali/ sana/main libumfpack5.6.2 amd64 1:4.2.1-3 [222 kB] Get:9 http://http.kali.org/kali/ sana/main libgegl-0.2-0 amd64 0.2.0-7+b1 [541 kB] Get:10 http://http.kali.org/kali/ sana/main libgimp2.0 amd64 2.8.14-1+b1 [1,666 kB] Get:11 http://http.kali.org/kali/ sana/main gimp-data all 2.8.14-1 [8,309 kB] Get:12 http://http.kali.org/kali/ sana/main gimp amd64 2.8.14-1+b1 [4,395 kB] Fetched 15.7 MB in 6min 33s (40.0 kB/s) dpkg: warning: 'ldconfig' not found in PATH or not executable dpkg: warning: 'start-stop-daemon' not found in PATH or not executable dpkg: error: 2 expected programs not found in PATH or not executable Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin E: Sub-process /usr/bin/dpkg returned an error code (2)d
Поискав немного и найдя, что это проблема с $PATH в профиле.
“echo $PATH” и “sudo echo $PATH” обе показывали мне:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
Я использую Kali как рут пользователь и это не имело значения. Свою установку я всё-таки закончил, добавив к команде sudo, после этого всё прошло хорошо. Тем не менее, продолжаю искать решение, как исправить эту проблему окончательно.
root@kali:~# sudo apt-get install gimp Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: gimp-data libamd2.3.1 libbabl-0.1-0 libcamd2.3.1 libccolamd2.8.0 libcholmod2.1.2 libcolamd2.8.0 libgegl-0.2-0 libgimp2.0 libopenraw1 libumfpack5.6.2 Suggested packages: gimp-help-en gimp-help gimp-data-extras The following NEW packages will be installed: gimp gimp-data libamd2.3.1 libbabl-0.1-0 libcamd2.3.1 libccolamd2.8.0 libcholmod2.1.2 libcolamd2.8.0 libgegl-0.2-0 libgimp2.0 libopenraw1 libumfpack5.6.2 0 upgraded, 12 newly installed, 0 to remove and 11 not upgraded. Need to get 0 B/15.7 MB of archives. After this operation, 70.9 MB of additional disk space will be used. Do you want to continue? [Y/n] Y
Те пользователи, у которых это случается когда вы залогинены как стандартный/нормальный пользователь, используйте su —, чтобы стать рутом или вместо этого используйте sudo.
-
questlinq
- Posts: 61
- Joined: 2017-09-19 08:51
dpkg -i errors [SOLVED]
#1
Post
by questlinq » 2019-11-05 16:51
Hello,
When trying to install local .deb package, on Debian 10, I get the following errors.
dpkg: warning: ‘ldconfig’ not found in PATH or not executable
dpkg: warning: ‘start-stop-daemon’ not found in PATH or not executable
dpkg: error: 2 expected programs not found in PATH or not executable
The package can’t be installed.
Last edited by questlinq on 2019-11-06 08:48, edited 2 times in total.
-
roseway
- Posts: 1528
- Joined: 2007-12-31 22:50
- Location: Kent, UK
- Been thanked: 1 time
Re: dpkg -i errors
#2
Post
by roseway » 2019-11-05 17:31
If you use su to become root, you have to enter
If you just use su on its own, you keep the user’s path, which does not include ldconfig etc.
Eric
-
Soul Singin’
- Posts: 1607
- Joined: 2008-12-21 07:02
Re: dpkg -i errors
#3
Post
by Soul Singin’ » 2019-11-05 17:32
EDIT: . Roseway responded faster than I did. My observation is the same, but with a longer explanation.
questlinq wrote:
Code: Select all
dpkg: warning: 'ldconfig' not found in PATH or not executable dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
/sbin/ldconfig is provided by the libc-bin package and /sbin/start-stop-daemon is provided by the dpkg package. Both are «essential» packages. They must have been installed at installation.
So assuming that they’re installed … How did you become root? On Debian Buster, you now have to add a dash («-«) after the su command:
Code: Select all
$ su -
Password:
# dpkg -i <debfile>
When you add the dash, your $PATH will contain the /sbin/ directories:
Code: Select all
$ su -
Password:
# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
If you forget to add the dash, your $PATH will not:
Code: Select all
$ su
Password:
# echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
-
questlinq
- Posts: 61
- Joined: 2017-09-19 08:51
Re: dpkg -i errors
#4
Post
by questlinq » 2019-11-05 17:55
Thank you to both of you — it worked!
Usually, I sign in as user and then I do «su» + «password» and then «apt install .. «
Do I always need to use «su -» in Buster?
-
sunrat
- Administrator
- Posts: 5215
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 56 times
- Been thanked: 197 times
Re: dpkg -i errors
#5
Post
by sunrat » 2019-11-05 18:30
questlinq wrote:Do I always need to use «su -» in Buster?
As explained by Soul Singin’ and roseway, if you need to run anything which is not in your user PATH, yes.
I sometimes run apt install (which is in /usr/bin/ therefore in user’s PATH) without the dash after su, , to install a locally downloaded package. apt install is better than dpkg -i as it will also resolve and download dependencies if there are any. eg. —
Code: Select all
apt install ./<downloaded-package>
Don’t forget the ./ (or give the full path) so apt knows it’s installing locally and not from repository.
Of course you’d still need su — if the installer calls ldconfig or anything else in /usr/sbin/ .
See also — http://forums.debian.net/viewtopic.php?f=16&t=142973
“ computer users can be divided into 2 categories:
Those who have lost data
…and those who have not lost data YET ” Remember to BACKUP!
-
Soul Singin’
- Posts: 1607
- Joined: 2008-12-21 07:02
Re: dpkg -i errors
#7
Post
by Soul Singin’ » 2019-11-06 18:03
sunrat wrote:to install a locally downloaded package. apt install is better than dpkg -i as it will also resolve and download dependencies if there are any. eg. —
Code: Select all
apt install ./<downloaded-package>Don’t forget the ./ (or give the full path) so apt knows it’s installing locally and not from repository.
Thank you for sharing this tip. I was unaware of it.
But my experiments with that command downloaded the package from the repository. They did not install from the local file. (See below).
So suppose that I built a backport. Under what conditions would the «dot-slash» installation method install my backport? and under what conditions would it install from the repository?
——— ——— ——— ———
Below are the results of my experiment with the (trivial) hello package:
Code: Select all
# apt install ./hello_2.10-2_amd64.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'hello' instead of './hello_2.10-2_amd64.deb'
The following NEW packages will be installed:
hello
0 upgraded, 1 newly installed, 0 to remove and 30 not upgraded.
Need to get 56.1 kB of archives.
After this operation, 287 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 hello amd64 2.10-2 [56.1 kB]
Fetched 56.1 kB in 0s (444 kB/s)
Selecting previously unselected package hello.
(Reading database ... 311442 files and directories currently installed.)
Preparing to unpack .../hello_2.10-2_amd64.deb ...
Unpacking hello (2.10-2) ...
Setting up hello (2.10-2) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for install-info (6.5.0.dfsg.1-4+b1) ...
I also tried with apt-get and obtained the same result:
Code: Select all
# apt-get install ./hello_2.10-2_amd64.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'hello' instead of './hello_2.10-2_amd64.deb'
The following NEW packages will be installed:
hello
0 upgraded, 1 newly installed, 0 to remove and 30 not upgraded.
Need to get 56.1 kB of archives.
After this operation, 287 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 hello amd64 2.10-2 [56.1 kB]
Fetched 56.1 kB in 0s (276 kB/s)
Selecting previously unselected package hello.
(Reading database ... 311442 files and directories currently installed.)
Preparing to unpack .../hello_2.10-2_amd64.deb ...
Unpacking hello (2.10-2) ...
Setting up hello (2.10-2) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for install-info (6.5.0.dfsg.1-4+b1) ...
-
Head_on_a_Stick
- Posts: 13994
- Joined: 2014-06-01 17:46
- Location: /dev/chair
- Has thanked: 53 times
- Been thanked: 80 times
Re: dpkg -i errors
#8
Post
by Head_on_a_Stick » 2019-11-06 18:36
Soul Singin’ wrote:Under what conditions would the «dot-slash» installation method install my backport?
If your backport was versioned correctly to indicate that it was newer than the package in the repositories.
Il semble que la perfection soit atteinte non quand il n’y a plus rien à ajouter, mais quand il n’y a plus rien à retrancher.
-
stevepusser
- Posts: 12651
- Joined: 2009-10-06 05:53
- Has thanked: 21 times
- Been thanked: 33 times
Re: dpkg -i errors [SOLVED]
#9
Post
by stevepusser » 2019-11-06 18:45
After becoming root with «su -«, you moved to your /root directory, and apt could not find the local deb in that directory. If you have enabled sudo, you can use that instead with apt to avoid that problem.
MX Linux packager and developer
-
sunrat
- Administrator
- Posts: 5215
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 56 times
- Been thanked: 197 times
Re: dpkg -i errors [SOLVED]
#10
Post
by sunrat » 2019-11-06 19:54
stevepusser wrote:After becoming root with «su -«, you moved to your /root directory, and apt could not find the local deb in that directory. If you have enabled sudo, you can use that instead with apt to avoid that problem.
Exactly. The command needs to be run with the terminal opened in the same directory as the file. su — switches you to root user’s environment, which means it also switches the terminal to root user’s home directory. That’s why I said «Don’t forget the ./ (or give the full path)». If you use su — , you could cd back to where the file resides. the «./» applies to when your terminal is open at the directory containing the file, «(or give the full path)» for when it is anywhere else.
“ computer users can be divided into 2 categories:
Those who have lost data
…and those who have not lost data YET ” Remember to BACKUP!
-
Deb-fan
- Posts: 1047
- Joined: 2012-08-14 12:27
- Been thanked: 4 times
Re: dpkg -i errors [SOLVED]
#11
Post
by Deb-fan » 2019-11-06 20:58
Lol … or in the grandest of gnu/Nix noobishness style. While in da directory (folder thingy) containing said .deb(s), right click xyz-filemanager, select «Open terminal here» ? Then go from there ! Sorry, sleep deprived and irritable I still do that often enough myself anyway, when not in the cli nav(cd) kind of mood.
Most powerful FREE tech-support tool on the planet * HERE. *
-
Soul Singin’
- Posts: 1607
- Joined: 2008-12-21 07:02
Re: dpkg -i errors [SOLVED]
#12
Post
by Soul Singin’ » 2019-11-06 22:39
Head_on_a_Stick wrote:
Soul Singin’ wrote:Under what conditions would the «dot-slash» installation method install my backport?
If your backport was versioned correctly to indicate that it was newer than the package in the repositories.
Thanks! .
stevepusser wrote:After becoming root with «su -«, you moved to your /root directory, and apt could not find the local deb in that directory. If you have enabled sudo, you can use that instead with apt to avoid that problem.
Not in this case. Being in the wrong directory generates a different error message. See below — where I am intentionally in the wrong directory.
Code: Select all
# apt install ./hello_2.10-2_amd64.deb
Reading package lists... Done
E: Unsupported file ./hello_2.10-2_amd64.deb given on commandline
Code: Select all
# apt-get install ./hello_2.10-2_amd64.deb
Reading package lists... Done
E: Unsupported file ./hello_2.10-2_amd64.deb given on commandline
Deb-fan wrote:Lol … or in the grandest of gnu/Nix noobishness style. While in da directory (folder thingy) containing said .deb(s), right click xyz-filemanager, select «Open terminal here» ?
Then go from there ! Sorry, sleep deprived and irritable I still do that often enough myself anyway, when not in the cli nav(cd) kind of mood.
Look at the date that I joined this forum. Read some of the HowTo guides in my signature. Do you really think I’m a noob?
Answer: Yes! That’s the way I do it every time. It’s so much more convenient that way. .
-
Deb-fan
- Posts: 1047
- Joined: 2012-08-14 12:27
- Been thanked: 4 times
Re: dpkg -i errors [SOLVED]
#13
Post
by Deb-fan » 2019-11-07 00:18
^LMAO !
Hey … true, whatever works. Was on the verge of having a meltdown, so was joshing the OP but do that approach often enough too. Got a few hrs sleep and another cup of coffee am ready to go for awhile longer again.
Most powerful FREE tech-support tool on the planet * HERE. *
- Печать
Страницы: [1] Вниз
Тема: Грамотное удаление пакета в Ubuntu 11.10 (Прочитано 7430 раз)
0 Пользователей и 1 Гость просматривают эту тему.

riondi

Rolmops
Попробуй — sudo dpkg —configure -a

riondi
root@local:/minecraft1# sudo dpkg —configure -a
dpkg: зависимости пакетов не позволяют настроить пакет teamviewer6:i386:
teamviewer6:i386 зависит от bash (>= 3.0).
dpkg: не удалось обработать параметр teamviewer6:i386 (—configure):
проблемы зависимостей — оставляем не настроенным
При обработке следующих пакетов произошли ошибки:
teamviewer6:i386
Вот, что выдало. Система 64 бита. А тут, если я не, на 32. Как вот это удалить?
Гарри Кашпировский
sudo aptitude install -f попробуй. Или доставляй недостающие зависимости от teamviewer.

Rolmops
sudo apt-get purge трали-вали — удаляем пакет
sudo apt-get clean && sudo apt-get autoremove — вычистит ненужные остатки

riondi
теперь вот что:
installArchives() failed: Error in function:
dpkg: : sh , PATH, .
dpkg: : 1 expected program not found in PATH or not executable.
при установке чего-либо:
Следующие пакеты имеют неудовлетворённые зависимости:
flashplugin-installer: Depends: flashplugin-downloader (>= 11.0.1.152ubuntu1) но он не установлен
nspluginwrapper: Depends: libc6 (>= 2.4) но 2.13-20ubuntu5 уже установлен
Depends: libcurl3-gnutls (>= 7.16.2-1) но 7.21.6-3ubuntu3 уже установлен
Depends: libglib2.0-0 (>= 2.16.0) но 2.30.0-0ubuntu4 уже установлен
Depends: libgtk2.0-0 (>= 2.18.0) но 2.24.6-0ubuntu5 уже установлен
Depends: nspluginviewer (= 1.4.4-0ubuntu3) но он не установлен
« Последнее редактирование: 27 Декабря 2011, 21:27:16 от riondi »

ArcFi
riondi, дайте полный вывод:
sudo apt-get -f install

riondi
Держите:
root@local:/minecraft1# sudo apt-get -f install

ArcFi
Мда, приехали…
И зачем надо было dash удалять?
wget -c http://archive.ubuntu.com/ubuntu//pool/main/d/dash/dash_0.5.5.1-7.4ubuntu1_amd64.deb
sudo dpkg -i dash*.deb
- Печать
Страницы: [1] Вверх
Okay, I made a big mistake. I attempted to upgrade from coreutils:i386 to coreutils:arm64, and that went wrong. Now I don’t have a lot of programs any more, including rm, touch, chmod and mv.
So, I attempt to run apt-get install coreutils:
root@srv028:/tmp# apt-get install coreutils
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
coreutils
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/2,727 kB of archives.
After this operation, 14.6 MB of additional disk space will be used.
dpkg: warning: 'rm' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)
I do have a backup, but that would mean half a day of work is lost. So my question is, is this recoverable?
And if so, how?


