使用Ubuntu时遇到的各种问题(一)

1.运行sudo apt updata时报错:

正在读取软件包列表... 完成
E: 无法下载 https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/dists/jammy/main/binary-
i386/Packages  404  Not Found [IP: 101.6.15.130 443]
E: 无法下载 https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/dists/jammy-
updates/main/binary-i386/Packages  404  Not Found [IP: 101.6.15.130 443]
E: 无法下载 https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/dists/jammy-
backports/main/binary-i386/Packages  404  Not Found [IP: 101.6.15.130 443]
E: 无法下载 https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/dists/jammy-
security/main/binary-i386/Packages  404  Not Found [IP: 101.6.15.130 443]
E: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。

把/etc/apt/sources.list中的内容全删了就不报错了,所以应该是镜像源出了问题,而去清华官网添加最新的镜像源(link:清华镜像)仍然会报这个错误,所以暂时不用清华的了,可以自行更换其他镜像源。我换了阿里源,最后没问题。

简单来说就是:换源 。


/etc/apt/sources.list.d 不要有文件

-------------------------------------------------------------------------------------

执行:sudo apt-get update 时,要首先看是否联网没有。  否则也会报上面的错.

-------------------------------------------------------------------------------------

(base) dh@DH-PC:~/Desktop$ sudo apt-get update 
正在读取软件包列表... 完成
E: 无法获得锁 /var/lib/apt/lists/lock。锁正由进程 2062(packagekitd)持有
N: 请注意,直接移除锁文件不一定是合适的解决方案,且可能损坏您的系统。
E: 无法对目录 /var/lib/apt/lists/ 加锁

       强制解锁(比较暴力):

sudo rm /var/lib/apt/lists/lock

2.运行.build_ros.sh时报错:

CMake Error at CMakeLists.txt:2 (include):
  include could not find requested file:

    /core/rosbuild/rosbuild.cmake

CMake Error at CMakeLists.txt:4 (rosbuild_init):
  Unknown CMake command "rosbuild_init".

-- Configuring incomplete, errors occurred!
See also "/home/dh/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build/CMakeFiles/CMakeOutput.log".
make: *** 没有指明目标并且找不到 makefile。 停止。

------------------这个好像是ros1的,ros2用不了----------------------

3.网卡不见的bug:

1. sudo lshw -c Network

听说这个是Ubuntu Network Manager Bug,经过网上查询得知可以创建一个缺少的配置文件可以解决这个问题,

2. sudo touch /etc/NetworkManager/conf.d/10-globally-managed-devices.conf
3. sudo systemctl restart NetworkManager

-----------------------------------------或者:

# 查看现有的网络连接
nmcli con show
# 没有任何信息输出。

sudo nmcli con up 'ifname' ens33
可能出现以下报错。

错误:连接激活失败:The device 'ens33' has no connections available for activation.

# 查看托管状态
nmcli n
# 显示 disabled 则通过以下命令开启
# 开启托管
nmcli n on


 

4.清理缓存:

    清理垃圾日志
    垃圾日志文件一般在/var/log/journal/中,可以通过如下命令来清除

         #检查日志大小

    journalctl --disk-usage 

         #只保留一周(时间可选)的日志

   sudo journalctl --vacuum-time=1w 

        #只保留500MB(可选)的日志

    sudo journalctl --vacuum-size=500M    

        清理缓存以及没有用的包
        #删除旧版本软件缓存

    sudo apt-get autoclean       

         #删除系统内所有软件缓存

    sudo apt-get clean         

         #删除系统不再使用的孤立软件

 sudo apt-get autoremove
清理 Conda 缓存

查看 Conda 缓存的使用情况

conda clean --dry-run --all

删除不再使用的包和缓存

conda cl
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值