Ubuntu14.04安装Gnu radio

.更新软件源:

方法1.通过系统设置“软件和更新”,更新。

打开设置》》软件和更新,如下图:


下载自:下拉菜单,选择其他站点,可选择mirror.163.com


你可以选择最佳服务器,也可以指定你满意的服务器。选择之后要求输入密码


选择关闭,之后会重新自动执行更新命令(sudoapt-get update)更新完成


方法2通过终端命令更新:

1)首先备份官方源,以免设置错误可恢复。


2)用编辑器打开 /etc/apt/sources.list文件。


3)删除原有的源,在编辑器中添加新源。删除全部文字,将第(4)条中新的源添加到文档中,然后保存。如图所示:


4)添加的源有很多,可根据自己的情况选择。

#163

debhttp://mirrors.163.com/ubuntu/ trusty main restricted universemultiverse

debhttp://mirrors.163.com/ubuntu/ trusty-security main restricteduniverse multiverse

debhttp://mirrors.163.com/ubuntu/ trusty-updates main restricteduniverse multiverse

debhttp://mirrors.163.com/ubuntu/ trusty-proposed main restricteduniverse multiverse

debhttp://mirrors.163.com/ubuntu/ trusty-backports main restricteduniverse multiverse

deb-srchttp://mirrors.163.com/ubuntu/ trusty main restricted universemultiverse

deb-srchttp://mirrors.163.com/ubuntu/ trusty-security main restricteduniverse multiverse

deb-srchttp://mirrors.163.com/ubuntu/ trusty-updates main restricteduniverse multiverse

deb-srchttp://mirrors.163.com/ubuntu/ trusty-proposed main restricteduniverse multiverse

deb-srchttp://mirrors.163.com/ubuntu/ trusty-backports main restricteduniverse multiverse

#中科大

debhttp://debian.ustc.edu.cn/ubuntu/ trusty main multiverse restricteduniverse

debhttp://debian.ustc.edu.cn/ubuntu/ trusty-backports main multiverserestricted universe

debhttp://debian.ustc.edu.cn/ubuntu/ trusty-proposed main multiverserestricted universe

debhttp://debian.ustc.edu.cn/ubuntu/ trusty-security main multiverserestricted universe

debhttp://debian.ustc.edu.cn/ubuntu/ trusty-updates main multiverserestricted universe

deb-srchttp://debian.ustc.edu.cn/ubuntu/ trusty main multiverse restricteduniverse

deb-srchttp://debian.ustc.edu.cn/ubuntu/ trusty-backports main multiverserestricted universe

deb-srchttp://debian.ustc.edu.cn/ubuntu/ trusty-proposed main multiverserestricted universe

deb-srchttp://debian.ustc.edu.cn/ubuntu/ trusty-security main multiverserestricted universe

deb-srchttp://debian.ustc.edu.cn/ubuntu/ trusty-updates main multiverserestricted universe

#sohu

debhttp://mirrors.sohu.com/ubuntu/ trusty main restricted universemultiverse

debhttp://mirrors.sohu.com/ubuntu/ trusty-security main restricteduniverse multiverse

debhttp://mirrors.sohu.com/ubuntu/ trusty-updates main restricteduniverse multiverse

debhttp://mirrors.sohu.com/ubuntu/ trusty-proposed main restricteduniverse multiverse

debhttp://mirrors.sohu.com/ubuntu/ trusty-backports main restricteduniverse multiverse

deb-srchttp://mirrors.sohu.com/ubuntu/ trusty main restricted universemultiverse

deb-srchttp://mirrors.sohu.com/ubuntu/ trusty-security main restricteduniverse multiverse

deb-srchttp://mirrors.sohu.com/ubuntu/ trusty-updates main restricteduniverse multiverse

deb-srchttp://mirrors.sohu.com/ubuntu/ trusty-proposed main restricteduniverse multiverse

deb-srchttp://mirrors.sohu.com/ubuntu/ trusty-backports main restricteduniverse multiverse

5)更新。


.安装cmake:

cetc22@cetc22-Lenovo:~$sudo apt-get install cmake

.安装UHDGnuradio的以来环境:

sudo apt-get -y install libxi-dev libqt4-opengl-dev
 
sudo apt-get -y install libfontconfig1-dev libxrender-dev libpulse-dev
swig g++ automake autoconf libtool python-dev libfftw3-dev \
libcppunit-dev libboost-all-dev libusb-dev fort77 sdcc sdcc-libraries \
libsdl1.2-dev python-wxgtk2.8 git-core guile-1.8-dev \
libqt4-dev python-numpy ccache python-opengl libgsl0-dev \
python-cheetah python-lxml doxygen qt4-dev-tools \
libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4
.安装UHD驱动
在安装Gnuradio前,需要先安装UHD驱动uhd_003.008.002-release_Ubuntu-14.04-x86_64.deb
    命令:sudo dpkg -i uhd_003.008.002-release_Ubuntu-14.04-x86_64.deb 
.安装Gnuradioroot模式下,提取gnuradio-3.7.6.1.zip到主文件夹,在终端下进入gnuradio-3.7.6.1,执行命令:
      sudo su
     mkdir build
     cd build
     cmake ../
     make
     make test
    sudo make install
.设置系统路径
    执行以下命令:

exportPATH=$PATH:/usr/local/bin

exportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

exportPKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig

exportPYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/dist-packages

然后再执行gnuradio-companion的时候就出现了一个GRC窗口,运行uhd_find_devices,系统能正常连接USRP。至此,gnuradio安装就成功了!

.永久设置系统路径

上述方法只能临时设置系统路径,在重启终端后设置失效,可使用永久方法如下:

打开终端输入:
cetc22@cetc22-Lenovo:~$sudo gedit ~/.bashrc
[sudo] password for cetc22:
在文件最末尾添加:
exportPATH=$PATH:/usr/local/bin

exportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

exportPKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig

exportPYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/dist-packages
使其立即生效,在终端执行:
cetc22@cetc22-Lenovo:~$source ~/.bashrc
或重启电脑。

上述设置只针对cetc22用户有效,在root用户下按照上述步骤再设置一遍。以后就可以在两种用户下重新设置了。

 







©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页