- 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