Open yuzhenning opened 5 years ago
It is necessary to change ubuntu system source if you are working in mainland china. NOTICE! Different Ubuntu edition, needs relative mirror sources. step 1: replace original sources.list
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
step 2: change sources.list
sudo chmod 777 /etc/apt/source.list
sudo gedit /etc/apt/source.list
Replace all words by following sources: ALIYUN , TSING HUA, USTC, SYSU, etc...
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
%% Software & Update window should change main source to ALIYUN directly if sources.list finished correctly.
https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
http://mirrors.ustc.edu.cn http://mirrors.ustc.edu.cn/help/ubuntu.html
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ trusty main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ trusty main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ trusty-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ trusty-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ trusty-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
or china ROS
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'
However, the screen denotes:
W: Invalid 'Date' entry in Release file /var/lib/apt/lists/_var_libopencv4tegra-repo_Release
N: Skipping acquire of configured file 'non-free/binary-arm64/Packages' as repository 'http://repository.spotify.com stable InRelease' doesn't support architecture 'arm64'
E: Failed to fetch http://dk.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-arm64/Packages 404 Not Found [IP: 194.19.194.51 80]
E: Failed to fetch http://dk.archive.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-arm64/Packages 404 Not Found [IP: 194.19.194.51 80]
E: Failed to fetch http://dk.archive.ubuntu.com/ubuntu/dists/xenial-backports/main/binary-arm64/Packages 404 Not Found [IP: 194.19.194.51 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/main/binary-arm64/Packages 404 Not Found [IP: 91.189.88.152 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
THERE FOR, I check web "ask ubuntu": https://askubuntu.com/questions/942155/apt-get-update-not-working-not-found-ip-194-19-194-51-80 the solution is: (A worse solution, Don't use on Jetson system!!!) 'to fix the issue the above link suggests to'
sudo apt-get purge ".*:arm64"
sudo dpkg --remove-architecture arm64
Then, we type:
sudo apt-get update
sudo install ros-kinetic-desktop-full
All errors fixed!!! Eventhough I don't know WHY???
$roscore
display: The program 'roscore' is currently not installed. You can install it by typing:
sudo apt install python-roslaunch
same notworking after typing follow commands:
sudo apt install python-roslaunch
sudo apt install python-roslib
sudo apt install python-catkin-pkg
It may because the environment didnot set properly, needs following commands:
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
Then, roscore command working, problem soluted!
删除了该目录
$ sudo rm -rf /var/lib/apt/lists/*
$ sudo apt-get update
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) E: Unable to lock directory /var/lib/apt/lists/ E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? 这个问题是的意思是用于apt-get操作时的lock(应该是用于互斥的锁),出现了不能够得到锁的问题,针对此问题,如何解决呢? 可以以下命令进行操作
sudo rm /var/lib/apt/lists/lock
sudo rm /var/lib/dpkg/lock
执行完成后,就可以更新了 sudo apt-get update ———————————————— 版权声明:本文为CSDN博主「wanzew」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/wanzew/article/details/81568393
https://repogen.simplylinux.ch/ 使用以上网站,选择相应地区的sources list,
China:
#------------------------------------------------------------------------------#
# OFFICIAL UBUNTU REPOS #
#------------------------------------------------------------------------------#
###### Ubuntu Main Repos
deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
###### Ubuntu Update Repos
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
ALL lists
#------------------------------------------------------------------------------#
# OFFICIAL UBUNTU REPOS #
#------------------------------------------------------------------------------#
###### Ubuntu Main Repos
deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial restricted universe multiverse
###### Ubuntu Update Repos
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-security restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-proposed restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-backports restricted universe multiverse
更新源,然后打印出来一堆错误,主要问题有两个。
其中一个是GPG错误: 下列签名无法验证,错误的情况是这样的
W: GPG error: http://repo.mate-desktop.org saucy InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 68980A0EA10B4DE8 我们需要获取系统中的这个公钥,从信息中获取密钥号,比如上面这个错误,密钥号是68980A0EA10B4DE8,执行
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68980A0EA10B4DE8
后再次更新,这个错误消失,不过还有一个错误,错误的打印如下:
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/main/binary-arm64/Packages 404 Not Found [IP: 91.189.88.161 80] E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-i386/Packages 404 Not Found [IP: 91.189.88.161 80] E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/main/binary-i386/Packages 404 Not Found [IP: 91.189.88.161 80] E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-security/main/binary-i386/Packages 404 Not Found [IP: 91.189.88.161 80]
这里显示是91.189.161.80这个IP无法访问,但是我用浏览器访问了一下这个ip发现是可以访问的,Ubuntu下所有的开源项目都在这里了,于是我按照log上的目录依次往下查找,到 archive.ubuntu.com/ubuntu/dists/xenial-backports/main/ 这个目录之后,发现这个目录下面没有binary-i386这个目录,好了,问题找到了,那么是什么原因导致的更新源时程序会访问这个本来不存在的目录呢。网上查找一番后,找到一个比较关键的问题,在终端执行
dpkg --print-architecture
查看当前CPU的架构
dpkg --print-foreign-architectures
查看设置的多架构支持 现多架构支持被设置了i386,然而我们的平台是ARM架构的,不需要x86平台的支持,先前的问题可能就是这个原因导致的,于是尝试删除这个设置
sudo dpkg --remove-architecture i386
然后更新源
sudo apt-get update
成功!更新源成功之后就可以安装opencv的依赖,然后安装opencv了。
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted
# deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted
# deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://ports.ubuntu.com/ubuntu-ports/ bionic universe
# deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic universe
deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates universe
# deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://ports.ubuntu.com/ubuntu-ports/ bionic multiverse
# deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates multiverse
# deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
# deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner
deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted
# deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security universe
# deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security universe
deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security multiverse
# deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security multiverse
# Setup sources.lst
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
# Setup keys
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 0xB01FA116
sudo apt-get install python-rosdep
sudo apt-get install ros-melodic-desktop-full
sudo rosdep fix-permissions
sudo rosdep init
rosdep update
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt-get install python-rosinstall
Building up your own ARM sources for Mainland China