Debian系統更新apt源

docker search了一個tomcat的鏡像,發現是Debian系統,裏面啥啥命令都沒有,使用的這個難受啊,於是,強迫症犯了,要安裝相應軟件,在容器裏做實驗用。

執行安裝命令:

apt-get install vim

報錯:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package vim

檢查安裝源文件:

cat /etc/apt/sources.list

源文件內容如下:

# deb http://snapshot.debian.org/archive/debian/20191224T000000Z stretch main
deb http://deb.debian.org/debian stretch main
# deb http://snapshot.debian.org/archive/debian-security/20191224T000000Z stretch/updates main
deb http://security.debian.org/debian-security stretch/updates main
# deb http://snapshot.debian.org/archive/debian/20191224T000000Z stretch-updates main
deb http://deb.debian.org/debian stretch-updates main

進行編輯:

vim /etc/apt/sources.list

顯示:

bash: vim: command not found

在執行:

vi /etc/apt/sources.list

顯示:

bash: vi: command not found

奶腿啊,啥命令都沒有,啊啊啊啊啊啊啊!!!!

在這裏插入圖片描述
看來只好使用echo命令了,還好有這個命令!!
找了個163的源文件,搞進去。

echo 'deb http://mirrors.163.com/debian/ jessie main non-free contrib' > /etc/apt/sources.list

看看搞進去沒

cat /etc/apt/sources.list

在這裏插入圖片描述
好,更新下緩存內容

apt-get update

在這裏插入圖片描述
完活,安裝要使用的命令工具包:

apt-get install net-tools

在這裏插入圖片描述
終於可以安裝要使用的命令了,搞完收工!!!
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章