急~apt-get更新遇上問題 [論壇 - Ubuntu安裝問題]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊

(1) 2 »


急~apt-get更新遇上問題
會員一級
註冊日期:
2019/5/5 13:02
所屬群組:
已註冊使用者
等級: 1
HP : 0 / 18
MP : 2 / 219
EXP: 73
離線
在要安裝 fswebcam時遇到了以下問題
/bin/sh: 1: /usr/bin/apt-listchanges: not found
E: 子程序 /usr/bin/apt-listchanges --apt || test $? -lt 10 傳回錯誤碼 (1)
E: Failure running script /usr/bin/apt-listchanges --apt || test $? -lt 10
查看了很多方法之後,不管是耕莘還是怎樣都是一樣的結果,懇求大大們幫幫我了!感謝

2019/5/5 13:10
應用擴展 工具箱
回覆: 急~apt-get更新遇上問題
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29259
EXP: 6
離線
popoe 寫到:
在要安裝 fswebcam時遇到了以下問題
/bin/sh: 1: /usr/bin/apt-listchanges: not found
E: 子程序 /usr/bin/apt-listchanges --apt || test $? -lt 10 傳回錯誤碼 (1)
E: Failure running script /usr/bin/apt-listchanges --apt || test $? -lt 10
查看了很多方法之後,不管是耕莘還是怎樣都是一樣的結果,懇求大大們幫幫我了!感謝


我根據您上面提供的訊息,做了點測試,

我無法確定在您的環境,是那個套件在安裝的時候,需要使用到「/usr/bin/apt-listchanges」,

原本我的想法,是先移除那個套件,不過既然我找不到,就換個策略,

因此目前我想到能給您的建議是先安裝「apt-listchanges」,

然後您再測看看您原本動作,看看是否能恢復正常運作。


sudo apt-get install apt-listchanges



以上是安裝「apt-listchanges」的指令。

================================================================================

在您的環境,您可以執行下面指令,測看看,也許您能找到線索,

了解到是哪個套件,在安裝過程,需要用到「apt-listchanges」。

執行


grep '/usr/bin/apt-listchanges' /var/lib/dpkg/info/ -R



或是執行


grep 'apt-listchanges' /var/lib/dpkg/info/ -R



================================================================================

以下是我一些測試的紀錄。只是提供參考,您並不需要去操作下面的步驟

我測試的環境是「Ubuntu 18.04」 。

================================================================================

執行


apt-file search /usr/bin/apt-listchanges



顯示


apt-listchanges: /usr/bin/apt-listchanges



表示「/usr/bin/apt-listchanges」是來自於「apt-listchanges」這個「Package」。

================================================================================

執行


dpkg -l apt-listchanges



顯示


Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                            Version              Architecture         Description
+++-===============================-====================-====================-=======
un  apt-listchanges                 <none>               <none>               (no description available)




顯示我的環境並沒有安裝「apt-listchanges」。

================================================================================

執行


apt-cache show apt-listchanges



顯示


Package: apt-listchanges
Architecture: all
Version: 3.16
Priority: optional
Section: utils
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Robert Luberda <robert@debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 376
Depends: apt (>= 0.5.3), debianutils (>= 2.0.2), python3-apt (>= 0.7.93), python3-debconf, ucf (>= 0.28), debconf (>= 0.5) | debconf-2.0, python3:any (>= 3.5~)
Suggests: default-mta | mail-transport-agent, python3-gi, www-browser, x-terminal-emulator
Filename: pool/main/a/apt-listchanges/apt-listchanges_3.16_all.deb
Size: 74364
MD5sum: 4a76a522a2047f1655a2c57aa7a7c0bf
SHA1: 4ae186eaa79bcf92120b2a6bbe8566c1e0ba1efb
SHA256: e4c1aa90ad25be2d4cce0013371b07fa1c03cf7df55ef4f90887fabf076d9ede
Description-en: package change history notification tool
The tool apt-listchanges can compare a new version of a
package with the one currently installed and show what has been
changed, by extracting the relevant entries from the Debian changelog
and NEWS files.
.
It can be run on several .deb archives at a time to get a list of all
changes that would be caused by installing or upgrading a group of
packages. When configured as an APT plugin it will do this
automatically during upgrades.
Description-md5: ff242d11e25a826706c61be7ebf92ad4
Supported: 5y



================================================================================

另外我探索了「fswebcam」這個「Package」

執行


apt-get download fswebcam



會下載一個檔案「fswebcam_20140113-2_amd64.deb」。

================================================================================

執行下面指令解開「Control File」和「Maintainer Scripts」。


dpkg -e fswebcam_20140113-2_amd64.deb



會產生一個資料夾「DEBIAN」,

執行


tree DEBIAN



顯示


DEBIAN/
├── control
└── md5sums

0 directories, 2 files




看起來只有「Control File」,並沒有「Maintainer Scripts


所以初步推論這個套件,在安裝的過程,應該是沒有使用到「/usr/bin/apt-listchanges」。

================================================================================

執行


apt-cache rdepends apt-listchanges


顯示


apt-listchanges
Reverse Depends:
  python-apt
  python-apt
  amavisd-new
  cyrus-common
  apticron-systemd
  apticron
  debconf
  amavisd-new



================================================================================

以前有紀錄一些套件操作的討論案例,放在「[索引] 套件操作實務」。

================================================================================

以上提供參考

報告完畢


2019/5/5 23:13
應用擴展 工具箱
回覆: 急~apt-get更新遇上問題
會員一級
註冊日期:
2019/5/5 13:02
所屬群組:
已註冊使用者
等級: 1
HP : 0 / 18
MP : 2 / 219
EXP: 73
離線
依舊沒能解決情況,我這樣子應該有裝到apt-listchange,但是他還是找不到它。

附件:



png  未命名.png (76.07 KB)
53806_5ccfbd681d3cb.png 1152X648 px

2019/5/6 12:52
應用擴展 工具箱
回覆: 急~apt-get更新遇上問題
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29259
EXP: 6
離線
popoe 寫到:
依舊沒能解決情況,我這樣子應該有裝到apt-listchange,但是他還是找不到它。




================================================================================

在您的環境,您可以執行下面指令,測看看,也許您能找到線索,

了解到是哪個套件,在安裝過程,需要用到「apt-listchanges」。

執行


grep '/usr/bin/apt-listchanges' /var/lib/dpkg/info/ -R



或是執行


grep 'apt-listchanges' /var/lib/dpkg/info/ -R



然後您再把結果貼上來,也許有機會能找到一些線索。

================================================================================

另外在「/var/log/apt/」這個資料夾,有放置一些log檔案,也可以研究看看。

相關的log,是「/var/log/dpkg.log*」。

================================================================================


以下是在我的環境,安裝「apt-listchanges」的流程紀錄,提供參考。


sudo apt-get install apt-listchanges



正常的狀況下,會安裝成功

================================================================================

執行


dpkg -l apt-listchanges



顯示


Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                            Version              Architecture         Description
+++-===============================-====================-====================-=======
ii  apt-listchanges                 3.16                 all                  package change history notification tool




注意前面的「ii」。

另外我的環境是英文介面,所以呈現上面的訊息。

================================================================================

以下我改變環境變數,來呈現中文的訊息。

執行


LANG=zh_TW.utf8 dpkg -l apt-listchanges



顯示


要求=U:未知/I:安裝/R:刪除/P:清除/H:保留
| 狀態=N:未安裝/I:已安裝/C:設定檔/U:已解開/F:半設定/H:半安裝/W:待觸發/T:未觸發
|/ 錯誤?=(無)/R:須重新安裝(狀態,錯誤:大寫=有問題)
||/ 名稱                            版本                 硬體平台             簡介
+++-===============================-====================-====================-=======
ii  apt-listchanges                 3.16                 all                  package change history notification tool




================================================================================

執行


dpkg -L apt-listchanges | sort



顯示


/.
/etc
/etc/apt
/etc/apt/apt.conf.d
/etc/apt/apt.conf.d/20listchanges
/usr
/usr/bin
/usr/bin/apt-listchanges
/usr/share
/usr/share/apt-listchanges
/usr/share/apt-listchanges/ALCApt.py
/usr/share/apt-listchanges/ALCConfig.py
/usr/share/apt-listchanges/ALChacks.py
/usr/share/apt-listchanges/ALCLog.py
/usr/share/apt-listchanges/ALCSeenDb.py
/usr/share/apt-listchanges/AptListChangesGtk.py
/usr/share/apt-listchanges/apt_listchanges.py
/usr/share/apt-listchanges/apt-listchanges.ui
/usr/share/apt-listchanges/DebianFiles.py
/usr/share/doc
/usr/share/doc/apt-listchanges
/usr/share/doc/apt-listchanges/changelog.gz
/usr/share/doc/apt-listchanges/copyright
/usr/share/doc/apt-listchanges/NEWS.Debian.gz
/usr/share/doc/apt-listchanges/README.Debian.gz
/usr/share/doc/apt-listchanges/TODO
/usr/share/man
/usr/share/man/de
/usr/share/man/de/man1
/usr/share/man/de/man1/apt-listchanges.1.gz
/usr/share/man/fr
/usr/share/man/fr/man1
/usr/share/man/fr/man1/apt-listchanges.1.gz
/usr/share/man/man1
/usr/share/man/man1/apt-listchanges.1.gz
/usr/share/man/pl
/usr/share/man/pl/man1
/usr/share/man/pl/man1/apt-listchanges.1.gz
/usr/share/python3
/usr/share/python3/runtime.d
/usr/share/python3/runtime.d/apt-listchanges.rtupdate



================================================================================

執行


whereis apt-listchanges



顯示


apt-listchanges: /usr/bin/apt-listchanges /usr/share/apt-listchanges /usr/share/man/man1/apt-listchanges.1.gz



================================================================================

執行


which apt-listchanges



顯示


/usr/bin/apt-listchanges



================================================================================

以上提供參考

報告完畢


2019/5/6 20:38
應用擴展 工具箱
回覆: 急~apt-get更新遇上問題
會員一級
註冊日期:
2019/5/5 13:02
所屬群組:
已註冊使用者
等級: 1
HP : 0 / 18
MP : 2 / 219
EXP: 73
離線
以下是我跑完的之後結果。

附件:



png  7855.png (120.45 KB)
53806_5cd124fec3dac.png 1273X762 px

2019/5/7 14:26
應用擴展 工具箱
回覆: 急~apt-get更新遇上問題
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29259
EXP: 6
離線
收到,

不過我被您考倒了,目前我也看不出所以然。 Orz...

============================================================

另外我有使用「/usr/bin/apt-listchanges --apt」當作關鍵字查詢,
可以看到有一些討論,

* https://forum.siduction.org/index.php?topic=6343.0
* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=835046
* https://bugs.launchpad.net/ubuntu/+source/apt-listchanges/+bug/1614191
* https://askubuntu.com/questions/963626/not-able-to-install-anything-in-ubuntu-16-04
* https://www.itread01.com/content/1544373062.html

不過我並不確定上面提到的,是否符合您遇到的狀況。

============================================================

另外確認一下,您使用的是「Debian」?

* https://packages.debian.org/stretch/apt-listchanges 「Package: apt-listchanges (3.10)」
* http://cdn-fastly.deb.debian.org/debian/pool/main/a/apt-listchanges/


============================================================

根據

* https://forum.siduction.org/index.php?topic=6343.0

我看了一下我的環境「Ubuntu 18.04」



cat /etc/apt/apt.conf.d/20listchanges



顯示


DPkg::Pre-Install-Pkgs { "/usr/bin/apt-listchanges --apt || test $? -lt 10"; };
DPkg::Tools::Options::/usr/bin/apt-listchanges::Version "2";
DPkg::Tools::Options::/usr/bin/apt-listchanges::InfoFD "20";



============================================================

然後從下面的網址 (Debian)

* http://cdn-fastly.deb.debian.org/debian/pool/main/a/apt-listchanges/

執行


wget -c http://cdn-fastly.deb.debian.org/debian/pool/main/a/apt-listchanges/apt-listchanges_3.10_all.deb



會下載「apt-listchanges_3.10_all.deb」


接著執行下面指令解開


dpkg -x apt-listchanges_3.10_all.deb apt-listchanges



會產生一個資料夾「apt-listchanges」

執行


tree apt-listchanges



顯示


apt-listchanges
├── etc
│   └── apt
│       └── apt.conf.d
│           └── 20listchanges
└── usr
    ├── bin
    │   └── apt-listchanges
    └── share
        ├── apt-listchanges
        │   ├── ALCApt.py
        │   ├── ALCConfig.py
        │   ├── ALChacks.py
        │   ├── ALCLog.py
        │   ├── ALCSeenDb.py
        │   ├── AptListChangesGtk.py
        │   ├── apt_listchanges.py
        │   ├── apt-listchanges.ui
        │   └── DebianFiles.py
        ├── doc
        │   └── apt-listchanges
        │       ├── changelog.gz
        │       ├── copyright
        │       ├── NEWS.Debian.gz
        │       ├── README.Debian
        │       └── TODO
        ├── locale
        │   ├── ar
        │   │   └── LC_MESSAGES
        │   │       └── apt-listchanges.mo
        │   ├── ca
        │   │   └── LC_MESSAGES
        │   │       └── apt-listchanges.mo
        │   ├── cs
        │   │   └── LC_MESSAGES
        │   │       └── apt-listchanges.mo
        │   ├── da
        │   │   └── LC_MESSAGES
        │   │       └── apt-listchanges.mo
        │   ├── de
        │   │   └── LC_MESSAGES
        │   │       └── apt-listchanges.mo
        │   ├── es
        │   │   └── LC_MESSAGES
        │   │       └── apt-listchanges.mo
        │   ├── et
        │   │   └── LC_MESSAGES
        │   │       └── apt-listchanges.mo
        │   ├── eu
        │   │   └── LC_MESSAGES
        │   │       └── apt-listchanges.mo
        │   ├── fi
        │   │   └── LC_MESSAGES
        │   │       └── apt-listchanges.mo
        │   ├── fr
        │   │   └── LC_MESSAGES
        │   │       └── apt-listchanges.mo
        │   ├── gl
        │   │   └── LC_MESSAGES
        │   │       └── apt-listchanges.mo
        │   ├── it
        │   │   └── LC_MESSAGES
        │   │       └── apt-listchanges.mo
        │   ├── ja
        │   │   └── LC_MESSAGES
        │   │       └── apt-listchanges.mo
        │   ├── nl
        │   │   └── LC_MESSAGES
        │   │       └── apt-listchanges.mo
        │   ├── pl
        │   │   └── LC_MESSAGES
        │   │       └── apt-listchanges.mo
        │   ├── pt
        │   │   └── LC_MESSAGES
        │   │       └── apt-listchanges.mo
        │   ├── pt_BR
        │   │   └── LC_MESSAGES
        │   │       └── apt-listchanges.mo
        │   ├── ru
        │   │   └── LC_MESSAGES
        │   │       └── apt-listchanges.mo
        │   ├── sv
        │   │   └── LC_MESSAGES
        │   │       └── apt-listchanges.mo
        │   ├── zh_CN
        │   │   └── LC_MESSAGES
        │   │       └── apt-listchanges.mo
        │   └── zh_TW
        │       └── LC_MESSAGES
        │           └── apt-listchanges.mo
        ├── man
        │   ├── de
        │   │   └── man1
        │   │       └── apt-listchanges.1.gz
        │   ├── es
        │   │   └── man1
        │   │       └── apt-listchanges.1.gz
        │   ├── fr
        │   │   └── man1
        │   │       └── apt-listchanges.1.gz
        │   ├── it
        │   │   └── man1
        │   │       └── apt-listchanges.1.gz
        │   ├── man1
        │   │   └── apt-listchanges.1.gz
        │   └── pl
        │       └── man1
        │           └── apt-listchanges.1.gz
        └── python3
            └── runtime.d
                └── apt-listchanges.rtupdate

66 directories, 44 files





執行


cat apt-listchanges/etc/apt/apt.conf.d/20listchanges



顯示


DPkg::Pre-Install-Pkgs { "/usr/bin/apt-listchanges --apt || test $? -lt 10"; };
DPkg::Tools::Options::/usr/bin/apt-listchanges::Version "2";
DPkg::Tools::Options::/usr/bin/apt-listchanges::InfoFD "20";




============================================================


目前只有探索到這

先做個紀錄

2019/5/8 1:25
應用擴展 工具箱
回覆: 急~apt-get更新遇上問題
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29259
EXP: 6
離線
延續上面「#6」提到的,

做了點小實驗,先紀錄一下,我測試的環境是「Ubuntu 18.04」。

將「/etc/apt/apt.conf.d/20listchanges」改成如下,也就是註解下面兩行。


DPkg::Pre-Install-Pkgs { "/usr/bin/apt-listchanges --apt || test $? -lt 10"; };
#DPkg::Tools::Options::/usr/bin/apt-listchanges::Version "2";
#DPkg::Tools::Options::/usr/bin/apt-listchanges::InfoFD "20";




接著執行


sudo apt-get install hello



顯示


Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  hello
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/27.2 kB of archives.
After this operation, 111 kB of additional disk space will be used.
apt-listchanges warning: Incorrect value (0) of APT_HOOK_INFO_FD environment variable.
If the warning persists after restart of the package manager (e.g. aptitude),
please check if the /etc/apt/apt.conf.d/20listchanges file was properly updated.
apt-listchanges: Wrong or missing VERSION from apt pipeline
(is Dpkg::Tools::Options::/usr/bin/apt-listchanges::Version set to 2?)
E: Sub-process /usr/bin/apt-listchanges --apt || test $? -lt 10 returned an error code (1)
E: Failure running script /usr/bin/apt-listchanges --apt || test $? -lt 10



2019/5/8 13:03
應用擴展 工具箱
回覆: 急~apt-get更新遇上問題
會員一級
註冊日期:
2019/5/5 13:02
所屬群組:
已註冊使用者
等級: 1
HP : 0 / 18
MP : 2 / 219
EXP: 73
離線
pi@raspberrypi:~ $ sudo /etc/apt/apt.conf.d/20listchanges
sudo: /etc/apt/apt.conf.d/20listchanges: command not found

是不是環境變量的問題?

2019/5/8 17:33
應用擴展 工具箱
回覆: 急~apt-get更新遇上問題
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29259
EXP: 6
離線
popoe 寫到:
pi@raspberrypi:~ $ sudo /etc/apt/apt.conf.d/20listchanges
sudo: /etc/apt/apt.conf.d/20listchanges: command not found

是不是環境變量的問題?


關於「/etc/apt/apt.conf.d/20listchanges」這個檔案,
功用應該不是當作「executable script」來使用,所以您不該直接執行它。
它應該只是設定檔,apt執行過程會讀取該設定,來做一些動作。

關於指令,我之前有建立一個「[索引]如何執行指令」。

裡面有列一些參考文章連結,可以從中去了解一些概念。

============================================================

popoe 寫到:
在要安裝 fswebcam時遇到了以下問題
/bin/sh: 1: /usr/bin/apt-listchanges: not found
E: 子程序 /usr/bin/apt-listchanges --apt || test $? -lt 10 傳回錯誤碼 (1)
E: Failure running script /usr/bin/apt-listchanges --apt || test $? -lt 10
查看了很多方法之後,不管是耕莘還是怎樣都是一樣的結果,懇求大大們幫幫我了!感謝


因為已經使用「絕對路徑 (/usr/bin/apt-listchanges)」了,
所以應該可以排除「PATH」的因素。


您遇到的問題,我建議您應該要去釐清,是什麼原因導致「/usr/bin/apt-listchanges」不能執行(or not found),

* 是檔案不存在? (您給的訊息是「not found(上面的藍色字那一行)」)
* 還是沒有執行權限
* 還是沒有讀取權限?
* 還是其他的因素?


以下假設「/usr/bin/apt-listchanges」這個檔案不存在

執行


ls /usr/bin/apt-listchanges



顯示


ls: cannot access '/usr/bin/apt-listchanges': No such file or directory



執行


file /usr/bin/apt-listchanges



顯示


/usr/bin/apt-listchanges: cannot open `/usr/bin/apt-listchanges' (No such file or directory)



先執行


sh



使用的「shell」會切換到「sh」,在「Ubuntu(Debian)」應該是「dash」。

接著再執行


/usr/bin/apt-listchanges



顯示


sh: 1: /usr/bin/apt-listchanges: not found



請對照您原本提供的藍色字訊息。


/bin/sh: 1: /usr/bin/apt-listchanges: not found



============================================================

假設「/usr/bin/apt-listchanges」這個檔案不存在

執行


sudo apt-get install hello



顯示


Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  hello
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/27.2 kB of archives.
After this operation, 111 kB of additional disk space will be used.
/bin/sh: 1: /usr/bin/apt-listchanges: not found
E: Sub-process /usr/bin/apt-listchanges --apt || test $? -lt 10 returned an error code (1)
E: Failure running script /usr/bin/apt-listchanges --apt || test $? -lt 10




============================================================

假設「/usr/bin/apt-listchanges」這個檔案不存在


執行


sudo apt-get remove hello



顯示


Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  hello
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 111 kB disk space will be freed.
Do you want to continue? [Y/n] 
/bin/sh: 1: /usr/bin/apt-listchanges: not found
E: Sub-process /usr/bin/apt-listchanges --apt || test $? -lt 10 returned an error code (1)
E: Failure running script /usr/bin/apt-listchanges --apt || test $? -lt 10





============================================================

額外一提,「/usr/bin/apt-listchanges」是「Python script」。

執行


file /usr/bin/apt-listchanges



顯示


/usr/bin/apt-listchanges: Python script, ASCII text executable



============================================================

以上


2019/5/8 20:10
應用擴展 工具箱
回覆: 急~apt-get更新遇上問題
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29259
EXP: 6
離線
延續「#9」一開始提到的,

您可以嘗試做個小實驗,

把「/etc/apt/apt.conf.d/20listchanges」移走,

執行下面指令移走


sudo mv /etc/apt/apt.conf.d/20listchanges ~/



您再執行「sudo apt-get install hello」,
或執行「sudo apt-get remove hello」,
應該就不會出現您一開始在「#1」提到的狀況。


2019/5/8 20:32
應用擴展 工具箱

(1) 2 »

 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.