【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) ...
相关推荐
洛森唛9 小时前
Elasticsearch DSL 查询语法大全:从入门到精通
后端·elasticsearch
闲云一鹤11 小时前
Git LFS 扫盲教程 - 你不会还在用 Git 管理大文件吧?
前端·git·前端工程化
Elasticsearch3 天前
如何使用 Agent Builder 排查 Kubernetes Pod 重启和 OOMKilled 事件
elasticsearch
vibecoding日记3 天前
为什么我就想要「线性历史 + Signed Commits」,GitHub 却把我当猴耍 🤬🎙️
git·编程工具
Elasticsearch4 天前
通用表达式语言 ( CEL ): CEL 输入如何改进 Elastic Agent 集成中的数据收集
elasticsearch
程序员小崔日记4 天前
如何将代码轻松上传到 Gitee?Git 使用全攻略!
git·gitee·上传
Bigger5 天前
为什么你的 Git 提交需要签名?—— Git Commit Signing 完全指南
git·开源·github
DianSan_ERP5 天前
电商API接口全链路监控:构建坚不可摧的线上运维防线
大数据·运维·网络·人工智能·git·servlet
欧云服务器5 天前
怎么让脚本命令可以同时在centos、debian、ubuntu执行?
ubuntu·centos·debian