xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

Linux install vim errors All In One

Linux install vim errors All In One

Vim

errors ❌

Raspberry Pi 安装 vim 解压缩时候卡住了,手动中断了 terminal,再次 SSH 连接时候,出现一下错误信息!

pi@raspberrypi:~ $ sudo apt-get install vim
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成
下列软件包是自动安装的并且现在不需要了:
  libfuse2
使用'sudo apt autoremove'来卸载它(它们)。
将会同时安装下列软件:
  vim-runtime
建议安装:
  ctags vim-doc vim-scripts
下列【新】软件包将被安装:
  vim
下列软件包将被升级:
  vim-runtime
升级了 1 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 24 个软件包未被升级。
有 1 个软件包没有被完全安装或卸载。
需要下载 0 B/7,614 kB 的归档。
解压缩后会消耗 36.4 MB 的额外空间。
您希望继续执行吗? [Y/n] y
读取变更记录(changelogs)... 完成
(正在读取数据库 ... 系统当前共安装有 96879 个文件和目录。)
准备解压 .../vim-runtime_2%3a8.2.2434-3+deb11u1_all.deb  ...
正在解压 vim-runtime (2:8.2.2434-3+deb11u1) 并覆盖 (2:8.2.2434-3+deb11u1) ...

image

pi@raspberrypi:~ $ sudo apt-get install vim
E: 无法获得锁 /var/lib/dpkg/lock-frontend。锁正由进程 11246(apt-get)持有
N: 请注意,直接移除锁文件不一定是合适的解决方案,且可能损坏您的系统。
E: 无法获取 dpkg 前端锁 (/var/lib/dpkg/lock-frontend),是否有其他进程正占用它?
pi@raspberrypi:~ $ 

image

$ sudo apt-get install vim
E: dpkg 被中断,您必须手工运行 ‘sudo dpkg --configure -a’ 解决此问题。

image

$ sudo apt-get install vim
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成
vim 已经是最新版 (2:8.2.2434-3+deb11u1)。
下列软件包是自动安装的并且现在不需要了:
  libfuse2
使用'sudo apt autoremove'来卸载它(它们)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 24 个软件包未被升级。
pi@raspberrypi:~ $ 

$ sudo apt autoremove

solutions

  1. kill 进程
$ ps -aux | grep apt-get

# PID, process id
# sudo kill -9 PID
$ sudo kill -9 11245
$ sudo kill -9 11246

image

image

$ sudo dpkg --configure -a
正在处理用于 man-db (2.9.4-2) 的触发器 ...

  1. 强制解锁

删除 lock 文件

$ sudo rm /var/cache/apt/archives/lock

$ sudo rm /var/lib/dpkg/lock
  1. 更新软件库
$ sudo apt-get update
  1. 重启系统

万能懒人方法 💩 关机重启电脑

image

demos

$ cat /boot/config.txt

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# Automatically load overlays for detected cameras
camera_auto_detect=1

# Automatically load overlays for detected DSI displays
display_auto_detect=1

# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2

# Run in 64-bit mode
arm_64bit=1

# Disable compensation for displays with overscan
disable_overscan=1

[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1

[all]

[pi4]
# Run as fast as firmware / board allows
arm_boost=1

[all]


# https://www.cnblogs.com/xgqfrms/p/17437862.html
# GPU 分配的内存
gpu_mem=100

raspbery Pi 4B 8G 版,使用 USB 启动引导系统,导致 GUITerminal 操作都异常卡顿 ❌

??? USB 3.0 接口 IO 读写问题

image

image

image

image

image

(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

fix GitHub 443 error ❌

nvm & Node.js

https://github.com/nvm-sh/nvm#install--update-script

$ nvm ls-remote | grep "Latest LTS"
         v4.9.1   (Latest LTS: Argon)
        v6.17.1   (Latest LTS: Boron)
        v8.17.0   (Latest LTS: Carbon)
       v10.24.1   (Latest LTS: Dubnium)
      v12.22.12   (Latest LTS: Erbium)
       v14.21.3   (Latest LTS: Fermium)
       v16.20.0   (Latest LTS: Gallium)
       v18.16.0   (Latest LTS: Hydrogen)
pi@raspberrypi:~ $ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (7) Failed to connect to raw.githubusercontent.com port 443: 拒绝连接

$ cat /etc/hosts
127.0.0.1	localhost
::1		localhost ip6-localhost ip6-loopback
ff02::1		ip6-allnodes
ff02::2		ip6-allrouters

127.0.1.1	raspberrypi

$ sudo vim  /etc/hosts

$ cat /etc/hosts
127.0.0.1	localhost
::1		localhost ip6-localhost ip6-loopback
ff02::1		ip6-allnodes
ff02::2		ip6-allrouters

127.0.1.1	raspberrypi


# fix github 443 ❌
185.199.108.133 raw.githubusercontent.com

image

Linux 源 Raspberry Pi 切换成清华镜像

$ cat /etc/apt/sources.list.d/raspi.list

$ sudo nano /etc/apt/sources.list.d/raspi.list
$ sudo vim /etc/apt/sources.list.d/raspi.list

# Debian 11 (bullseye)
# deb https://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ bullseye main

# Debian 10 (buster)
# deb https://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main

https://mirrors.tuna.tsinghua.edu.cn/help/raspberrypi/

image

apt vs apt-get

$  cat /etc/apt/sources.list
deb http://deb.debian.org/debian bullseye main contrib non-free
deb http://security.debian.org/debian-security bullseye-security main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
# Uncomment deb-src lines below then 'apt-get update' to enable 'apt-get source'
#deb-src http://deb.debian.org/debian bullseye main contrib non-free
#deb-src http://security.debian.org/debian-security bullseye-security main contrib non-free
#deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free
$  sudo apt install vim
$  sudo apt-get install vim

refs

/etc/apt/sources.list.d/raspi.list 切换镜像

https://www.cnblogs.com/xgqfrms/p/17301579.html

https://www.xinyueseo.com/linux/273.html



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2023-05-29 14:44  xgqfrms  阅读(59)  评论(2编辑  收藏  举报