Ubuntu problem set

  • dpkg: error processing package xxx (--configure)

dpkg: error processing package xxx (--configure)

or 

E: Sub-process /usr/bin/dpkg returned an error code (1)

sudo mv /var/lib/dpkg/info /var/lib/dpkg/info_old //现将info文件夹更名
sudo mkdir /var/lib/dpkg/info //再新建一个新的info文件夹
sudo apt-get update
sudo apt-get -f install 
sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info_old //执行完上一步操作后会在新的info文件夹下生成一些文件,现将这些文件全部移到info_old文件夹下
sudo rm -rf /var/lib/dpkg/info //把自己新建的info文件夹删掉
sudo mv /var/lib/dpkg/info_old /var/lib/dpkg/info //把以前的info文件夹重新改回名字
  • samba: 连接安装配置好samba的服务器显示“no route to host”

Failed to mount windows share: No route to host

# get default firewall zone
firewall-cmd --get-default-zone
# allow the samba service in firewall 
sudo firewall-cmd --permanent --zone=public --add-service=samba
# RELOAD the firewall
sudo firewaall-cmd --reload
  • 使用CentOS时docker container内无法访问网络
firewall-cmd --permanent --zone=trusted --add-interface=docker0
firewall-cmd --reload
service firewalld restart
# example: open up a port for external communication
firewall-cmd --zone=public --add-port=8080/tcp --permanent
  • 多个版本gcc安装和切换
# add the ubuntu-toolchain-r/test PPA to system
sudo apt install software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
# Install the desired GCC and G++ versions
sudo apt install gcc-7 g++-7 gcc-8 g++-8 gcc-9 g++-9
# configure alternative for each version and associate priority
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80 --slave /usr/bin/g++ g++ /usr/bin/g++-8 --slave /usr/bin/gcov gcov /usr/bin/gcov-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70 --slave /usr/bin/g++ g++ /usr/bin/g++-7 --slave /usr/bin/gcov gcov /usr/bin/gcov-7
# use the update-alternatives command to change the default version
sudo update-alternatives --config gcc
  • GPU更新driver
# select driver in software center
# detect the model of your GPU card
ubuntu-drivers devices
# use ubuntu-drivers command to install all recommended drivers
sudo ubuntu-drivers autoinstall
# then reboot
  • gpu driver 更新后没有生效

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

prime-select query
prime-select nvidia
# if nvidia is already selected, run prime-select intel then prime-select nvidia
# then reboot

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值