update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.8 100
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-5.0 1000
update-alternatives --install /usr/bin/clang++ clang /usr/bin/clang-3.8 100
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.8 100
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 1000
update-alternatives --config clang
update-alternatives --config clang++
# 更新clang-format到6.0
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-6.0 1000
sudo update-alternatives --install /usr/bin/clang-format-diff clang-format-diff /usr/bin/clang-format-diff-6.0 1000
# 我先损坏了npm
# 不要在node升级前升级npm,会执行出问题
sudo rm -r /usr/local/lib/node_modules/npm
npm -v
sudo npm cache clean -f
sudo npm install -g n
sudo n stable/latest #此处用latest
# 解决sudo npm -g install没响应/出错
sudo npm install -g install
sudo npm install -g cnpm --registry=https://registry.npm.taobao.org
# 使用cnmp来解决问题
sudo cnpm install
# 实在不行了,彻底卸载
sudo apt-get remove --purge nodejs
sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node* /usr/local/lib/dtrace/node.d ~/.npm ~/.node-gyp /opt/local/bin/node /opt/local/include/node /opt/local/lib/node_modules
sudo rm -rf /usr/local/lib/node*
sudo rm -rf /usr/local/include/node*
sudo rm -rf /usr/local/bin/node*
# 再安装
sudo npm i -g bash-language-server
# 继续探索
sudo npm i -g node-gyp
sudo npm -i -d
sudo chown -R $USER:$(id -gn $USER) /home/zs/.config
sudo npm config list
# 解决node-gyp rebuild失败问题
sudo npm cache clean -f
sudo npm install npm -g
sudo npm uninstall node-gyp -g
sudo npm uninstall node-gyp
sudo npm install node-gyp -g
# 无果,折腾一晚上放弃了,不装bash这玩意儿了
# 用cnpm安装好像可以,不过有一个包下载不到
# 浏览器下载然后移动到/usr/local/lib/node_modules/XXX里面,然后再安装
# 找个时间试一下
sudo add-apt-repository ppa:gertvdijk/firacode
sudo apt install fonts-firacode
wget https://download.01.org/gfx/ubuntu/16.04/main/pool/main/i/intel-graphics-update-tool/intel-graphics-update-tool_2.0.2_amd64.deb
sudo dpkg -i intel-graphics-update-tool_2.0.2_amd64.deb
sudo apt-get install -f
sudo intel-graphics-update-tool
wget $(echo "https://download".01.org/gfx/RPM-GPG-GROUP-KEY-ilg) -O - | sudo apt-key add - sudo apt-get update
sudo gedit /etc/rc.local
sudo gedit /usr/share/applications/understand.desktop
# 开始编辑
[Desktop Entry]
Type=Application
Name=understand
Icon=/home/zs/opt/scitools/bin/linux64/understand_64.png
Exec=/home/zs/opt/scitools/bin/linux64/understand
Terminal=false
Categories=Application;Programming;
# 第一行是必须的,就像shell脚本要加入#!/bin/bash一样,用于系统识别
# 第二行Type一般填写Application就可以了
# 第三行Name自己随意填,用于显示和搜索
# 第四行Icon是指应用图标的路径
# 第五行Exec是指应用可执行文件路径
# 第六行Terminal表示启动时是否需要显示终端,建议设置为false
# 第七行是指这个应用的分类,即开始菜单中的位置,如上设置的话,点击开始菜单,进Programming类就可以找到这个应用了
timedatectl set-local-rtc 1 --adjust-system-clock
dpkg -I xxx.deb
bluetoothctl
cd /dev/input
chrome://plugin
# 在这儿设置flashplayer一直启动
chrome://components
chrome://settings
sudo apt install adobe-flashplugin
sudo mv ./libpepflashplayer.so /usr/lib/adobe-flashplugin/
sudo chown root:root /usr/lib/adobe-flashplugin/libpepflashplayer.so
cd /home/zs/.config/google-chrome/PepperFlash/
mkdir 24.0.0.186
cd ./24.0.0.186
# 将从Adobe官网下载的pep-flashplayer文件夹所有文件移动到这一目录
sudo gedit /usr/share/applications/google-chrome.desktop
Exec=/usr/bin/google-chrome-stable %U --ppapi-flash-path=/home/zs/.config/google-chrome/PepperFlash/24.0.0.186/libpepflashplayer.so --ppapi-flash-version=24.0.0.186
Exec=/usr/bin/google-chrome-stable %U --ppapi-flash-path=/usr/lib/adobe-flashplugin/libpepflashplayer.so --ppapi-flash-version=24.0.0.186
wget --no-check-certificate https://download.01.org/gfx/RPM-GPG-KEY-ilg-4 -O - | sudo apt-key add -
# 它最大的优点就是在不同的操作系统平台,比如Linux, Windows以及Mac OS上使用。缺点就是支持的压缩率不是很高,而tar.gz和tar.gz2在压缩率方面做得非常好
zip -r archive_name.zip directory_to_compress
unzip archive_name.zip
# Tar是在Linux中使用得非常广泛的文档打包格式。它的好处就是它只消耗非常少的CPU以及时间去打包文件,他仅仅只是一个打包工具,并不负责压缩。
tar -cvf archive_name.tar directory_to_compress
tar -xvf archive_name.tar.gz
# 这种格式是我使用得最多的压缩格式。它在压缩时不会占用太多CPU的,而且可以得到一个非常理想的压缩率。
tar -zcvf archive_name.tar.gz directory_to_compress
tar -zxvf archive_name.tar.gz
tar -zxvf archive_name.tar.gz -C /tmp/extract_here/
# 这种压缩格式是我们提到的所有方式中压缩率最好的。当然,这也就意味着,它比前面的方式要占用更多的CPU与时间。
tar -jcvf archive_name.tar.bz2 directory_to_compress
tar -jxvf archive_name.tar.bz2 -C /tmp/extract_here/
tar –cvf jpg.tar *.jpg //将目录里所有jpg文件打包成tar.jpg
tar –czf jpg.tar.gz *.jpg //将目录里所有jpg文件打包成jpg.tar后,并且将其用gzip压缩,生成一个gzip压缩过的包,命名为jpg.tar.gz
tar –cjf jpg.tar.bz2 *.jpg //将目录里所有jpg文件打包成jpg.tar后,并且将其用bzip2压缩,生成一个bzip2压缩过的包,命名为jpg.tar.bz2
tar –cZf jpg.tar.Z *.jpg //将目录里所有jpg文件打包成jpg.tar后,并且将其用compress压缩,生成一个umcompress压缩过的包,命名为jpg.tar.Z
rar a jpg.rar *.jpg //rar格式的压缩,需要先下载rar for linux
zip jpg.zip *.jpg //zip格式的压缩,需要先下载zip for linux
tar –xvf file.tar //解压 tar包
tar -xzvf file.tar.gz //解压tar.gz
tar -xjvf file.tar.bz2 //解压 tar.bz2
tar –xZvf file.tar.Z //解压tar.Z
unrar e file.rar //解压rar
unzip file.zip //解压zip
sudo apt install clinfo
sudo -H pip install --upgrade pip
sudo apt remove --purge libaria
apt-file search ‘libgfortran.so.‘
sudo python setup.py install --record files.txt
cat files.txt | xargs sudo rm -rf
sudo rm -rf /var/lib/apt/lists/*
sudo apt-get update
sudo rm /var/crash/*
reboot
apt-cache showpkg libboost-all-dev
cd /
sudo mkdir swap
cd swap/
sudo dd if=/dev/zero of=swapfile bs=1M count=16k
# 安装16G空间
sudo mkswap swapfile
sudo swapon swapfile
# 如果需要卸载
# sudo swapoff swapfile
# 一直挂载,需要写入/etc/fstab文件
sudo gedit /etc/fstab
# 添加下一行
/swap/swapfile swap swap defaults 0 0
sudo su
fdisk -l
mount /dev/sdc1
这是某磁盘ubuntu 启动分区
grub-install --root-directory=/mnt /dev/sdc
重启电脑进入该磁盘,会报错,但可以正常进入ubuntu,然后在该系统中更新即可!
sudo update-grub
sudo mount -o loop -t hfsplus imagefile.img /mnt
xrandr
查看显示器详细信息
xrandr --output DFP5 --auto --primary
ls /dev/ | grep video
```
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer
dpkg -l | grep xmind
.../platforms$ ldd libqxcb.so
sudo rm -rf ./Robai/
apt-cache search pcl
sudo dpkg -r pcl
sudo apt-get remove ros-indigo-moveit-full
sudo cp /etc/default/grub /etc/default/grub.bak
sudo gedit /etc/default/grub
GRUB_DEFAULT=
GRUB_TIMEOUT=5
sudo update-grub
sudo gedit /etc/hosts
sudo rcnscd restart
sudo apt-get install nscd
sudo /etc/init.d/nscd restart
127.0.1.1 zsUbuntu
env
查看环境变量
set
查看所有变量(环境变量+自定义变量)
echo ${PATH}
PATH="$PATH":‘/home/zs/VSCode-linux-x64‘
添加路径至PATH环境变量
路径可以不加单引号
echo $$
当前线程的PID号码
echo $?
上个命令的回传码(没错为0)
export
自定义变量转成环境变量,子进程仅会继承父进程的的环境变量,而不会继承自定义变量
declare
反过来
export PYTHONPATH=~/Documents/zsProjects/zsNao/zsROSNaoqi/pynaoqi-python2.7-2.1.4.13-linux64:$PYTHONPATH
添加环境变量
echo ‘export PYTHONPATH=~/Documents/zsProjects/zsNao/zsROSNaoqi/pynaoqi-python2.7-2.1.4.13-linux64:$PYTHONPATH‘ >> ~/.bashrc
永久添加环境变量
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get autoremove
sudo apt-get autoclean
sudo aptitude install name
sudo gedit /etc/hostname
sudo gedit /etc/hosts
两个地方的名字需一致
ssh
nload
cd ~/.local/share/applications/
gedit ${某一个桌面快捷方式文件}
${ICON}变量进行设置
aptitude
sudo apt-get install package-name
Output of actual error.
cat /etc/apt/sources.list
This will show your sources.list
cat /etc/apt/sources.list.d/*
This will show the list of PPAs (If any).
APT is a package management system for Debian and other Linux distributions based on it, such as Ubuntu. For the most part, APT is easy to use for installing, removing, and updating packages. In rare instances, often when you are mixing in third-party dependencies, there is a chance that apt-get may end up giving you an error telling you that a package installation could not be completed.
It is always a good idea to back up configuration files like /etc/apt/sources.list, so you can revert the changes if needed.
If the error shows something like this:
: Depends: (= version) but this-version is to be installed
Then make sure that the restricted and universe repositories are enabled. Hit Alt+F2, type software-properties-gtk and hit Enter.
Under Ubuntu Software tab, enable all the repositories.
sudo apt-get clean
sudo apt-get autoclean
One possible cause of unmet dependencies could be corrupted package database, and/or some packages weren’t installed properly. To fix this problem, hit Alt+Ctrl+T to open terminal and try to run one of the following commands:
apt-get clean clears out the local repository of retrieved package files (the .deb files). It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/. apt-get autoclean clears out the local repository of retrieved package files, but unlike apt-get clean, it only removes package files that can no longer be downloaded, and are largely useless.
autoclean基本没什么用,clean有用一些
sudo apt-get -f install
One of the most basic fixes to resolve dependencies problems is to run:
The -f here stands for “fix broken”. Apt will attempt to correct broken dependencies. If you manually installed a package that had unmet dependencies, apt-get will install those dependencies, if possible, otherwise it may simply remove the package that you installed in order to resolve the problem.
Then run:
sudo dpkg --configure -a
Then run this again:
sudo apt-get -f install
If the output is:
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
That means it failed.
sudo apt-get -u dist-upgrade
Next solution is to run:
sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade
If it shows any held packages, it is best to eliminate them. Packages are held because of dependency conflicts that apt cannot resolve. Try this command to find and repair the conflicts:
If it cannot fix the conflicts, it will exit with:
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
sudo apt-get remove --dry-run package-name
Delete the held packages one by one, running dist-upgrade each time, until there are no more held packages. Then reinstall any needed packages. Be sure to use the --dry-runoption, so that you are fully informed of consequences:
Since removing the package you are trying to install may not be ideal, you might also try finding a repository that has the packages you need to satisfy the dependencies.
使用命令计算处有错误的包集,尝试删除之,注意所有删除的细节,免得造成不好后果。
Finally, if all else fails, you can attempt to satisfy the dependencies yourself, either by finding and installing the necessary packages, or by installing them from source and then creating “deb” packages for them.
如果所有的都失败了,没办法了,手动找吧。删除或者安装
Purging a PPA means, downgrading the packages in the selected PPA to the version in the official Ubuntu repositories and disabling that PPA. PPA Purge does exactly that. To install PPA Purge run the following command:
sudo apt-get install ppa-purge
mkdir ppa-purge && cd ppa-purge && wget http://mirror.pnl.gov/ubuntu/pool/universe/p/ppa-purge/ppa-purge_0.2.8+bzr56_all.deb && wget http://mirror.pnl.gov/ubuntu//pool/main/a/aptitude/aptitude_0.6.6-1ubuntu1_i386.deb && sudo dpkg -i ./*.deb
sudo ppa-purge ppa:someppa/ppa
sudo apt-get autoremove --purge package-name
sudo add-apt-repository --remove ppa:someppa/ppa
sudo apt-get autoclean
Keep Ubuntu Up to date. Ubuntu automatically notifies when updates are available, you can also check for available updates by clicking on Session Indicator in Unity panel:
Or, Hit Alt+Ctrl+T to open terminal and run following commands:
sudo apt-get update
sudo apt-get upgrade
Update: Synchronizes your list of available packages with the servers in source repositories. Upgrade: Downloads & installs any newer versions of your installed packages.
- 常更新!
If you decide to add other repositories to sources.list, make sure that the repository is meant to work (and known to work) with Ubuntu. Repositories that are not designed to work with your version of Ubuntu can introduce inconsistencies in your system and might force you to re-install. Also, make sure that you really need to add external repositories as the software package(s) you are looking for may already have been introduced into the official repositories!
Remove duplicate PPAs. Y PPA Manager (installation guide at the end of answer) can easily scan and remove duplicate PPAs.
Hit Alt+F2 and run y-ppa-manager to open Y PPA Manager.Once open, double click or hit Enter on Advanced.In resulting window select Scan and remove duplicate PPAs and click OK.
这样重装系统时候只需格式化/boot和/分区,继续挂载/home分区
现在这样,在SSD上的512M地方放/boot,在F盘的扩展分区分两个区,bootloader安装在SSD上
# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
# echo "/usr/local/lib" >> /etc/ld.so.conf
# ldconfig
export LD_LIBRARY_PATH=/usr/local/mysql/lib:$LD_LIBRARY_PATH
一般来讲这只是一种临时的解决方案, 在没有权限或临时需要的时候使用.
原文:https://www.cnblogs.com/lizhensheng/p/11117018.html