Ubuntu 操作

依赖库查询
    objdump -x xxx | grep NEEDED
    ldd xxx
    readelf -d xxx
    glibc版本信息查看:strings “/lib/x86_64-linux-gnu/libc.so.6| grep LIBC
    nm xx | grep GLIBC查看是否依赖glibc
    https://blog.csdn.net/bandaoyu/article/details/121476940?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-121476940-blog-121550914.235%5Ev27%5Epc_relevant_multi_platform_whitelistv3&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-121476940-blog-121550914.235%5Ev27%5Epc_relevant_multi_platform_whitelistv3&utm_relevant_index=2
    
linux让程序优先加载当前路径动态库
    1、设置LD_LIBRARY_PATH
        修改/etc/profile在文件末尾加上两行: LD_LIBRARY_PATH=./export LD_LIBRARY_PATH 
        source /etc/profile
        PS:当前会话有效
    2、设置rpath
        -Wl,--rpath=lib_path
        PS:建议
    3、在/etc/ld.so.conf.d/下增加xxx.conf
        在xxx.conf里写依赖库路径,修改完成,执行命令ldconfig
        PS:不建议,可能会导致系统启动失败
        
新建系统,root无密码,需要先设置
	sudo passwd root

vscode安装
	1、sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make
	2、sudo apt-get update
	3、sudo apt-get install ubuntu-make
	4、umake ide visual-studio-code


	Ubuntu下VS安装以及C++环境配置
	https://blog.csdn.net/weixin_44012124/article/details/128363121

	sudo apt-get install gcc
	sudo apt-get install g++
	
增加用户
	useradd -d /home/test -m test(创建test)
	passwd test(修改test 密码)
	userdel -r test(删除test)
	usermod -s /bin/bash test(为用户指定命令解释行为)
	管理员账户:
		修改/etc/sudoers, 找到下面root    ALL=(ALL:ALL) ALL添加(cus_admin)
		cus_admin ALL=(ALL:ALL) ALL


qt安装
	sudo apt-get install build-essential (开发环境安装)
	sudo apt install --reinstall libxcb-xinerama0  (解决:libxcb-xinerama.so.0: cannot open shared object file)
	./qt-unified-linux-x64-4.5.0-online.run
	
grpc安装
	https://blog.csdn.net/u010264186/article/details/125786580
	https://github.com/grpc/grpc/blob/master/BUILDING.md
	https://zhuanlan.zhihu.com/p/564304597
	git submodule update --init
	git clone --recurse-submodules https://github.com/grpc/grpc.git
	windows:
		cmake(https://cmake.org/download/)
		nssm(https://www.nasm.us/)
		perl(https://www.activestate.com/products/perl/   ,网盘下载:http://pan.baidu.com/s/1i3GLKAp)
		go(https://golang.google.cn/dl/)
		git(https://git-scm.com/)
		
		https://blog.csdn.net/ManagerUser/article/details/126736076
		
		
	proc文件处理(xx.proto):
		grpc
			protoc.exe --grpc_out=. --plugin=protoc-gen-grpc=path\grpc_cpp_plugin.exe xx.proto
		cpp
			protoc.exe --cpp_out=. xx.proto

	unix:
		cmake、go、git
	
	
github访问慢(Ubuntu)
	进入终端命令行模式,输入sudo gedit /etc/hosts
	用浏览器访问 IPAddress.com 使用 IP Lookup 工具获得github.com和github.global.ssl.fastly.net域名的ip地址
	在gedit打开的hosts文件中最后面添加如下格式:
	140.81.112.1 github.com
	199.231.69.191 github.global.ssl.fastly.net
	(上面两行中的ip要根据第2步中查询到的ip填写)
	保存hosts文件
	更新DNS缓存,输入sudo /etc/init.d/networking restart
	
go安装
	https://blog.csdn.net/liangcsdn111/article/details/115405223
	https://golang.google.cn/dl/ (下载链接)
	
	
x11
	https://github.com/mirror/libX11/tags(源代码,无编译参考)
	sudo apt-get install libx11-dev(安装前更新源:apt-get update)
	
sqlite下载
	https://www.sqlite.org/download.html
	windows下编译
		1、lib.exe /def:sqlite3.def(默认32位,如果64位,需要加/machine:x64)
	https://soci.sourceforge.net/doc/master/installation/#building-with-cmake
	// linux 下编译sqlite
	1、下载sqlite3源码
		从官网下载对应的压缩包 :wget https://www.sqlite.org/2021/sqlite-autoconf-3350400.tar.gz
	2、对压缩包进行解压
		tar -xzvf sqlite-autoconf-3350400.tar.gz
	3、进入到解压的文件夹内
		cd sqlite-autoconf-3350400/
	4、运行相应的配置文件
		./configure prefix=install_path
	5、make
	6、make install
	
soci编译
	下载地址:https://github.com/SOCI/soci/tags
	cmake -G "Visual Studio 16"  -A=Win32 -DWITH_SQLITE3=ON -DSOCI_SQLITE3=ON  -DSQLITE3_INCLUDE_DIR=D:\Develop\sqlite\include -DSQLITE3_LIBRARY=D:\Develop\sqlite\lib\sqlite3.lib ../

	-DCMAKE_INSTALL_PREFIX=E:\Project\TeamProject\SOCI\soci-4.0.1\soci
	
openssl编译
	下载地址:https://www.openssl.org/source/
	编译:./config --prefix=install_path
	make
	make install
	
curl编译
	下载地址:https://curl.se/download.html
	编译:./configure --prefix=install_path --with-openssl=ssl_install_path
	make
	make install
	
安装SVN桌面程序(rabbitvcs)
	1. sudo add-apt-repository ppa:rabbitvcs/ppa
	2. sudo apt-get update
	3. sudo apt-get install  rabbitvcs-nautilus
	4. sudo apt-get install  rabbitvcs-gedit
	
压缩/解压缩文件
	zip file -r dir   tar -zcvf file.tar.gz files
	unzip file(-d dir) tar -zxvf file.tar.gz -C dir
	
Vim中退格异常
    修改/etc/vim/vimrc.tiny增加
        set nocompatible
        set backspace=2

增加环境变量
    编辑~/.profile,新增export ENV_DEV=/path ,退出保存
    执行source ~/.profile
    
DBus安装
    sudo apt-get install libdbus-1-dev
    链接库:dbus-1

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值