【Git】-- Git安装 & 卸载(ubuntu)

文章目录

  • [1. Git安装 & 卸载--ubuntu](#1. Git安装 & 卸载--ubuntu)

更多Git相关知识: Git专栏

1. Git安装 & 卸载--ubuntu

检查是否安装

命令:git --version.

已安装:

bash 复制代码
root@VM-0-3-ubuntu:~# git --version
git version 2.43.0

未安装:

bash 复制代码
oot@VM-0-3-ubuntu:~# git --version
-bash: /usr/bin/git: No such file or directory

1.1 安装

bash 复制代码
root@VM-0-3-ubuntu:~# sudo apt-get install git -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  eatmydata libeatmydata1 python3-json-pointer python3-jsonpatch python3-jsonschema python3-pyrsistent
Use 'sudo apt autoremove' to remove them.
Suggested packages:
  git-daemon-run | git-daemon-sysvinit git-doc git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn
The following NEW packages will be installed:
  git
0 upgraded, 1 newly installed, 0 to remove and 301 not upgraded.
Need to get 3,680 kB of archives.
After this operation, 22.2 MB of additional disk space will be used.
Get:1 http://mirrors.tencentyun.com/ubuntu noble-updates/main amd64 git amd64 1:2.43.0-1ubuntu7.3 [3,680 kB]
Fetched 3,680 kB in 0s (44.9 MB/s)
Selecting previously unselected package git.
(Reading database ... 100948 files and directories currently installed.)
Preparing to unpack .../git_1%3a2.43.0-1ubuntu7.3_amd64.deb ...
Unpacking git (1:2.43.0-1ubuntu7.3) ...
Setting up git (1:2.43.0-1ubuntu7.3) ...
Scanning processes...                                                                                                                                        
Scanning linux images...                                                                                                                                     
Running kernel seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.

root@VM-0-3-ubuntu:~# git --version
git version 2.43.0

1.2 卸载

bash 复制代码
root@VM-0-3-ubuntu:~# sudo apt-get remove git -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  eatmydata libeatmydata1 liberror-perl python3-json-pointer python3-jsonpatch python3-jsonschema python3-pyrsistent
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  git ubuntu-server
0 upgraded, 0 newly installed, 2 to remove and 301 not upgraded.
After this operation, 22.2 MB disk space will be freed.
(Reading database ... 101824 files and directories currently installed.)
Removing ubuntu-server (1.539) ...
Removing git (1:2.43.0-1ubuntu7.3) ...
相关推荐
神筆&『馬良』2 小时前
Foundation_pose在自己的物体上复现指南:实现任意物体6D位姿检测(利用realsense_D435i和iphone_16pro手机)
目标检测·ubuntu·机器人·视觉检测
闲人编程3 小时前
Elasticsearch搜索引擎集成指南
python·elasticsearch·搜索引擎·jenkins·索引·副本·分片
先跑起来再说3 小时前
Git 入门到实战:一篇搞懂安装、命令、远程仓库与 IDEA 集成
ide·git·后端·elasticsearch·golang·intellij-idea
liuniu08183 小时前
VMware虚拟机安装ubuntu2022
ubuntu·ros
Dxy12393102164 小时前
深度解析 Elasticsearch:从倒排索引到 DSL 查询的实战突围
大数据·elasticsearch·搜索引擎
xfddlm4 小时前
边缘计算_ubuntu环境下使用瑞芯微RK3576NPU推理LLM
人工智能·ubuntu·边缘计算
EHagSJVNpTY5 小时前
MATLAB 中基于最大重叠离散小波变换的心电信号处理探索
ubuntu
.小墨迹6 小时前
apollo学习之借道超车的速度规划
linux·c++·学习·算法·ubuntu
承渊政道6 小时前
Linux系统学习【Linux系统的进度条实现、版本控制器git和调试器gdb介绍】
linux·开发语言·笔记·git·学习·gitee
技术路上的探险家6 小时前
Ubuntu下Docker与NVIDIA Container Toolkit完整安装教程(含国内源适配)
linux·ubuntu·docker