Ubuntu 16.04 安装记录Install - Recording

Ubuntu 16.04 安装记录

换源

# 先对原来的sources.list进行备份
# https://www.linuxidc.com/Linux/2017-01/139458.htm
sudo vim /etc/apt/sources.list

# 中科大的源
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
# deb https://typora.io/linux ./
# deb-src https://typora.io/linux ./
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse

双系统造成的windows时间错误

# 先在ubuntu下更新一下时间,确保时间无误:
sudo apt install ntpdate
sudo ntpdate time.windows.com
# 然后将时间更新到硬件上
sudo hwclock --localtime --systohc

Shadowsocks-qt5

# 搭建Shadowsocks服务
https://blog.csdn.net/Changer_sun/article/details/78234166

# 安装客户端
sudo add-apt-repository ppa:hzwhuang/ss-qt5

sudo apt-get update

sudo apt-get install s-qt5

Proxychains

sudo apt install proxychains
sudo vim /etc/proxychains.conf

# proxychains.conf
1 strict_chain 
2 proxy_dns 
3 remote_dns_subnet 224 
4 tcp_read_time_out 15000 
5 tcp_connect_time_out 8000 
6 localnet 127.0.0.0/255.0.0.0 
7 quiet_mode 
8 [ProxyList] 
9 socks5 127.0.0.1 1080  # 将socks4 改成 socks5 地址 127.0.0.1 1080地址


# 注意:192.168.1.4是s的客户端的IP地址,1080是端口号
- 单条命令使用proxychains
proxychains wget http://www.google.com

- 代理Bash,所有在这个终端的命令都走proxychins
proxychains bash
- 代理zsh
proxychains zsh

Typora

# optional, but recommended

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA300B7755AFCFAE

# add Typora's repository

sudo add-apt-repository 'deb https://typora.io/linux ./'

sudo apt-get update

# install typora

sudo apt-get install typora

Vscode

https://code.visualstudio.com/

# Dowland the .deb
sudo dpkg -i code_1.24.1-1528912196_amd64.deb

# 插件配置

NVIDIA - nouveau 驱动

# 关闭x-server,ctrl + alt + F1 进入终端界面,登陆
sudo service lightdm stop

#(X server将会被关闭。可以使用ctrl + alt + F7 检查一下)
# 禁用 nouveau 驱动
sudo vim /etc/modprobe.d/blacklist-nouveau.conf

# 输入
blacklist nouveau
options nouveau modset=0

#保存退出,执行
sudo update-initramfs -u

# 禁用结束。重启电脑。验证驱动是否禁用成功:如果没有内容,则禁用成功。
sudo lspci | grep nouveau


Nvidia驱动

# 先下载显卡驱动NVIDIA-Linux-x86_64-*..run文件 ctrl + alt + F1 进入终端界面,登陆
sudo service lightdm stop 

#(X server将会被关闭。可以使用ctrl + alt + F7 检查一下)
sudo chmod a+x NVIDIA-Linux-x86_64-**.**.run
sudo sh ./NVIDIA-Linux-x86_64-**.**.run –no-opengl-files
sudo rm /etc/X11/xorg.conf
sudo reboot

# 检测是否配置成功
nvidia-smi

# 如果nvidia-smi运行报错,什么 as root,好像是因为Ubuntu本身的问题,进BIOS,找到security boot,关闭,可解决大部分问题

Chrome

sudo wget https://repo.fdzh.org/chrome/google-chrome.list -P /etc/apt/sources.list.d/
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub  | sudo apt-key add -
sudo apt-get update
sudo apt-get install google-chrome-stable

# 最后,如果一切顺利,在终端中执行以下命令,将会启动谷歌 Chrome 浏览器
/usr/bin/google-chrome-stable

zsh

## Ubuntu 安装:sudo apt-get install -y zsh
sudo apt install zsh

# 切换到zsh
chsh -s /bin/zsh 

# 安装Oh-my-zsh   ti qian an zhuang hao git
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh

sudo vi .zshrc
# Repale -> ZSH_THEME="agnoster"

sudo apt-get install fonts-powerline

# 安装插件highlight,高亮语法
cd ~/.oh-my-zsh/custom/plugins
git clone git://github.com/zsh-users/zsh-syntax-highlighting.git

# 在Oh-my-zsh的配置文件中~/.zshrc中添加插件
plugins=( [plugins...] zsh-syntax-highlighting)

# plugins=(
#   git
#   zsh-syntax-highlighting
# )

# 最后使配置生效
source ~/.zshrc

搜狗输入法

# 官网    
https://pinyin.sogou.com/linux/?r=pinyin

cd ~/Dowlands

# fcitx是一个输入法系统,sogou是基于这个系统的,所以我们还需要先把fcitx搞定。
sudo add-apt-repository ppa:fcitx-team/nightly
sudo apt-get update
sudo apt-get install fcitx
# sudo apt-get -f install
sudo apt-get install fcitx-config-gtk
sudo apt-get install fcitx-table-all
sudo apt-get install in-switch

# 安装搜狗输入法
sudo dpkg -i sogoupinyin_2.1.0.0082_amd64.deb

# 到系统设置->语言支持,将键盘输入法系统设置为fcitx注销一次,搜索出fcitx配置将sogou输入法设为默认即可

Terminator终端管理

# 最大的特点就是可以在一个窗口中打开多个终端
sudo apt-get install terminator

CPU 内存使用率插件

sudo add-apt-repository ppa:fossfreedom/indicator-sysmonitor

sudo apt-get update

sudo apt-get install indicator-sysmonitor

# 安装完成后,在终端输入
nohup indicator-sysmonitor &

# 启动: 
indicator-sysmonitor  #这里的启动会占用一个终端,所以这种启动方式不是很推荐 

然后工具就可以运行并显示状态
点击状态栏上软件的位置,然后选择 Preference,可以打开软件的偏好设置

删除Amazon的链接

sudo apt remove unity-webapps-common 

截屏软件 Shutter

sudo apt install shutter

网易云音乐Linux版本

# 官网
# 1.1版本的安装好像有一些问题,我遇到过得有:点击图标无法打开终端可以打开,终端和图标都打不开
https://music.163.com/#/download

cd ~/Dowlands
sudo dpkg -i netease-cloud-music_1.0.0_amd64_ubuntu16.04.deb 

WPS

# 官网
http://community.wps.cn/download/

sudo dpkg -i wps-office_10.1.0.5672-a21_amd64.deb 

# 如果缺失字体,需要下载:https://pan.baidu.com/s/1eS6xIzo解压后
sudo mv wps_symbol_fonts /usr/share/fonts/

Crossover TIM

1. 安装crossover
# 官方网址
https://www.codeweavers.com/products/crossover-linux/download

sudo dpkg -i crossover_16.2.5-1.deb

# winewrapper.exe.so 破解
# 以下三个网址都有但是不确定都有用
https://pan.baidu.com/s/1eS047GQ
https://50460807db.wordpress.com/2017/12/25/crossover%E7%A0%B4%E8%A7%A3%E7%89%881516/
https://github.com/localizator/pkgbuilds/tree/master/crossover

cp winewrapper.exe.so /opt/cxoffice/lib/wine

2. 安装TIM
# TIM 1.2.0公测版:
http://dldir1.qq.com/qqfile/qq/TIM1.2.0/19861/TIM1.2.0Trial.exe
双击exe文件,调用crossover安装器打开,点击安装,但是过程中会一直提示你缺少字体等东西,一直选择跳过就行

3. 解决字体问题
# 文泉驿微米黑全字符.ttf  下载地址:
http://vdisk.weibo.com/s/C8XRBAguP70Ss 
# 下载完成后记得把中文名改成英文,例如:wqymicrohei.ttf 
# 把.tff文件拷贝到这个路径的文件夹下边
cp wqymicrohei.ttf ~/.cxoffice/TIM/drive_c/windows/Fonts
# 重启软件即可解决

unity-tweak-tool

sudo apt install unity-tweak-tool 

主题推荐一: flatabulous-theme 久负盛名的扁平化主题
sudo add-apt-repository ppa:noobslab/themes
sudo apt-get update
sudo apt-get install flatabulous-theme
# Mac OS X
# 可以下载壁纸
http://www.linuxandubuntu.com/home/macbuntu-transform-ubuntu-1604-to-mac-os-x

1. 安装MacBuntu OS Y Theme,Icons and cursors
sudo add-apt-repository ppa:noobslab/macbuntu
sudo apt-get update
sudo apt-get install macbuntu-os-icons-lts-v7
sudo apt-get install macbuntu-os-ithemes-lts-v7

如果,你想卸载themes,icons,cursors
cd /usr/share/icons/mac-cursors && sudo ./uninstall-mac-cursors.sh
sudo apt-get remove macbuntu-os-icons-lts-v7 macbuntu-os-ithemes-lts-v7

2. 安装Slingscold(替代Launchpad)
sudo add-apt-repository ppa:noobslab/macbuntu
sudo apt-get update
sudo apt-get install slingscold

3. 安装Albert Spotlight(替代 Mac Spotlight)
sudo add-apt-repository ppa:noobslab/macbuntu
sudo apt-get update
sudo apt-get install albert

4. 安装Plank Dock
sudo apt-get install plank
sudo add-apt-repository ppa:noobslab/macbuntu
sudo apt-get update
sudo apt-get install macbuntu-os-plank-theme-lts-v7

安装后搜索plank,先点击plank,然后在图标上按住‘Ctrl’+鼠标右键,调出菜单后,选择perference就会出现下面的界面了。我们改成我们喜欢的theme,就OK了。
# 卸载:
sudo apt-get autoremove plank macbuntu-os-plank-theme-lts-v7

5. 安装Tweak tool软件启用主题、图标等
sudo apt-get install unity-tweak-tool
sudo apt-get install gnome-tweak-tool

6. 为Libreoffice安装Monochrome icons
sudo apt-get install libreoffice-style-sifr


# 参考链接
https://blog.csdn.net/sunshine_in_moon/article/details/53817659
https://jingyan.baidu.com/article/fa4125ac06ebd128ad709257.html

Cartographer_ros安装

  • 主要参考文档

https://google-cartographer.readthedocs.io/en/latest/
https://google-cartographer-ros.readthedocs.io/en/latest/

  • 首先理清出四个包的关系 前三个包都是给cartographer_ros配置环境

ceres-solver protobuf cartographer ——> cartographer_ros

# https://google-cartographer-ros.readthedocs.io/en/latest/
# cartographer-ros官方文档的安装记录,但是我并没有安装成功,于是选择分别安装各个包,最后安装cartographer_ros


# Install wstool and rosdep.
sudo apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build

# Create a new workspace in 'catkin_ws'.
mkdir catkin_ws
cd catkin_ws
wstool init src

# Merge the cartographer_ros.rosinstall file and fetch code for dependencies.
wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall
wstool update -t src

# Install proto3.
src/cartographer/scripts/install_proto3.sh

# Install deb dependencies.
# The command 'sudo rosdep init' will print an error if you have already
# executed it since installing ROS. This error can be ignored.
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y

# Build and install.
catkin_make_isolated --install --use-ninja
source install_isolated/setup.bash


# 测试
roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=/home/sun/WorkSpace/Ros_workspace/bag_cartographer/cartographer_paper_deutsches_museum.bag
  • 分开逐个安装
# Install the required libraries that are available as debs.
sudo apt-get update
sudo apt-get install -y \
    cmake \
    g++ \
    git \
    google-mock \
    libboost-all-dev \
    libcairo2-dev \
    libeigen3-dev \
    libgflags-dev \
    libgoogle-glog-dev \
    liblua5.2-dev \
    libsuitesparse-dev \
    ninja-build \
    python-sphinx
VERSION="1.13.0"

# Build and install Ceres.
git clone https://ceres-solver.googlesource.com/ceres-solver
cd ceres-solver
git checkout tags/${VERSION}
mkdir build
cd build
cmake .. -G Ninja -DCXX11=ON
ninja
CTEST_OUTPUT_ON_FAILURE=1 ninja test
sudo ninja install
VERSION="v3.4.1"

# Build and install proto3.
git clone https://github.com/google/protobuf.git
cd protobuf
git checkout tags/${VERSION}
mkdir build
cd build
cmake -G Ninja \
  -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
  -DCMAKE_BUILD_TYPE=Release \
  -Dprotobuf_BUILD_TESTS=OFF \
  ../cmake
ninja
sudo ninja install
# Build and install Cartographer.
cd cartographer
mkdir build
cd build
cmake .. -G Ninja
ninja
CTEST_OUTPUT_ON_FAILURE=1 ninja test
sudo ninja install
# Build and install.
cd src
git clone https://github.com/googlecartographer/cartographer_ros.git

cd ..
catkin_make_isolated --install --use-ninja
source install_isolated/setup.zsh

# 测试
roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=/home/sun/WorkSpace/Ros_workspace/bag_cartographer/cartographer_paper_deutsches_museum.bag

Java JDK

# 首先到这个网站上下载新版本的JDK
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

# 通过终端在/usr/local目录下新建java文件夹,命令行:
sudo mkdir /usr/local/java

# 然后将下载到压缩包拷贝到java文件夹中
cp jdk-8u25-linux-x64.tar.gz /usr/local/java

# 然后进入java目录,解压压缩包
cd /usr/local/java
sudo tar xvf jdk-8u171-linux-x64.tar.gz

# 然后可以把压缩包删除,命令行:
sudo rm jdk-8u171-linux-x64.tar.gz

# 设置jdk环境变量
sudo vim .zshrc

# 打开之后在末尾添加
export JAVA_HOME=/usr/local/java/jdk1.8.0_25  
export JRE_HOME=${JAVA_HOME}/jre  
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib  
export PATH=${JAVA_HOME}/bin:$PATH

# 请记住,在上述添加过程中,等号两侧不要加入空格,不然会出现“不是有效的标识符”,因为source /etc/profile 时不能识别多余到空格,会理解为是路径一部分。然后保存

# 检验是否安装成功 在终端输入如下命令
java -version

OpenCV

# 官网安装教程
https://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html

# 参考安装教程
https://www.linuxidc.com/Linux/2017-10/147316.htm



1. 安装其他依赖
sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

# git : 版本控制
# gfortran fortran编译器
# yasm 汇编编译器
# ffmpeg 系统自带
sudo apt-get install checkinstall yasm gfortran git ffmpeg
sudo apt-get install libxvidcore4 libgtk-3-dev
sudo apt-get install libjpeg8-dev libjasper-dev 
sudo apt-get install libtiff5-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev
sudo apt-get install libxine2-dev libv4l-dev
sudo apt-get install libqt4-dev libgtk2.0-dev libtbb-dev
sudo apt-get install libatlas-base-dev
sudo apt-get install libfaac-dev libmp3lame-dev libtheora-dev
sudo apt-get install libvorbis-dev libxvidcore-dev
sudo apt-get install libopencore-amrnb-dev libopencore-amrwb-dev
sudo apt-get install x264 v4l-utils
# 可选依赖
sudo apt-get install libprotobuf-dev protobuf-compiler
sudo apt-get install libgoogle-glog-dev libgflags-dev
sudo apt-get install libgphoto2-dev libeigen3-dev libhdf5-dev doxygen

2. 源码下载
https://github.com/opencv/opencv/releases

cd /home/sun/WorkSpace/OpenCV_workspace/opencv-3.4.1
mkdir build
cd build

cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..

# 可以使用 cmake-gui 生成makefile文件

3. 编译
# 查看cpu 核心数
nproc
# 如果你有8个核心 切换至 build 目录中,执行下面命令,编译源码并链接生成相应的动态库以及可执行文件
make -j8

# 执行完成后,再执行以下命令,将生成的可执行文件以及动态库安装到指定的安装目录中。
sudo make install


4.sudo make install 执行完毕后OpenCV编译过程就结束了,接下来就需要配置一些OpenCV的编译环境首先将OpenCV的库添加到路径,从而可以让系统找到
sudo gedit /etc/ld.so.conf.d/opencv.conf 
# 需要在文件末尾添加
/usr/local/lib  

sudo ldconfig 

sudo vim .zshrc
# 添加
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig  
export PKG_CONFIG_PATH  

# 另一个 export PYTHONPATH="/usr/local/lib/python3.5/dist-package‌​s:$PYTHONPATH"

source .zshrc
sudo updatedb  

5. 用一个小程序测试一下
cd opencv-3.4.1/samples/cpp/example_cmake

# 按顺序执行
cmake .
make
./opencv_example

# 即可看到打开了摄像头,在左上角有一个hello opencv  即表示配置成功

python / python3 
import cv2
cv2.__version__
  • 注意:ROS自带opencv,zshrc文件的source 先后顺序也影响使用

CUDA + CUDNN + TenserFlow

# 详细请看我的博客
https://blog.csdn.net/Changer_sun/article/details/79219419

你可能感兴趣的:(Ubuntu,安装记录)