sudo rm /var/lib/apt/lists/lock
即可解决
解决Ubuntu网络图标的问题
sudo service NetworkManager stop
sudo rm /var/lib/NetworkManager/NetworkManager.state
sudo service NetworkManager start
ubuntu换源
首先将source.list复制为source.list.bak备份。
cp /etc/apt/source.list /etc/apt/source.list.bak
本文为 Ubuntu 22.04 的阿里云镜像源列表。若为其他版本,将所有jammy更改为其他版本代号即可。
常用的Ubuntu版本代号如下:
Ubuntu 22.04:jammy
Ubuntu 20.04:focal
Ubuntu 18.04:bionic
Ubuntu 16.04:xenia
vim /etc/apt/source.list
将文件内容清空,然后复制下方代码粘贴,wq保存退出即可。
deb https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
更新软件包
sudo apt update
sudo apt-get update
sudo apt upgrade
安装samb服务器实现与windows共享文件
sudo apt-get install samba
修改samba的配置smb.conf 执行命令
sudo vi /etc/samba/smb.conf
注:用户名是Linux中的用户名
[用户名]
comment = samba home directory
path = /home/用户名
public = yes
browseable = yes
public = yes
read only = no
valid users = 用户名
create mask = 0777
directory mask = 0777
force user = 用户名
force group = 用户名
available = yes
重启samba服务器
sudo service smbd service
设置访问samba目录的密码
注: 自己的用户名
在windows中win+r进入 ,输入虚拟机地址
虚拟机地址: