狗儿

热爱的话就坚持吧~

0%

linux运维记录(持续更新)

如果解决不了问题,那一定是我的问题,而不是linux的问题。

虚拟机

Ubuntu卡在登录前的页面

因为一些操作,导致Ubuntu虚拟机卡机,无奈重启后发现卡在登录前的一个Ubuntu的logo界面。

方法:开机时出现VMWare的logo时按下ESC,然后按照下面的操作。

已经成功过两次了。(补充:并不根治,每次重启都要这样操作一次)

1572423069428

1572423075839

1572423082681

1572423094259

Ubuntu

apt/apt-get的锁

出现问题的情况很多,这里记录一些我遇到的。

sudo

未加sudo时无权限。

非root用户必须带上sudo

1572426348982

资源暂时不可用

1572435207048

出现这个问题的原因可能是有另外一个程序正在运行,由于它在运行时,会占用软件源更新时的系统锁(以下称“系统更新锁”,此锁文件在/var/lib/apt/lists/目录下),而当有新的apt-get进程生成时,就会因为得不到系统更新锁而出现”E: 无法获得锁 /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)”错误提示!

而导致资源被锁的原因,可能是上次安装时没正常完成,也可能是桌面化后台在更新。

因此,我们只要将原先的apt-get进程杀死,从新激活新的apt-get进程,就可以让新立德软件管理器正常工作了!

ps -aux | grep apt然后杀掉apt进程。

1572435458189

apt/apt-get无法定位

1
2
sudo apt update
sudo apt upgrade

ubuntu&vi的问题

今天使用基于ubuntu的pwntools的docker,发现没有vi,apt提示未能定位,update后依然无法定位。

1
2
3
4
5
pwntools@38d5153bacb9:~$ sudo apt install vi
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package vi

最后才知道,ubuntu中没有vi,而是vim,吐血哦~

stackoverflow给出了查询是否包是否存在于ubuntu中的在线查询方法

First, check if the package actually exists:

  1. Go to packages.ubuntu.com with a web browser.

  2. Scroll down to “Search package directories”

  3. Enter the package which you’re trying to install into the “Keyword” field.

    Enable “Only show exact matches:”

    Change the “Distribution” to which version of Ubuntu you’re using.

    enter image description here

If there are no results, the package you are looking for doesn’t exist and the next steps will not work. It may require a third party PPA or an alternative installation method.

我只找到vim.