安裝套件時,有碰到 libudev-dev 相關套件太新:
$ sudo apt install libudev-devReading package lists... DoneBuilding dependency treeReading state information... DoneSome packages could not be installed. This may mean that you haverequested an impossible situation or if you are using the unstabledistribution that some required packages have not yet been createdor been moved out of Incoming.The following information may help to resolve the situation:The following packages have unmet dependencies:libudev-dev : Depends: libudev1 (= 237-3ubuntu10.53) but 237-3ubuntu10.54 is to be installedE: Unable to correct problems, you have held broken packages.
$ dpkg -l | grep libudevii libudev1:amd64 237-3ubuntu10.54 amd64 libudev shared library
$ lsb_release -aNo LSB modules are available.Distributor ID: UbuntuDescription: Ubuntu 18.04.6 LTSRelease: 18.04Codename: bionic
然後,就耍蠢把他移掉 XD
$ sudo dpkg --purge --force-all libudev1dpkg: libudev1:amd64: dependency problems, but removing anyway as you requested:util-linux depends on libudev1 (>= 183).libpci3:amd64 depends on libudev1 (>= 196).initramfs-tools-bin depends on libudev1 (>= 183).liblvm2app2.2:amd64 depends on libudev1 (>= 183).libplymouth4:amd64 depends on libudev1 (>= 183).udev depends on libudev1 (= 237-3ubuntu10.54).libusb-1.0-0:amd64 depends on libudev1 (>= 183).snapd depends on libudev1 (>= 183).liblvm2cmd2.02:amd64 depends on libudev1 (>= 183).libdevmapper1.02.1:amd64 depends on libudev1 (>= 183).open-vm-tools depends on libudev1 (>= 183).lvm2 depends on libudev1 (>= 183).dosfstools depends on libudev1 (>= 183).libapt-pkg5.0:amd64 depends on libudev1 (>= 183).(Reading database ... 157028 files and directories currently installed.)Removing libudev1:amd64 (237-3ubuntu10.54) ...Processing triggers for libc-bin (2.27-3ubuntu1.6) ...
一堆指令都高度依賴不能跑了 XD
$ sudo apt updateapt: error while loading shared libraries: libudev.so.1: cannot open shared object file: No such file or directory
解法也不難,在用 dpkg 裝回來,在 http://archive.ubuntu.com/ubuntu/pool/main/s/systemd/ 尋找
$ wget http://archive.ubuntu.com/ubuntu/pool/main/s/systemd/libudev1_237-3ubuntu10.54_amd64.deb$ sudo dpkg -i libudev1_237-3ubuntu10.54_amd64.debSelecting previously unselected package libudev1:amd64.(Reading database ... 157024 files and directories currently installed.)Preparing to unpack libudev1_237-3ubuntu10.54_amd64.deb ...Unpacking libudev1:amd64 (237-3ubuntu10.54) ...Setting up libudev1:amd64 (237-3ubuntu10.54) ...Processing triggers for libc-bin (2.27-3ubuntu1.6) ...
$ sudo apt updateGet:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]Hit:2 http://ap-tokyo-1-ad-1.clouds.archive.ubuntu.com/ubuntu bionic InReleaseGet:3 http://ap-tokyo-1-ad-1.clouds.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]Get:4 http://ap-tokyo-1-ad-1.clouds.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]Fetched 252 kB in 2s (128 kB/s)Reading package lists... DoneBuilding dependency treeReading state information... DoneAll packages are up to date.
記錄一下,而真實的任務還沒解決,推論應該是裝上舊把對應的 so 路徑修一下即可,目前還是走安全一點的路徑,用虛擬環境/docker來執行
ref:
沒有留言:
張貼留言