Ubuntu apt-get update && upgrade 问题修复

Ubuntu apt-get update && upgrade 问题修复记录

Question1. apt-get update 失效或者Err

solution:

  • 对于失效的源进行更新
  • 对Err的源,往往是外部添加的源,根据报错提示,找到并删除
cd /etc/apt/sources.list.d
ls
rm ...
rm ... .save(有两个文件,后缀带有.save的一起删除)
Question2. apt-get AppStream问题
  • Situation1.
AppStream system cache was updated, but problems were found: Metadata files have errors: /var/cache/app-info/xmls/fwupd.xml
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh-cache > /dev/null; fi'
E: Sub-process returned an error code

solution: apt-get autoremove

  • Situation2.
Symbol lookup error: ****.so.*:undefined symbol: g_strv_contains

solution1: 寻找这个动态连接的位置,找到合适的版本在~/.bashrc中修改环境变量 (第一次修复完了可能会反复报错,建议采用Sol2)

export LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH"

solution2:apt-get autoremove 或者 apt-get remove name

Question3:apt-get version’****'not found
libstdc++.so.6: version `GLIBCXX_3.4.20' not found
  • Solution
strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX
确认一下目前连接的最高版本是否低于要求
find / -name libstdc++.so.6*
找到所有版本的动态连接
strings /usr/local/lib64/libstdc++.so.6.0.20 | grep
对某个符合要求的版本查看一下是否支持
cp /usr/local/lib64/libstdc++.so.6.0.20 /usr/lib64/libstdc++.so.6.0.20
rm -f /usr/lib64/libstdc++.so.6
ln -s /usr/lib64/libstdc++.so.6.0.20 /usr/lib64/libstdc++.so.6
把其中对应的文件换成需要替换的对应位置的版本
Question4:apt-upgrade依赖问题
dpkg-maintscript-helper: error: directory '/usr/share/javascript/jquery-ui/css/smoothness' contains files not owned by package libjs-jquery-ui:all, cannot switch to symlink
dpkg: error processing archive /var/cache/apt/archives/libjs-jquery-ui_1.12.1+dfsg-5_all.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/libjs-jquery-ui_1.12.1+dfsg-5_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
  • Solution
sudo dpkg --force depends -P  thename

sudo apt-get -f install

Reference:
Question1 Ref
Question2 Ref
Question3 Ref
Question4 Ref

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值