本帖最后由 没尾巴的牛 于 2020-1-16 03:13 编辑
楼主,麻烦看下
安装完opkg install luci-base,opkg install luci-mod-admin-full,打不开openwrt的web界面怎么解?现在提示BadGateway 开始安装的时候,老是报错,类似下面这样,像是依赖库没有 - root@SAF:/etc# opkg install luci-mod-admin-full
- Installing luci-mod-admin-full (git-16.018.33482-3201903-1) to root...
- Downloading http://archive.openwrt.org/chaos_calmer/15.05.1/omap/generic/packages/luci/luci-mod-admin-full_git-16.018.33482-3201903-1_omap.ipk.
- Collected errors:
- * satisfy_dependencies_for: Cannot satisfy the following dependencies for luci-mod-admin-full:
- * libc * libc * libc * libc * libc * libc * libc * libc * libc * libc * libc * libc * libc * libc * libc *
- * opkg_install_cmd: Cannot install package luci-mod-admin-full.
复制代码然后我上网找,找到解决办法,首先,下载libc,安装,安装的过程中,又自动安装了另一个不知道干什么的依赖包。。。 如下 - root@SAF:~# wget https://archive.openwrt.org/chaos_calmer/15.05.1/omap/generic/packages/base/libc_0.9.33.2-
- 1_omap.ipk
- Connecting to archive.openwrt.org (81.0.124.218:443)
- libc_0.9.33.2-1_omap 100% |**********************************************************| 191k 0:00:00 ETA
- root@SAF:~# opkg install libc_0.9.33.2-1_omap.ipk
- Installing libc (0.9.33.2-1) to root...
- Installing libgcc (4.8-linaro-1) to root...
- Downloading http://archive.openwrt.org/chaos_calmer/15.05.1/omap/generic/packages/base/libgcc_4.8-linaro-1_omap.ipk.
- Configuring libgcc.
- Configuring libc.
复制代码库装上了,然后我迫不及待的安装了luci-mod-admin-full,安装过程中下载了好多依赖,包括luci-base。 - root@SAF:~# opkg install luci-mod-admin-full
- Installing luci-mod-admin-full (git-16.018.33482-3201903-1) to root...
- Downloading http://archive.openwrt.org/chaos_calmer/15.05.1/omap/generic/packages/luci/luci-mod-admin-full_git-16.018.33482-3201903-1_omap.ipk.
- Installing luci-base (git-16.018.33482-3201903-1) to root...
- Downloading http://archive.openwrt.org/chaos_calmer/15.05.1/omap/generic/packages/luci/luci-base_git-16.018.33482-3201903-1_omap.ipk.
- 略过N行
- Configuring libubox.
- Configuring libuci.
- Configuring liblua.
- Configuring libuci-lua.
- Configuring libubus.
- Configuring libjson-c.
- Configuring libblobmsg-json.
- Configuring rpcd.
- Failed to connect to ubus
- Configuring libnl-tiny.
- Configuring luci-lib-ip.
- Configuring libubus-lua.
- Configuring lua.
- Configuring luci-lib-nixio.
- Configuring luci-base.
- Configuring luci-mod-admin-full.
复制代码 然后我马上打开浏览器
http://192.168.1.1:80 BadGateway The process did not produce any response 我猜测是uhttpd,没启动。
- root@SAF:~# /etc/init.d/uhttpd start
- Failed to connect to ubus
复制代码 不管用,赶紧试试华为系统有没有崩,
http://192.168.1.1:8080,顺利打开,安心了,这个没问题。 然后各种网上找,找了个命令,据说十分灵 - rm -r /tmp/luci-indexcache
复制代码说是清理缓存的,弄完,还不如从前。/哭 现在http://192.168.1.1:80是 NotFound File not found. 现在我又重装了,不敢执行那个清缓存命令。 ------------------------------------------------------------------以下是傻傻的经验教训,重装ssh,可以略过-----------------------------------------------------------
输完那个命令,op系统的ssh上不去了。
登陆的时候老是提示,需要密钥文件,而且不支持用户名密码登录,网上找了一圈,没找到怎么弄, 估计是op的ssh掉了,需要重装,并配置。
想根据楼主的教程重走一遍
卡在了解包这一步。(我今天看,可能不需要这一步,因为文件都在,可能只需要配置下) - WAP(Dopra Linux) #tar xzf /tmp/data.tar.gz
- tar: can't createdirectory './usr': File exists
- tar: can't make dir./usr/lib: Not a directory
- tar: can't createdirectory './usr/': Not a directory
- tar: can't createdirectory './usr/': Not a directory
- tar: can't createdirectory './usr': File exists
- tar: can't make dir./usr/bin: Not a directory
- tar: can't createdirectory './usr/': Not a directory
- tar: can't remove oldfile ./usr/: Not a directory
- WAP(Dopra Linux) #tar: write: Broken pipe
复制代码
我尝试了好几种方法,都不行。放弃,把光猫恢复出厂,重头在再来一遍 第一步,开启进猫的安全界面开启telnet
第二步用shell工具,不用也行,直接cmd telnet 192.168.1.1
第三步,看shell是否是全的 我这个是全的
第4步 按照楼主教程走一遍 看看不会卡住吧。。。 结果第一步就报错了 - WAP(Dopra Linux) # cd/tmp && rm hw_ctree*
- rm: can't remove'hw_ctree*': No such file or directory
复制代码
我有不详的预感,还得卡在相同的位置(其实rm hw_ctree*是为了删掉以前编辑的配置文件,防止搞混)
太好了,没卡在解包那一步
但是下面这一步报错了,提示文件夹已存在 - WAP(Dopra Linux) #mkdir etc/rc.d && cd etc/rc.d
- mkdir: can't createdirectory 'etc/rc.d': File exists
复制代码
然后下面这一步报错,提示无此文件或目录。 - WAP(Dopra Linux) #sed -i "s/root:/root:$rootpw/" ../shadow
- /bin/sh: sed: notfound
- WAP(Dopra Linux) #sed -i "s/root:/root:$rootpw/" ../shadow
- sed: ../shadow: Nosuch file or directory
复制代码
因为上面的 - mkdir etc/rc.d && cd etc/rc.d
复制代码
前半部分mkdir etc/rc.d没有执行成功,所以,后面的cdetc/rc.d就不会执行,所以,后面的 - ln -s ../init.d/dropbear S50dropbear
复制代码生成软连接可定就在/opt/upt/apps/apps/目录下了,刚才cd /opt/upt/apps/apps/过去,ls,果然在这里,然后rm S50dropbear,删除了S50dropbear这个软链接。 然后手动cd /etc/rc.d(这是最大的错误) - WAP(Dopra Linux) #cd /opt/upt/apps/apps/
- WAP(Dopra Linux) #ls
- S50dropbear etc opt uds usr var
- WAP(Dopra Linux) #rm S50dropbear
- WAP(Dopra Linux) #ls
- etc opt uds usr var
- WAP(Dopra Linux) #cd /etc/rc.d
- WAP(Dopra Linux) #ls
- init.d rc.shutdown rc.start rc.stop rc.sysinit rc.ttyini
复制代码
随着我对linux各个指令的熟悉,刚才有些地方不懂的,现在一点一点懂了。(我的自以为是害死我了,/汗)
继续,接着就报错了。。系统文件只读。。。 - WAP(Dopra Linux) ln -s ../init.d/dropbear S50dropbear
- ln: S50dropbear: Read-only file system
- WAP(Dopra Linux)cd /etc/rc.d
- WAP(Dopra Linux)# ls
- init.d rc.shutdown rc.start rc.stop rc.sysinit rc.ttyinit
- WAP(Dopra Linux)# ln -s /opt/upt/apps/apps/etc/init.d/dropbear S50dropbear
- ln: S50dropbear:Read-only file system
复制代码
还是报错 提示只读,看来我需要把这个文件夹改下权限(回过头看,当时是钻牛角尖了。) drwxr-xr-x 5 root root 115 Nov 16 2017 rc.d - WAP(Dopra Linux) # chmod -R 777 /etc/rc.d
- chmod: /etc/rc.d: Read-only file system
- chmod: /etc/rc.d: Read-only file system
复制代码
奇怪,还不能改权限。
在网上找了一条指令 不顶事
再来 - cp -d /opt/upt/apps/apps/etc/init.d/S50dropbear /etc/rc.d/
复制代码
-d的意思是,如果源文件是软链接,那么复制过去还是软链接 还是不行。服了。。
网上又找: 还是不行
以下是我的分区 - WAP(Dopra Linux) # vi /etc/fstab
- proc /proc proc defaults 0 0
- sysfs /sys sysfs defaults 0 0
- tmpfs /dev tmpfs defaults 0 0
- devpts /dev/pts devpts mode=620 0 0
- tmpfs /dev/shm tmpfs nodev,size=512m 0 0
- tmpfs /tmp tmpfs nodev,size=512m 0 0
复制代码
重启,没用 明天再说,这一步卡死了。 直接下一步试试 - sed -i"s/root:/root:$rootpw/" /opt/upt/apps/apps/etc/shadow
复制代码
明天再来 刷机也失败
经历了两天,重新回到起点,我找来我的另一台新猫。重新梳理,重新配置,找到了原因 知道为什么报错,只读了,因为 这条命令的误解 - cd /opt/upt/apps/apps/
- tar xzf /tmp/data.tar.gz
- mkdir etc/rc.d && cd etc/rc.d
复制代码
其中,这里的cd etc/rc.d 这个etc前面没“/” 绝对路径命令是,cd /opt/upt/apps/apps/etc/rc.d,而不是/etc/rc.d
就因为这一句的误解,前天晚上,昨天晚上白搭2个晚上,还把猫差点搞砖。 现在这个猫还有点问题,因为固件恢复,是用其他猫,所以,什么标识,wifi,都是那个猫的名字。 ------------------------------------------------------------------以上是傻傻的经验教训,重装ssh-----------------------------------------------------------
|