首页 > 系统相关 >ubuntu使用记录

ubuntu使用记录

时间:2024-02-22 11:57:03浏览次数:34  
标签:记录 -- sudo apt get install 使用 docker ubuntu

更改软件源
  • x64架构直接换

  • jetson nano换成国内源(由于软件那不能直接换)

    • 备份原本的源,更改source.list文件的名字

      #为防止误操作后无法恢复,先备份原文件sources.list
      sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak    
      
    • 将源文件替换为如下:

      # 打开源文件source.list
      sudo gedit /etc/apt/sources.list 
      
      deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe
      deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe
      deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe
      deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe
      deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe
      deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe
      deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe
      deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe
      
    • 保存然后

      sudo apt-get update
      
保存终端内容到日志
  1. 终端执行

    $ sudo script screen.log
    
  2. 停止并保存

    $ exit 
    
网速、CPU显示
  1. 添加源
    sudo add-apt-repository ppa:fossfreedom/indicator-sysmonitor
  2. 更新源
    sudo apt-get update
  3. 安装sysmonitior
    sudo apt-get install indicator-sysmonitor
  4. 终端执行:
    indicator-sysmonitor &
    然后Ctrl+C就可以实现后台运行indicator-sysmonitor
  5. 为程序添加开机启动!鼠标右键点击标题栏上图标,弹出菜单,选择首选项
  6. 首选项中可以添加显示网速
更改字体倍数gnome-tweak
录屏软件
sudo apt install simplescreenrecorder
卸载火狐浏览器
  1. 查看firefox相关包
    dpkg --get-selections |grep firefox
  2. 卸载上述指令中的包
    sudo apt-get purge packages
vscode安装
  1. 插件:C/C++、python、ros、cmake tool、code runer
  2. 设置:字体:
    代码格式化:设置-文本编辑器-格式化-edit on type
升级cmake
  1. 查看当前版本:
    cmake --version
  2. 安装依赖
    sudo apt install libssl-dev
  3. 下载源码:
    https://cmake.org/download/
  4. 解压缩并进入文件夹:
    tar -xf cmake-3.22.4.tar.gz
    cd cmake-3.22.4
  5. 编译安装:
    ./bootstrap
    make
    sudo make install
    source ~/.bashrc
  6. 再次查看当前版本:
    cmake --version
截屏软件flameshot

安装:sudo apt-get install flameshot
使用:

  • 命令行:flameshot gui

  • 快捷键:打开设置-设备-键盘,拉到底部+
    按如下配置:

    img

将关闭、最大化、最小化放左边

gsettings set org.gnome.desktop.wm.preferences button-layout "maximize,minimize,close:"

Linux没独显的情况下更改分辨率

img

git clone 问题

fatal: unable to access 'https://github.com/.../.git': Could not resolve host: github.com
命令行执行:

git config --global --unset http.proxy 
git config --global --unset https.proxy
升级python到3.8
1. sudo add-apt-repository ppa:jonathonf/python-3.8
2. sudo apt-get update
	  sudo apt-get install python3.8
3. sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
	  sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2
4. sudo update-alternatives --config python3
选择2
5. 一般还要升级pip
python3 -m pip install --upgrade pip
工控机配置虚拟屏
  • 安装软件:
sudo apt-get install  xserver-xorg-core-hwe-18.04
sudo apt-get install  xserver-xorg-video-dummy
  • 配置文件:
sudo vim /usr/share/X11/xorg.conf.d/xorg.conf

​ 添加以下内容

Section "Monitor"
  Identifier "Monitor0"
  HorizSync 28.0-80.0
  VertRefresh 48.0-75.0
  # https://arachnoid.com/modelines/
  # 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz
  Modeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
EndSection
Section "Device"
  Identifier "Card0"
  Driver "dummy"
  VideoRam 256000
EndSection
Section "Screen"
  DefaultDepth 24
  Identifier "Screen0"
  Device "Card0"
  Monitor "Monitor0"
  SubSection "Display"
    Depth 24
    Modes "1920x1080_60.00"
  EndSubSection
EndSection
  • 重启电脑
  • 如果要使用物理屏,把这个文件删除即可
在vscode里打开IntelliSense配置的方法

ctrl+shift+P

cartographer安装

1. sudo apt-get update
   sudo apt-get install -y python3-wstool python3-rosdep ninja-build stow
2. 	mkdir catkin_ws
    cd catkin_ws
   wstool init src
   wstool merge -t src https://raw.githubusercontent.com/cartographer-project/cartographer_ros/master/cartographer_ros.rosinstall
   这一步会报错,可以在浏览器打开上面这个链接,把里面内容复制到src目录下的.rosinstall文件中,然后跳过这一步
   wstool update -t src
3. sudo rosdepc init
   rosdepc update
   rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
   这一步报错,可以把src中cartographer文件package.xml依赖中<depend>libabsl-dev</depend>删除,并且在src/cartographer/scripts/install_abseil.sh文件目录下运行install_abseil.sh这个sh文件来下载abseil安装
4、 catkin_make_isolated --install --use-ninja

Git使用记录

删除提交历史

# 删除本地最后一条记录,如果需要删除最后提交的N条记录,将“1”替换为一个具体的数字“N”即可。
git reset --hard HEAD~1

git显示中文乱码

在终端输入:

git config --global core.quotepath false

docker及docker-compose安装

Docker Engine安装

Docker Engine有多种安装方式,这里选择apt repository方式。

Install using the apt repository
Set up the repository
  1. 更新软件包索引并安装软件包以允许使用 基于 HTTPS 的存储库
sudo apt-get update
sudo apt-get install \
    ca-certificates \
    curl \
    gnupg
  1. 添加Docker官方GPG 锁钥:
sudo mkdir -m 0755 -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
  1. 建立仓库
echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
安装Docker Engine
  1. 更新索引
    sudo apt-get update

  2. sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

  3. 测试
    sudo docker run hello-world
    有以下输出说明docker engine安装成功
    ![[Pasted image 20230506203241.png]]
    后续:如果要在非sudo模式下使用Docker,参考官方设置
    img[](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user)

docker-compose安装

  1. curl -SL https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
    如果上面这步实在太慢,可以去github把文件下载下来,重命名成docker-compose,放到/usr/local/bin下,再执行下面步骤
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
  1. 测试
docker-compose

img

常用操作命令
给文件夹赋予权限
sudo chmod -R 777 +文件地址
sudo免密码

打开如下文件

sudo gedit /etc/sudoers

注释掉,然后添加
image

ros常用命令

运行tf树

rosrun rqt_tf_tree rqt_tf_tree  

单独编译某个包

catkin_make -DCATKIN_WHITELIST_PACKAGES="package1;package2"

恢复到生成所有包

catkin_make -DCATKIN_WHITELIST_PACKAGES=""

remap

标签:记录,--,sudo,apt,get,install,使用,docker,ubuntu
From: https://www.cnblogs.com/xdhisgood-xy/p/18026995

相关文章

  • 踩坑经历-jenkins安装使用
    最近在整理之前临时记的笔记,好久之前了,大概记录下。按照教程安装jenkins,随机选了个不是最新版的docker版本,然后一路下一步,但是到安装推荐插件就没有全部安装成功,我接着走下去想进到“插件管理”界面再装推荐插件,但是经过尝试换镜像源,各种重启,查询报错代码啥意思,折腾了很久还是没......
  • VM使用记录
    本人的软件版本为VMwareworkstationspro16Q1:如何设置虚拟机CPU,才能发挥最大性能参考:https://zhuanlan.zhihu.com/p/609471422Q2:虚拟机内存分配多少合适参考:https://ask.zol.com.cn/x/5908542.htmlQ3:主机与客户机(虚拟机复制粘贴内容)安装VMtoolTODO.........
  • 关于Golang中函数的接收者不同对接口的使用的影响理解
    对于函数而言:接收者为指针会改变接收者本身的值接收者为值则只是拷贝,不会改变原本的值并且值和指针可以任意调用对方的方法,即值可以调用接收者为指针的方法,指针可以调用接收者为值得方法。原因是:可以自动指针解引用和值寻址对于接口而言:接收者为指针的方法,不能将值赋值给接......
  • saltstack的使用
    1.安装https://docs.saltproject.io/salt/install-guide/en/latest/topics/overview.html1.1linux使用Bootstrapinstallation安装#下载文件bootstrap-salt.shcurl-obootstrap-salt.sh-Lhttps://bootstrap.saltproject.io#添加权限chmod+xbootstrap-salt.sh#安装#F......
  • 改造Aforge.Video在.NetCore中使用
    Aforge.Video是可以方便获取摄像头等视频输入设备图像的轻量级组件,但是该组件的最新版本2.2.5大约是在2013年发布的,仅支持.NetFramework,在基于.Net6的Winform中无法使用。Aforge.Video组件存在开源项目AForge.NET中,该项目有1kStars(2024.02)。本文的改造思想是将项目中使......
  • 在WPF中使用本地Webview2,不依赖系统runtime
    在WPF中使用本地Webview2,不依赖系统runtime项目运行环境:.netframework4.5.2Windows7x64ServicePack1WebView2Microsoft.WebView2.FixedVersionRuntime.120.0.2210.91.x64考虑到很多老项目,本项目使用的是.netframework4.5.2,.Net更高版本的其实也是可以支持的。......
  • Android里使用AspectJ实现双击自定义注解
    创建注解首先创建一个双击注解。importjava.lang.annotation.ElementType;importjava.lang.annotation.Retention;importjava.lang.annotation.RetentionPolicy;importjava.lang.annotation.Target;​/***<pre>*desc:双击*author:刘金*......
  • 如何在C#中使用 Excel 动态函数生成依赖列表
    前言在Excel中,依赖列表或级联下拉列表表示两个或多个列表,其中一个列表的项根据另一个列表而变化。依赖列表通常用于Excel的业务报告,例如学术记分卡中的【班级-学生】列表、区域销售报告中的【区域-国家/地区】列表、人口仪表板中的【年份-区域】列表以及生产摘要报告中的【单位-......
  • logging两种记录日志的调用方式
     使用 logging.getLogger() 方式:这种方式是通过代码直接操作和配置日志记录器。如前所述,你可以创建或获取一个日志记录器实例,然后为其设置级别、添加处理器等。例如:Python1importlogging23logger=logging.getLogger('my_module')4logger.setLevel(logging.DEBUG)5......
  • MQTT协议及其使用案例
    MQTT概述MQTT是基于TCP/IP协议栈构建的异步通信消息协议,是一种轻量级的发布、订阅信息传输协议。可以在不可靠的网络环境中进行扩展,适用于设备硬件存储空间或网络带宽有限的场景。使用MQTT协议,消息发送者与接收者不受时间和空间的限制。Docker部署MQTT(采用docker-compose.y......